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

Unified Diff: chrome/browser/printing/cloud_print/test/cloud_print_proxy_process_browsertest.cc

Issue 1078213004: Remove --check-cloud-print-connector-policy (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Sat Apr 11 02:29:11 PDT 2015 Created 5 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/printing/cloud_print/test/cloud_print_proxy_process_browsertest.cc
diff --git a/chrome/browser/printing/cloud_print/test/cloud_print_proxy_process_browsertest.cc b/chrome/browser/printing/cloud_print/test/cloud_print_proxy_process_browsertest.cc
index 4f1db25c142094cedce390b8e6d20de5c92cf3de..c9cd628d9ca0a3e47f818412f743ab6ec6126704 100644
--- a/chrome/browser/printing/cloud_print/test/cloud_print_proxy_process_browsertest.cc
+++ b/chrome/browser/printing/cloud_print/test/cloud_print_proxy_process_browsertest.cc
@@ -525,103 +525,3 @@ KeyedService* CloudPrintProxyServiceFactoryForPolicyTest(
return service;
}
-TEST_F(CloudPrintProxyPolicyStartupTest, StartBrowserWithoutPolicy) {
- base::Process process =
- Launch("CloudPrintMockService_StartEnabledWaitForQuit");
-
- // Setup the Browser Process with a full IOThread::Globals.
- TestingBrowserProcess* browser_process =
- TestingBrowserProcess::GetGlobal();
-
- TestingProfileManager profile_manager(browser_process);
- ASSERT_TRUE(profile_manager.SetUp());
-
- // Must be created after the TestingProfileManager since that creates the
- // LocalState for the BrowserProcess. Must be created before profiles are
- // constructed.
- chrome::TestingIOThreadState testing_io_thread_state;
-
- TestingProfile* profile =
- profile_manager.CreateTestingProfile("StartBrowserWithoutPolicy");
- CloudPrintProxyServiceFactory::GetInstance()->
- SetTestingFactory(profile, CloudPrintProxyServiceFactoryForPolicyTest);
-
- TestingPrefServiceSyncable* prefs = profile->GetTestingPrefService();
- prefs->SetUserPref(
- prefs::kCloudPrintEmail,
- new base::StringValue(MockServiceIPCServer::EnabledUserId()));
-
- base::CommandLine command_line(base::CommandLine::NO_PROGRAM);
- command_line.AppendSwitch(switches::kCheckCloudPrintConnectorPolicy);
- test_launcher_utils::PrepareBrowserCommandLineForTests(&command_line);
-
- WaitForConnect();
- base::RunLoop run_loop;
- base::MessageLoop::current()->PostDelayedTask(
- FROM_HERE,
- run_loop.QuitClosure(),
- TestTimeouts::action_timeout());
-
- bool should_run_loop = LaunchBrowser(command_line, profile);
- EXPECT_FALSE(should_run_loop);
- if (should_run_loop)
- run_loop.Run();
-
- EXPECT_EQ(MockServiceIPCServer::EnabledUserId(),
- prefs->GetString(prefs::kCloudPrintEmail));
-
- ShutdownAndWaitForExitWithTimeout(process.Pass());
- content::RunAllPendingInMessageLoop();
- profile_manager.DeleteTestingProfile("StartBrowserWithoutPolicy");
-}
-
-TEST_F(CloudPrintProxyPolicyStartupTest, StartBrowserWithPolicy) {
- base::Process process =
- Launch("CloudPrintMockService_StartEnabledExpectDisabled");
-
- TestingBrowserProcess* browser_process =
- TestingBrowserProcess::GetGlobal();
- TestingProfileManager profile_manager(browser_process);
- ASSERT_TRUE(profile_manager.SetUp());
-
- // Must be created after the TestingProfileManager since that creates the
- // LocalState for the BrowserProcess. Must be created before profiles are
- // constructed.
- chrome::TestingIOThreadState testing_io_thread_state;
-
- TestingProfile* profile =
- profile_manager.CreateTestingProfile("StartBrowserWithPolicy");
- CloudPrintProxyServiceFactory::GetInstance()->
- SetTestingFactory(profile, CloudPrintProxyServiceFactoryForPolicyTest);
-
- TestingPrefServiceSyncable* prefs = profile->GetTestingPrefService();
- prefs->SetUserPref(
- prefs::kCloudPrintEmail,
- new base::StringValue(MockServiceIPCServer::EnabledUserId()));
- prefs->SetManagedPref(prefs::kCloudPrintProxyEnabled,
- new base::FundamentalValue(false));
-
- base::CommandLine command_line(base::CommandLine::NO_PROGRAM);
- command_line.AppendSwitch(switches::kCheckCloudPrintConnectorPolicy);
- test_launcher_utils::PrepareBrowserCommandLineForTests(&command_line);
-
- WaitForConnect();
- base::RunLoop run_loop;
- base::MessageLoop::current()->PostDelayedTask(
- FROM_HERE,
- run_loop.QuitClosure(),
- TestTimeouts::action_timeout());
-
- bool should_run_loop = LaunchBrowser(command_line, profile);
-
- // No expectations on run_loop being true here; that would be a race
- // condition.
- if (should_run_loop)
- run_loop.Run();
-
- EXPECT_EQ("", prefs->GetString(prefs::kCloudPrintEmail));
-
- ShutdownAndWaitForExitWithTimeout(process.Pass());
- content::RunAllPendingInMessageLoop();
- profile_manager.DeleteTestingProfile("StartBrowserWithPolicy");
-}

Powered by Google App Engine
This is Rietveld 408576698