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

Side by Side Diff: chrome/browser/extensions/webstore_startup_installer_browsertest.cc

Issue 14413004: Merge 195393 "Two fixes for the limited install from webstore flag." (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1453/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 | « chrome/browser/extensions/startup_helper.cc ('k') | 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 "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 335 matching lines...) Expand 10 before | Expand all | Expand 10 after
346 CommandLine command_line_test2(CommandLine::NO_PROGRAM); 346 CommandLine command_line_test2(CommandLine::NO_PROGRAM);
347 command_line_test1.AppendSwitchASCII(switches::kLimitedInstallFromWebstore, 347 command_line_test1.AppendSwitchASCII(switches::kLimitedInstallFromWebstore,
348 "2"); 348 "2");
349 EXPECT_EQ(kTestExtensionId, 349 EXPECT_EQ(kTestExtensionId,
350 helper.WebStoreIdFromLimitedInstallCmdLine(command_line_test1)); 350 helper.WebStoreIdFromLimitedInstallCmdLine(command_line_test1));
351 351
352 // Now, on to the real test for LimitedInstallFromWebstore. 352 // Now, on to the real test for LimitedInstallFromWebstore.
353 CommandLine* command_line = CommandLine::ForCurrentProcess(); 353 CommandLine* command_line = CommandLine::ForCurrentProcess();
354 command_line->AppendSwitchASCII( 354 command_line->AppendSwitchASCII(
355 switches::kLimitedInstallFromWebstore, "2"); 355 switches::kLimitedInstallFromWebstore, "2");
356 command_line->AppendSwitchASCII(
357 switches::kAppsGalleryInstallAutoConfirmForTests, "accept");
358 helper.LimitedInstallFromWebstore(*command_line, browser()->profile(), 356 helper.LimitedInstallFromWebstore(*command_line, browser()->profile(),
359 MessageLoop::QuitWhenIdleClosure()); 357 MessageLoop::QuitWhenIdleClosure());
360 MessageLoop::current()->Run(); 358 MessageLoop::current()->Run();
361 359
362 EXPECT_TRUE(saw_install()); 360 EXPECT_TRUE(saw_install());
363 EXPECT_EQ(0, browser_open_count()); 361 EXPECT_EQ(0, browser_open_count());
364 } 362 }
365
366 IN_PROC_BROWSER_TEST_F(CommandLineWebstoreInstall, LimitedCancel) {
367 CommandLine* command_line = CommandLine::ForCurrentProcess();
368 command_line->AppendSwitchASCII(
369 switches::kLimitedInstallFromWebstore, "2");
370 command_line->AppendSwitchASCII(
371 switches::kAppsGalleryInstallAutoConfirmForTests, "cancel");
372 extensions::StartupHelper helper;
373 helper.LimitedInstallFromWebstore(*command_line, browser()->profile(),
374 MessageLoop::QuitWhenIdleClosure());
375 MessageLoop::current()->Run();
376 EXPECT_FALSE(saw_install());
377 EXPECT_EQ(0, browser_open_count());
378 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/startup_helper.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698