| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/files/file_path.h" | 5 #include "base/files/file_path.h" |
| 6 #include "base/files/scoped_temp_dir.h" | 6 #include "base/files/scoped_temp_dir.h" |
| 7 #include "base/threading/sequenced_worker_pool.h" | 7 #include "base/threading/sequenced_worker_pool.h" |
| 8 #include "chrome/app/chrome_command_ids.h" | 8 #include "chrome/app/chrome_command_ids.h" |
| 9 #include "chrome/browser/extensions/extension_browsertest.h" | 9 #include "chrome/browser/extensions/extension_browsertest.h" |
| 10 #include "chrome/browser/extensions/extension_service.h" | 10 #include "chrome/browser/extensions/extension_service.h" |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 EXPECT_EQ("2", extension->VersionString()); | 237 EXPECT_EQ("2", extension->VersionString()); |
| 238 EXPECT_EQ(1u, registry_->disabled_extensions().size()); | 238 EXPECT_EQ(1u, registry_->disabled_extensions().size()); |
| 239 EXPECT_EQ(Extension::DISABLE_PERMISSIONS_INCREASE, | 239 EXPECT_EQ(Extension::DISABLE_PERMISSIONS_INCREASE, |
| 240 ExtensionPrefs::Get(service_->profile()) | 240 ExtensionPrefs::Get(service_->profile()) |
| 241 ->GetDisableReasons(extension_id)); | 241 ->GetDisableReasons(extension_id)); |
| 242 EXPECT_TRUE(GetExtensionDisabledGlobalError()); | 242 EXPECT_TRUE(GetExtensionDisabledGlobalError()); |
| 243 } | 243 } |
| 244 | 244 |
| 245 // Test that an error appears if an extension gets installed server side. | 245 // Test that an error appears if an extension gets installed server side. |
| 246 IN_PROC_BROWSER_TEST_F(ExtensionDisabledGlobalErrorTest, RemoteInstall) { | 246 IN_PROC_BROWSER_TEST_F(ExtensionDisabledGlobalErrorTest, RemoteInstall) { |
| 247 static const char* extension_id = "pgdpcfcocojkjfbgpiianjngphoopgmo"; | 247 static const char extension_id[] = "pgdpcfcocojkjfbgpiianjngphoopgmo"; |
| 248 ExtensionSyncService* sync_service = | 248 ExtensionSyncService* sync_service = |
| 249 ExtensionSyncService::Get(browser()->profile()); | 249 ExtensionSyncService::Get(browser()->profile()); |
| 250 | 250 |
| 251 // Note: This interceptor gets requests on the IO thread. | 251 // Note: This interceptor gets requests on the IO thread. |
| 252 net::LocalHostTestURLRequestInterceptor interceptor( | 252 net::LocalHostTestURLRequestInterceptor interceptor( |
| 253 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO), | 253 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO), |
| 254 BrowserThread::GetBlockingPool()->GetTaskRunnerWithShutdownBehavior( | 254 BrowserThread::GetBlockingPool()->GetTaskRunnerWithShutdownBehavior( |
| 255 base::SequencedWorkerPool::SKIP_ON_SHUTDOWN)); | 255 base::SequencedWorkerPool::SKIP_ON_SHUTDOWN)); |
| 256 net::URLFetcher::SetEnableInterceptionForTests(true); | 256 net::URLFetcher::SetEnableInterceptionForTests(true); |
| 257 interceptor.SetResponseIgnoreQuery( | 257 interceptor.SetResponseIgnoreQuery( |
| (...skipping 29 matching lines...) Expand all Loading... |
| 287 | 287 |
| 288 const Extension* extension = service_->GetExtensionById(extension_id, true); | 288 const Extension* extension = service_->GetExtensionById(extension_id, true); |
| 289 ASSERT_TRUE(extension); | 289 ASSERT_TRUE(extension); |
| 290 EXPECT_EQ("2", extension->VersionString()); | 290 EXPECT_EQ("2", extension->VersionString()); |
| 291 EXPECT_EQ(1u, registry_->disabled_extensions().size()); | 291 EXPECT_EQ(1u, registry_->disabled_extensions().size()); |
| 292 EXPECT_EQ(Extension::DISABLE_REMOTE_INSTALL, | 292 EXPECT_EQ(Extension::DISABLE_REMOTE_INSTALL, |
| 293 ExtensionPrefs::Get(service_->profile()) | 293 ExtensionPrefs::Get(service_->profile()) |
| 294 ->GetDisableReasons(extension_id)); | 294 ->GetDisableReasons(extension_id)); |
| 295 EXPECT_TRUE(GetExtensionDisabledGlobalError()); | 295 EXPECT_TRUE(GetExtensionDisabledGlobalError()); |
| 296 } | 296 } |
| OLD | NEW |