Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(102)

Side by Side Diff: chrome/browser/extensions/api/management/management_apitest.cc

Issue 14232006: Re-enable various ExtensionManagementApiTest tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <map> 5 #include <map>
6 6
7 #include "chrome/browser/extensions/extension_apitest.h" 7 #include "chrome/browser/extensions/extension_apitest.h"
8 #include "chrome/browser/extensions/extension_service.h" 8 #include "chrome/browser/extensions/extension_service.h"
9 #include "chrome/browser/extensions/extension_system.h" 9 #include "chrome/browser/extensions/extension_system.h"
10 #include "chrome/browser/extensions/extension_test_message_listener.h" 10 #include "chrome/browser/extensions/extension_test_message_listener.h"
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 base::FilePath basedir = test_data_dir_.AppendASCII("management"); 101 base::FilePath basedir = test_data_dir_.AppendASCII("management");
102 InstallNamedExtension(basedir, "internal_extension", Manifest::INTERNAL); 102 InstallNamedExtension(basedir, "internal_extension", Manifest::INTERNAL);
103 InstallNamedExtension(basedir, "external_extension", 103 InstallNamedExtension(basedir, "external_extension",
104 Manifest::EXTERNAL_PREF); 104 Manifest::EXTERNAL_PREF);
105 InstallNamedExtension(basedir, "admin_extension", 105 InstallNamedExtension(basedir, "admin_extension",
106 Manifest::EXTERNAL_POLICY_DOWNLOAD); 106 Manifest::EXTERNAL_POLICY_DOWNLOAD);
107 107
108 ASSERT_TRUE(RunExtensionSubtest("management/test", "basics.html")); 108 ASSERT_TRUE(RunExtensionSubtest("management/test", "basics.html"));
109 } 109 }
110 110
111 // Disabled: http://crbug.com/174411 111 IN_PROC_BROWSER_TEST_F(ExtensionManagementApiTest, Uninstall) {
112 #if defined(OS_WIN)
113 #define MAYBE_Uninstall DISABLED_Uninstall
114 #else
115 #define MAYBE_Uninstall Uninstall
116 #endif
117
118 IN_PROC_BROWSER_TEST_F(ExtensionManagementApiTest, MAYBE_Uninstall) {
119 LoadExtensions(); 112 LoadExtensions();
120 ASSERT_TRUE(RunExtensionSubtest("management/test", "uninstall.html")); 113 ASSERT_TRUE(RunExtensionSubtest("management/test", "uninstall.html"));
121 } 114 }
122 115
123 // Tests actions on extensions when no management policy is in place. 116 // Tests actions on extensions when no management policy is in place.
124 IN_PROC_BROWSER_TEST_F(ExtensionManagementApiTest, ManagementPolicyAllowed) { 117 IN_PROC_BROWSER_TEST_F(ExtensionManagementApiTest, ManagementPolicyAllowed) {
125 LoadExtensions(); 118 LoadExtensions();
126 ExtensionService* service = extensions::ExtensionSystem::Get( 119 ExtensionService* service = extensions::ExtensionSystem::Get(
127 browser()->profile())->extension_service(); 120 browser()->profile())->extension_service();
128 EXPECT_TRUE(service->GetExtensionById(extension_ids_["enabled_extension"], 121 EXPECT_TRUE(service->GetExtensionById(extension_ids_["enabled_extension"],
(...skipping 22 matching lines...) Expand all
151 extensions::ManagementPolicy* policy = extensions::ExtensionSystem::Get( 144 extensions::ManagementPolicy* policy = extensions::ExtensionSystem::Get(
152 browser()->profile())->management_policy(); 145 browser()->profile())->management_policy();
153 policy->UnregisterAllProviders(); 146 policy->UnregisterAllProviders();
154 extensions::TestManagementPolicyProvider provider( 147 extensions::TestManagementPolicyProvider provider(
155 extensions::TestManagementPolicyProvider::PROHIBIT_MODIFY_STATUS); 148 extensions::TestManagementPolicyProvider::PROHIBIT_MODIFY_STATUS);
156 policy->RegisterProvider(&provider); 149 policy->RegisterProvider(&provider);
157 ASSERT_TRUE(RunExtensionSubtest("management/management_policy", 150 ASSERT_TRUE(RunExtensionSubtest("management/management_policy",
158 "prohibited.html")); 151 "prohibited.html"));
159 } 152 }
160 153
161 // Disabled. See http://crbug.com/176023 154 IN_PROC_BROWSER_TEST_F(ExtensionManagementApiTest, LaunchPanelApp) {
162 IN_PROC_BROWSER_TEST_F(ExtensionManagementApiTest, DISABLED_LaunchPanelApp) {
163 ExtensionService* service = extensions::ExtensionSystem::Get( 155 ExtensionService* service = extensions::ExtensionSystem::Get(
164 browser()->profile())->extension_service(); 156 browser()->profile())->extension_service();
165 157
166 // Load an extension that calls launchApp() on any app that gets 158 // Load an extension that calls launchApp() on any app that gets
167 // installed. 159 // installed.
168 ExtensionTestMessageListener launcher_loaded("launcher loaded", false); 160 ExtensionTestMessageListener launcher_loaded("launcher loaded", false);
169 ASSERT_TRUE(LoadExtension( 161 ASSERT_TRUE(LoadExtension(
170 test_data_dir_.AppendASCII("management/launch_on_install"))); 162 test_data_dir_.AppendASCII("management/launch_on_install")));
171 ASSERT_TRUE(launcher_loaded.WaitUntilSatisfied()); 163 ASSERT_TRUE(launcher_loaded.WaitUntilSatisfied());
172 164
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 203
212 // Find the app's browser. Apps that should load in a panel ignore 204 // Find the app's browser. Apps that should load in a panel ignore
213 // prefs, so we should still see the launch in a popup. 205 // prefs, so we should still see the launch in a popup.
214 ASSERT_EQ(2u, chrome::GetBrowserCount(browser()->profile(), 206 ASSERT_EQ(2u, chrome::GetBrowserCount(browser()->profile(),
215 browser()->host_desktop_type())); 207 browser()->host_desktop_type()));
216 app_browser = FindOtherBrowser(browser()); 208 app_browser = FindOtherBrowser(browser());
217 ASSERT_TRUE(app_browser->is_type_popup()); 209 ASSERT_TRUE(app_browser->is_type_popup());
218 ASSERT_TRUE(app_browser->is_app()); 210 ASSERT_TRUE(app_browser->is_app());
219 } 211 }
220 212
221 // Disabled: http://crbug.com/230165 213 IN_PROC_BROWSER_TEST_F(ExtensionManagementApiTest, LaunchTabApp) {
222 #if defined(OS_WIN)
223 #define MAYBE_LaunchTabApp DISABLED_LaunchTabApp
224 #else
225 #define MAYBE_LaunchTabApp LaunchTabApp
226 #endif
227 IN_PROC_BROWSER_TEST_F(ExtensionManagementApiTest, MAYBE_LaunchTabApp) {
228 ExtensionService* service = extensions::ExtensionSystem::Get( 214 ExtensionService* service = extensions::ExtensionSystem::Get(
229 browser()->profile())->extension_service(); 215 browser()->profile())->extension_service();
230 216
231 // Load an extension that calls launchApp() on any app that gets 217 // Load an extension that calls launchApp() on any app that gets
232 // installed. 218 // installed.
233 ExtensionTestMessageListener launcher_loaded("launcher loaded", false); 219 ExtensionTestMessageListener launcher_loaded("launcher loaded", false);
234 ASSERT_TRUE(LoadExtension( 220 ASSERT_TRUE(LoadExtension(
235 test_data_dir_.AppendASCII("management/launch_on_install"))); 221 test_data_dir_.AppendASCII("management/launch_on_install")));
236 ASSERT_TRUE(launcher_loaded.WaitUntilSatisfied()); 222 ASSERT_TRUE(launcher_loaded.WaitUntilSatisfied());
237 223
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 ASSERT_EQ(2, browser()->tab_strip_model()->count()); 262 ASSERT_EQ(2, browser()->tab_strip_model()->count());
277 #else 263 #else
278 // Find the app's browser. Opening in a new window will create 264 // Find the app's browser. Opening in a new window will create
279 // a new browser. 265 // a new browser.
280 ASSERT_EQ(2u, chrome::GetBrowserCount(browser()->profile(), 266 ASSERT_EQ(2u, chrome::GetBrowserCount(browser()->profile(),
281 browser()->host_desktop_type())); 267 browser()->host_desktop_type()));
282 Browser* app_browser = FindOtherBrowser(browser()); 268 Browser* app_browser = FindOtherBrowser(browser());
283 ASSERT_TRUE(app_browser->is_app()); 269 ASSERT_TRUE(app_browser->is_app());
284 #endif 270 #endif
285 } 271 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698