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/command_line.h" | 5 #include "base/command_line.h" |
6 #include "chrome/browser/chrome_notification_types.h" | 6 #include "chrome/browser/chrome_notification_types.h" |
7 #include "chrome/browser/extensions/extension_install_ui.h" | 7 #include "chrome/browser/extensions/extension_install_ui.h" |
8 #include "chrome/browser/extensions/extension_service.h" | 8 #include "chrome/browser/extensions/extension_service.h" |
9 #include "chrome/browser/extensions/startup_helper.h" | 9 #include "chrome/browser/extensions/startup_helper.h" |
10 #include "chrome/browser/extensions/webstore_installer_test.h" | 10 #include "chrome/browser/extensions/webstore_installer_test.h" |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 RunTest("runTest"); | 170 RunTest("runTest"); |
171 EXPECT_TRUE(extension_service->extensions()->Contains(kTestExtensionId)); | 171 EXPECT_TRUE(extension_service->extensions()->Contains(kTestExtensionId)); |
172 } | 172 } |
173 | 173 |
174 class WebstoreStartupInstallerManagedUsersTest | 174 class WebstoreStartupInstallerManagedUsersTest |
175 : public WebstoreStartupInstallerTest { | 175 : public WebstoreStartupInstallerTest { |
176 public: | 176 public: |
177 // InProcessBrowserTest overrides: | 177 // InProcessBrowserTest overrides: |
178 virtual void SetUpCommandLine(base::CommandLine* command_line) OVERRIDE { | 178 virtual void SetUpCommandLine(base::CommandLine* command_line) OVERRIDE { |
179 WebstoreStartupInstallerTest::SetUpCommandLine(command_line); | 179 WebstoreStartupInstallerTest::SetUpCommandLine(command_line); |
180 command_line->AppendSwitchASCII(switches::kManagedUserId, "asdf"); | 180 command_line->AppendSwitchASCII(switches::kSupervisedUserId, "asdf"); |
181 } | 181 } |
182 }; | 182 }; |
183 | 183 |
184 IN_PROC_BROWSER_TEST_F(WebstoreStartupInstallerManagedUsersTest, | 184 IN_PROC_BROWSER_TEST_F(WebstoreStartupInstallerManagedUsersTest, |
185 InstallProhibited) { | 185 InstallProhibited) { |
186 #if defined(OS_WIN) && defined(USE_ASH) | 186 #if defined(OS_WIN) && defined(USE_ASH) |
187 // Disable this test in Metro+Ash for now (http://crbug.com/262796). | 187 // Disable this test in Metro+Ash for now (http://crbug.com/262796). |
188 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 188 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
189 switches::kAshBrowserTests)) | 189 switches::kAshBrowserTests)) |
190 return; | 190 return; |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
326 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | 326 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
327 command_line->AppendSwitchASCII( | 327 command_line->AppendSwitchASCII( |
328 switches::kLimitedInstallFromWebstore, "2"); | 328 switches::kLimitedInstallFromWebstore, "2"); |
329 helper.LimitedInstallFromWebstore(*command_line, browser()->profile(), | 329 helper.LimitedInstallFromWebstore(*command_line, browser()->profile(), |
330 base::MessageLoop::QuitWhenIdleClosure()); | 330 base::MessageLoop::QuitWhenIdleClosure()); |
331 base::MessageLoop::current()->Run(); | 331 base::MessageLoop::current()->Run(); |
332 | 332 |
333 EXPECT_TRUE(saw_install()); | 333 EXPECT_TRUE(saw_install()); |
334 EXPECT_EQ(0, browser_open_count()); | 334 EXPECT_EQ(0, browser_open_count()); |
335 } | 335 } |
OLD | NEW |