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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 // Tests that no error appears if the user disabled the extension. | 130 // Tests that no error appears if the user disabled the extension. |
131 IN_PROC_BROWSER_TEST_F(ExtensionDisabledGlobalErrorTest, UserDisabled) { | 131 IN_PROC_BROWSER_TEST_F(ExtensionDisabledGlobalErrorTest, UserDisabled) { |
132 const Extension* extension = InstallIncreasingPermissionExtensionV1(); | 132 const Extension* extension = InstallIncreasingPermissionExtensionV1(); |
133 DisableExtension(extension->id()); | 133 DisableExtension(extension->id()); |
134 extension = UpdateIncreasingPermissionExtension(extension, path_v2_, 0); | 134 extension = UpdateIncreasingPermissionExtension(extension, path_v2_, 0); |
135 ASSERT_FALSE(GetExtensionDisabledGlobalError()); | 135 ASSERT_FALSE(GetExtensionDisabledGlobalError()); |
136 } | 136 } |
137 | 137 |
138 // Test that no error appears if the disable reason is unknown | 138 // Test that no error appears if the disable reason is unknown |
139 // (but probably was by the user). | 139 // (but probably was by the user). |
| 140 // Disabled due to http://crbug.com/246431 |
140 IN_PROC_BROWSER_TEST_F(ExtensionDisabledGlobalErrorTest, | 141 IN_PROC_BROWSER_TEST_F(ExtensionDisabledGlobalErrorTest, |
141 UnknownReasonSamePermissions) { | 142 DISABLED_UnknownReasonSamePermissions) { |
142 const Extension* extension = InstallIncreasingPermissionExtensionV1(); | 143 const Extension* extension = InstallIncreasingPermissionExtensionV1(); |
143 DisableExtension(extension->id()); | 144 DisableExtension(extension->id()); |
144 // Clear disable reason to simulate legacy disables. | 145 // Clear disable reason to simulate legacy disables. |
145 service_->extension_prefs()->ClearDisableReasons(extension->id()); | 146 service_->extension_prefs()->ClearDisableReasons(extension->id()); |
146 // Upgrade to version 2. Infer from version 1 having the same permissions | 147 // Upgrade to version 2. Infer from version 1 having the same permissions |
147 // granted by the user that it was disabled by the user. | 148 // granted by the user that it was disabled by the user. |
148 extension = UpdateIncreasingPermissionExtension(extension, path_v2_, 0); | 149 extension = UpdateIncreasingPermissionExtension(extension, path_v2_, 0); |
149 ASSERT_TRUE(extension); | 150 ASSERT_TRUE(extension); |
150 ASSERT_FALSE(GetExtensionDisabledGlobalError()); | 151 ASSERT_FALSE(GetExtensionDisabledGlobalError()); |
151 } | 152 } |
(...skipping 57 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 |