| 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 16 matching lines...) Expand all Loading... |
| 27 #include "sync/protocol/extension_specifics.pb.h" | 27 #include "sync/protocol/extension_specifics.pb.h" |
| 28 #include "sync/protocol/sync.pb.h" | 28 #include "sync/protocol/sync.pb.h" |
| 29 | 29 |
| 30 using content::BrowserThread; | 30 using content::BrowserThread; |
| 31 using extensions::Extension; | 31 using extensions::Extension; |
| 32 using extensions::ExtensionRegistry; | 32 using extensions::ExtensionRegistry; |
| 33 using extensions::ExtensionPrefs; | 33 using extensions::ExtensionPrefs; |
| 34 | 34 |
| 35 class ExtensionDisabledGlobalErrorTest : public ExtensionBrowserTest { | 35 class ExtensionDisabledGlobalErrorTest : public ExtensionBrowserTest { |
| 36 protected: | 36 protected: |
| 37 virtual void SetUpCommandLine(CommandLine* command_line) override { | 37 void SetUpCommandLine(CommandLine* command_line) override { |
| 38 ExtensionBrowserTest::SetUpCommandLine(command_line); | 38 ExtensionBrowserTest::SetUpCommandLine(command_line); |
| 39 command_line->AppendSwitchASCII(switches::kAppsGalleryUpdateURL, | 39 command_line->AppendSwitchASCII(switches::kAppsGalleryUpdateURL, |
| 40 "http://localhost/autoupdate/updates.xml"); | 40 "http://localhost/autoupdate/updates.xml"); |
| 41 } | 41 } |
| 42 | 42 |
| 43 virtual void SetUpOnMainThread() override { | 43 void SetUpOnMainThread() override { |
| 44 ExtensionBrowserTest::SetUpOnMainThread(); | 44 ExtensionBrowserTest::SetUpOnMainThread(); |
| 45 EXPECT_TRUE(scoped_temp_dir_.CreateUniqueTempDir()); | 45 EXPECT_TRUE(scoped_temp_dir_.CreateUniqueTempDir()); |
| 46 service_ = extensions::ExtensionSystem::Get( | 46 service_ = extensions::ExtensionSystem::Get( |
| 47 browser()->profile())->extension_service(); | 47 browser()->profile())->extension_service(); |
| 48 registry_ = ExtensionRegistry::Get(browser()->profile()); | 48 registry_ = ExtensionRegistry::Get(browser()->profile()); |
| 49 const base::FilePath test_dir = | 49 const base::FilePath test_dir = |
| 50 test_data_dir_.AppendASCII("permissions_increase"); | 50 test_data_dir_.AppendASCII("permissions_increase"); |
| 51 const base::FilePath pem_path = test_dir.AppendASCII("permissions.pem"); | 51 const base::FilePath pem_path = test_dir.AppendASCII("permissions.pem"); |
| 52 path_v1_ = PackExtensionWithOptions( | 52 path_v1_ = PackExtensionWithOptions( |
| 53 test_dir.AppendASCII("v1"), | 53 test_dir.AppendASCII("v1"), |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after 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 |