| 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 "chrome/app/chrome_command_ids.h" | 7 #include "chrome/app/chrome_command_ids.h" |
| 8 #include "chrome/browser/extensions/extension_browsertest.h" | 8 #include "chrome/browser/extensions/extension_browsertest.h" |
| 9 #include "chrome/browser/extensions/extension_prefs.h" | 9 #include "chrome/browser/extensions/extension_prefs.h" |
| 10 #include "chrome/browser/extensions/extension_service.h" | 10 #include "chrome/browser/extensions/extension_service.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 | 23 |
| 24 class ExtensionDisabledGlobalErrorTest : public ExtensionBrowserTest { | 24 class ExtensionDisabledGlobalErrorTest : public ExtensionBrowserTest { |
| 25 protected: | 25 protected: |
| 26 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 26 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { |
| 27 ExtensionBrowserTest::SetUpCommandLine(command_line); | 27 ExtensionBrowserTest::SetUpCommandLine(command_line); |
| 28 command_line->AppendSwitchASCII(switches::kAppsGalleryUpdateURL, | 28 command_line->AppendSwitchASCII(switches::kAppsGalleryUpdateURL, |
| 29 "http://localhost/autoupdate/updates.xml"); | 29 "http://localhost/autoupdate/updates.xml"); |
| 30 } | 30 } |
| 31 | 31 |
| 32 virtual void SetUpOnMainThread() OVERRIDE { | 32 virtual void SetUpOnMainThread() OVERRIDE { |
| 33 ExtensionBrowserTest::SetUpOnMainThread(); |
| 33 EXPECT_TRUE(scoped_temp_dir_.CreateUniqueTempDir()); | 34 EXPECT_TRUE(scoped_temp_dir_.CreateUniqueTempDir()); |
| 34 service_ = browser()->profile()->GetExtensionService(); | 35 service_ = browser()->profile()->GetExtensionService(); |
| 35 base::FilePath pem_path = test_data_dir_. | 36 base::FilePath pem_path = test_data_dir_. |
| 36 AppendASCII("permissions_increase").AppendASCII("permissions.pem"); | 37 AppendASCII("permissions_increase").AppendASCII("permissions.pem"); |
| 37 path_v1_ = PackExtensionWithOptions( | 38 path_v1_ = PackExtensionWithOptions( |
| 38 test_data_dir_.AppendASCII("permissions_increase").AppendASCII("v1"), | 39 test_data_dir_.AppendASCII("permissions_increase").AppendASCII("v1"), |
| 39 scoped_temp_dir_.path().AppendASCII("permissions1.crx"), | 40 scoped_temp_dir_.path().AppendASCII("permissions1.crx"), |
| 40 pem_path, | 41 pem_path, |
| 41 base::FilePath()); | 42 base::FilePath()); |
| 42 path_v2_ = PackExtensionWithOptions( | 43 path_v2_ = PackExtensionWithOptions( |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 WaitForExtensionInstall(); | 210 WaitForExtensionInstall(); |
| 210 | 211 |
| 211 extension = service_->GetExtensionById(extension_id, true); | 212 extension = service_->GetExtensionById(extension_id, true); |
| 212 ASSERT_TRUE(extension); | 213 ASSERT_TRUE(extension); |
| 213 EXPECT_EQ("2", extension->VersionString()); | 214 EXPECT_EQ("2", extension->VersionString()); |
| 214 EXPECT_EQ(1u, service_->disabled_extensions()->size()); | 215 EXPECT_EQ(1u, service_->disabled_extensions()->size()); |
| 215 EXPECT_EQ(Extension::DISABLE_PERMISSIONS_INCREASE, | 216 EXPECT_EQ(Extension::DISABLE_PERMISSIONS_INCREASE, |
| 216 service_->extension_prefs()->GetDisableReasons(extension_id)); | 217 service_->extension_prefs()->GetDisableReasons(extension_id)); |
| 217 EXPECT_TRUE(GetExtensionDisabledGlobalError()); | 218 EXPECT_TRUE(GetExtensionDisabledGlobalError()); |
| 218 } | 219 } |
| OLD | NEW |