| 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 // 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 432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 443 return cl; | 443 return cl; |
| 444 } | 444 } |
| 445 | 445 |
| 446 TEST_F(CloudPrintProxyPolicyStartupTest, StartAndShutdown) { | 446 TEST_F(CloudPrintProxyPolicyStartupTest, StartAndShutdown) { |
| 447 base::ProcessHandle handle = | 447 base::ProcessHandle handle = |
| 448 Launch("CloudPrintMockService_StartEnabledWaitForQuit"); | 448 Launch("CloudPrintMockService_StartEnabledWaitForQuit"); |
| 449 WaitForConnect(); | 449 WaitForConnect(); |
| 450 ShutdownAndWaitForExitWithTimeout(handle); | 450 ShutdownAndWaitForExitWithTimeout(handle); |
| 451 } | 451 } |
| 452 | 452 |
| 453 ProfileKeyedBase* CloudPrintProxyServiceFactoryForPolicyTest( | 453 ProfileKeyedService* CloudPrintProxyServiceFactoryForPolicyTest( |
| 454 Profile* profile) { | 454 Profile* profile) { |
| 455 CloudPrintProxyService* service = new CloudPrintProxyService(profile); | 455 CloudPrintProxyService* service = new CloudPrintProxyService(profile); |
| 456 service->Initialize(); | 456 service->Initialize(); |
| 457 return service; | 457 return service; |
| 458 } | 458 } |
| 459 | 459 |
| 460 TEST_F(CloudPrintProxyPolicyStartupTest, StartBrowserWithoutPolicy) { | 460 TEST_F(CloudPrintProxyPolicyStartupTest, StartBrowserWithoutPolicy) { |
| 461 base::ProcessHandle handle = | 461 base::ProcessHandle handle = |
| 462 Launch("CloudPrintMockService_StartEnabledWaitForQuit"); | 462 Launch("CloudPrintMockService_StartEnabledWaitForQuit"); |
| 463 | 463 |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 532 // No expectations on run_loop being true here; that would be a race | 532 // No expectations on run_loop being true here; that would be a race |
| 533 // condition. | 533 // condition. |
| 534 if (run_loop) | 534 if (run_loop) |
| 535 MessageLoop::current()->Run(); | 535 MessageLoop::current()->Run(); |
| 536 | 536 |
| 537 EXPECT_EQ("", prefs->GetString(prefs::kCloudPrintEmail)); | 537 EXPECT_EQ("", prefs->GetString(prefs::kCloudPrintEmail)); |
| 538 | 538 |
| 539 ShutdownAndWaitForExitWithTimeout(handle); | 539 ShutdownAndWaitForExitWithTimeout(handle); |
| 540 profile_manager.DeleteTestingProfile("StartBrowserWithPolicy"); | 540 profile_manager.DeleteTestingProfile("StartBrowserWithPolicy"); |
| 541 } | 541 } |
| OLD | NEW |