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 "base/stringprintf.h" | 6 #include "base/stringprintf.h" |
7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
8 #include "chrome/browser/extensions/extension_host.h" | 8 #include "chrome/browser/extensions/extension_host.h" |
9 #include "chrome/browser/extensions/extension_install_ui.h" | 9 #include "chrome/browser/extensions/extension_install_ui.h" |
10 #include "chrome/browser/extensions/extension_service.h" | 10 #include "chrome/browser/extensions/extension_service.h" |
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
347 CommandLine command_line_test2(CommandLine::NO_PROGRAM); | 347 CommandLine command_line_test2(CommandLine::NO_PROGRAM); |
348 command_line_test1.AppendSwitchASCII(switches::kLimitedInstallFromWebstore, | 348 command_line_test1.AppendSwitchASCII(switches::kLimitedInstallFromWebstore, |
349 "2"); | 349 "2"); |
350 EXPECT_EQ(kTestExtensionId, | 350 EXPECT_EQ(kTestExtensionId, |
351 helper.WebStoreIdFromLimitedInstallCmdLine(command_line_test1)); | 351 helper.WebStoreIdFromLimitedInstallCmdLine(command_line_test1)); |
352 | 352 |
353 // Now, on to the real test for LimitedInstallFromWebstore. | 353 // Now, on to the real test for LimitedInstallFromWebstore. |
354 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 354 CommandLine* command_line = CommandLine::ForCurrentProcess(); |
355 command_line->AppendSwitchASCII( | 355 command_line->AppendSwitchASCII( |
356 switches::kLimitedInstallFromWebstore, "2"); | 356 switches::kLimitedInstallFromWebstore, "2"); |
357 command_line->AppendSwitchASCII( | |
358 switches::kAppsGalleryInstallAutoConfirmForTests, "accept"); | |
359 helper.LimitedInstallFromWebstore(*command_line, browser()->profile(), | 357 helper.LimitedInstallFromWebstore(*command_line, browser()->profile(), |
360 MessageLoop::QuitWhenIdleClosure()); | 358 MessageLoop::QuitWhenIdleClosure()); |
361 MessageLoop::current()->Run(); | 359 MessageLoop::current()->Run(); |
362 | 360 |
363 EXPECT_TRUE(saw_install()); | 361 EXPECT_TRUE(saw_install()); |
364 EXPECT_EQ(0, browser_open_count()); | 362 EXPECT_EQ(0, browser_open_count()); |
365 } | 363 } |
366 | |
367 IN_PROC_BROWSER_TEST_F(CommandLineWebstoreInstall, LimitedCancel) { | |
James Hawkins
2013/04/19 23:53:23
Is there any test that needs to be added?
| |
368 CommandLine* command_line = CommandLine::ForCurrentProcess(); | |
369 command_line->AppendSwitchASCII( | |
370 switches::kLimitedInstallFromWebstore, "2"); | |
371 command_line->AppendSwitchASCII( | |
372 switches::kAppsGalleryInstallAutoConfirmForTests, "cancel"); | |
373 extensions::StartupHelper helper; | |
374 helper.LimitedInstallFromWebstore(*command_line, browser()->profile(), | |
375 MessageLoop::QuitWhenIdleClosure()); | |
376 MessageLoop::current()->Run(); | |
377 EXPECT_FALSE(saw_install()); | |
378 EXPECT_EQ(0, browser_open_count()); | |
379 } | |
OLD | NEW |