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

Side by Side Diff: chrome/browser/printing/cloud_print/test/cloud_print_proxy_process_browsertest.cc

Issue 397793002: Eliminate CreateBooleanValue from test files (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix bad merge Created 6 years, 5 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
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 // Create a service process that uses a Mock to respond to the browser in order 5 // Create a service process that uses a Mock to respond to the browser in order
6 // to test launching the browser using the cloud print policy check command 6 // to test launching the browser using the cloud print policy check command
7 // line switch. 7 // line switch.
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after
597 TestingProfile* profile = 597 TestingProfile* profile =
598 profile_manager.CreateTestingProfile("StartBrowserWithPolicy"); 598 profile_manager.CreateTestingProfile("StartBrowserWithPolicy");
599 CloudPrintProxyServiceFactory::GetInstance()-> 599 CloudPrintProxyServiceFactory::GetInstance()->
600 SetTestingFactory(profile, CloudPrintProxyServiceFactoryForPolicyTest); 600 SetTestingFactory(profile, CloudPrintProxyServiceFactoryForPolicyTest);
601 601
602 TestingPrefServiceSyncable* prefs = profile->GetTestingPrefService(); 602 TestingPrefServiceSyncable* prefs = profile->GetTestingPrefService();
603 prefs->SetUserPref(prefs::kCloudPrintEmail, 603 prefs->SetUserPref(prefs::kCloudPrintEmail,
604 base::Value::CreateStringValue( 604 base::Value::CreateStringValue(
605 MockServiceIPCServer::EnabledUserId())); 605 MockServiceIPCServer::EnabledUserId()));
606 prefs->SetManagedPref(prefs::kCloudPrintProxyEnabled, 606 prefs->SetManagedPref(prefs::kCloudPrintProxyEnabled,
607 base::Value::CreateBooleanValue(false)); 607 new base::FundamentalValue(false));
608 608
609 CommandLine command_line(CommandLine::NO_PROGRAM); 609 CommandLine command_line(CommandLine::NO_PROGRAM);
610 command_line.AppendSwitch(switches::kCheckCloudPrintConnectorPolicy); 610 command_line.AppendSwitch(switches::kCheckCloudPrintConnectorPolicy);
611 test_launcher_utils::PrepareBrowserCommandLineForTests(&command_line); 611 test_launcher_utils::PrepareBrowserCommandLineForTests(&command_line);
612 612
613 WaitForConnect(); 613 WaitForConnect();
614 base::RunLoop run_loop; 614 base::RunLoop run_loop;
615 base::MessageLoop::current()->PostDelayedTask( 615 base::MessageLoop::current()->PostDelayedTask(
616 FROM_HERE, 616 FROM_HERE,
617 run_loop.QuitClosure(), 617 run_loop.QuitClosure(),
618 TestTimeouts::action_timeout()); 618 TestTimeouts::action_timeout());
619 619
620 bool should_run_loop = LaunchBrowser(command_line, profile); 620 bool should_run_loop = LaunchBrowser(command_line, profile);
621 621
622 // No expectations on run_loop being true here; that would be a race 622 // No expectations on run_loop being true here; that would be a race
623 // condition. 623 // condition.
624 if (should_run_loop) 624 if (should_run_loop)
625 run_loop.Run(); 625 run_loop.Run();
626 626
627 EXPECT_EQ("", prefs->GetString(prefs::kCloudPrintEmail)); 627 EXPECT_EQ("", prefs->GetString(prefs::kCloudPrintEmail));
628 628
629 ShutdownAndWaitForExitWithTimeout(handle); 629 ShutdownAndWaitForExitWithTimeout(handle);
630 content::RunAllPendingInMessageLoop(); 630 content::RunAllPendingInMessageLoop();
631 profile_manager.DeleteTestingProfile("StartBrowserWithPolicy"); 631 profile_manager.DeleteTestingProfile("StartBrowserWithPolicy");
632 } 632 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698