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