OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/ref_counted.h" | 5 #include "base/ref_counted.h" |
6 #include "chrome/browser/browser.h" | 6 #include "chrome/browser/browser.h" |
7 #include "chrome/browser/renderer_host/render_view_host.h" | 7 #include "chrome/browser/renderer_host/render_view_host.h" |
8 #include "chrome/browser/extensions/autoupdate_interceptor.h" | 8 #include "chrome/browser/extensions/autoupdate_interceptor.h" |
9 #include "chrome/browser/extensions/extension_browsertest.h" | 9 #include "chrome/browser/extensions/extension_browsertest.h" |
10 #include "chrome/browser/extensions/extension_host.h" | 10 #include "chrome/browser/extensions/extension_host.h" |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 // Open an incognito window to the extensions management page. We just | 124 // Open an incognito window to the extensions management page. We just |
125 // want to make sure that we don't crash while playing with extensions when | 125 // want to make sure that we don't crash while playing with extensions when |
126 // this guy is around. | 126 // this guy is around. |
127 ui_test_utils::OpenURLOffTheRecord(browser()->profile(), | 127 ui_test_utils::OpenURLOffTheRecord(browser()->profile(), |
128 GURL(chrome::kChromeUIExtensionsURL)); | 128 GURL(chrome::kChromeUIExtensionsURL)); |
129 | 129 |
130 ASSERT_TRUE(InstallExtension(test_data_dir_.AppendASCII("good.crx"), 1)); | 130 ASSERT_TRUE(InstallExtension(test_data_dir_.AppendASCII("good.crx"), 1)); |
131 UninstallExtension("ldnnhddmnhbkjipkidpdiheffobcpfmf"); | 131 UninstallExtension("ldnnhddmnhbkjipkidpdiheffobcpfmf"); |
132 } | 132 } |
133 | 133 |
134 #if defined(OS_LINUX) | |
135 // See http://crbug.com/32906 and http://crbug.com/36890 | |
136 #define MAYBE_UpdatePermissions DISABLED_UpdatePermissions | |
137 #else | |
138 #define MAYBE_UpdatePermissions UpdatePermissions | |
139 #endif | |
140 | |
141 // Tests the process of updating an extension to one that requires higher | 134 // Tests the process of updating an extension to one that requires higher |
142 // permissions. | 135 // permissions. |
143 IN_PROC_BROWSER_TEST_F(ExtensionManagementTest, MAYBE_UpdatePermissions) { | 136 IN_PROC_BROWSER_TEST_F(ExtensionManagementTest, UpdatePermissions) { |
144 ExtensionsService* service = browser()->profile()->GetExtensionsService(); | 137 ExtensionsService* service = browser()->profile()->GetExtensionsService(); |
145 ASSERT_TRUE(InstallAndUpdateIncreasingPermissionsExtension()); | 138 ASSERT_TRUE(InstallAndUpdateIncreasingPermissionsExtension()); |
146 const size_t size_before = service->extensions()->size(); | 139 const size_t size_before = service->extensions()->size(); |
147 | 140 |
148 // Now try reenabling it. | 141 // Now try reenabling it. |
149 service->EnableExtension(service->disabled_extensions()->at(0)->id()); | 142 service->EnableExtension(service->disabled_extensions()->at(0)->id()); |
150 EXPECT_EQ(size_before + 1, service->extensions()->size()); | 143 EXPECT_EQ(size_before + 1, service->extensions()->size()); |
151 EXPECT_EQ(0u, service->disabled_extensions()->size()); | 144 EXPECT_EQ(0u, service->disabled_extensions()->size()); |
152 } | 145 } |
153 | 146 |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 service->updater()->CheckNow(); | 235 service->updater()->CheckNow(); |
243 ASSERT_TRUE(WaitForExtensionInstallError()); | 236 ASSERT_TRUE(WaitForExtensionInstallError()); |
244 | 237 |
245 // Make sure the extension state is the same as before. | 238 // Make sure the extension state is the same as before. |
246 extensions = service->extensions(); | 239 extensions = service->extensions(); |
247 ASSERT_EQ(size_before + 1, extensions->size()); | 240 ASSERT_EQ(size_before + 1, extensions->size()); |
248 ASSERT_EQ("ogjcoiohnmldgjemafoockdghcjciccf", | 241 ASSERT_EQ("ogjcoiohnmldgjemafoockdghcjciccf", |
249 extensions->at(size_before)->id()); | 242 extensions->at(size_before)->id()); |
250 ASSERT_EQ("2.0", extensions->at(size_before)->VersionString()); | 243 ASSERT_EQ("2.0", extensions->at(size_before)->VersionString()); |
251 } | 244 } |
OLD | NEW |