| 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 23 matching lines...) Expand all Loading... |
| 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 virtual 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 virtual void SetUpOnMainThread() override { |
| 44 ExtensionBrowserTest::SetUpOnMainThread(); | |
| 45 EXPECT_TRUE(scoped_temp_dir_.CreateUniqueTempDir()); | 44 EXPECT_TRUE(scoped_temp_dir_.CreateUniqueTempDir()); |
| 46 service_ = extensions::ExtensionSystem::Get( | 45 service_ = extensions::ExtensionSystem::Get( |
| 47 browser()->profile())->extension_service(); | 46 browser()->profile())->extension_service(); |
| 48 registry_ = ExtensionRegistry::Get(browser()->profile()); | 47 registry_ = ExtensionRegistry::Get(browser()->profile()); |
| 49 const base::FilePath test_dir = | 48 const base::FilePath test_dir = |
| 50 test_data_dir_.AppendASCII("permissions_increase"); | 49 test_data_dir_.AppendASCII("permissions_increase"); |
| 51 const base::FilePath pem_path = test_dir.AppendASCII("permissions.pem"); | 50 const base::FilePath pem_path = test_dir.AppendASCII("permissions.pem"); |
| 52 path_v1_ = PackExtensionWithOptions( | 51 path_v1_ = PackExtensionWithOptions( |
| 53 test_dir.AppendASCII("v1"), | 52 test_dir.AppendASCII("v1"), |
| 54 scoped_temp_dir_.path().AppendASCII("permissions1.crx"), | 53 scoped_temp_dir_.path().AppendASCII("permissions1.crx"), |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 | 286 |
| 288 const Extension* extension = service_->GetExtensionById(extension_id, true); | 287 const Extension* extension = service_->GetExtensionById(extension_id, true); |
| 289 ASSERT_TRUE(extension); | 288 ASSERT_TRUE(extension); |
| 290 EXPECT_EQ("2", extension->VersionString()); | 289 EXPECT_EQ("2", extension->VersionString()); |
| 291 EXPECT_EQ(1u, registry_->disabled_extensions().size()); | 290 EXPECT_EQ(1u, registry_->disabled_extensions().size()); |
| 292 EXPECT_EQ(Extension::DISABLE_REMOTE_INSTALL, | 291 EXPECT_EQ(Extension::DISABLE_REMOTE_INSTALL, |
| 293 ExtensionPrefs::Get(service_->profile()) | 292 ExtensionPrefs::Get(service_->profile()) |
| 294 ->GetDisableReasons(extension_id)); | 293 ->GetDisableReasons(extension_id)); |
| 295 EXPECT_TRUE(GetExtensionDisabledGlobalError()); | 294 EXPECT_TRUE(GetExtensionDisabledGlobalError()); |
| 296 } | 295 } |
| OLD | NEW |