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 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
448 return cl; | 448 return cl; |
449 } | 449 } |
450 | 450 |
451 TEST_F(CloudPrintProxyPolicyStartupTest, StartAndShutdown) { | 451 TEST_F(CloudPrintProxyPolicyStartupTest, StartAndShutdown) { |
452 base::ProcessHandle handle = | 452 base::ProcessHandle handle = |
453 Launch("CloudPrintMockService_StartEnabledWaitForQuit"); | 453 Launch("CloudPrintMockService_StartEnabledWaitForQuit"); |
454 WaitForConnect(); | 454 WaitForConnect(); |
455 ShutdownAndWaitForExitWithTimeout(handle); | 455 ShutdownAndWaitForExitWithTimeout(handle); |
456 } | 456 } |
457 | 457 |
458 ProfileKeyedService* CloudPrintProxyServiceFactoryForPolicyTest( | 458 BrowserContextKeyedService* CloudPrintProxyServiceFactoryForPolicyTest( |
459 content::BrowserContext* profile) { | 459 content::BrowserContext* profile) { |
460 CloudPrintProxyService* service = | 460 CloudPrintProxyService* service = |
461 new CloudPrintProxyService(static_cast<Profile*>(profile)); | 461 new CloudPrintProxyService(static_cast<Profile*>(profile)); |
462 service->Initialize(); | 462 service->Initialize(); |
463 return service; | 463 return service; |
464 } | 464 } |
465 | 465 |
466 TEST_F(CloudPrintProxyPolicyStartupTest, StartBrowserWithoutPolicy) { | 466 TEST_F(CloudPrintProxyPolicyStartupTest, StartBrowserWithoutPolicy) { |
467 base::ProcessHandle handle = | 467 base::ProcessHandle handle = |
468 Launch("CloudPrintMockService_StartEnabledWaitForQuit"); | 468 Launch("CloudPrintMockService_StartEnabledWaitForQuit"); |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
538 // No expectations on run_loop being true here; that would be a race | 538 // No expectations on run_loop being true here; that would be a race |
539 // condition. | 539 // condition. |
540 if (run_loop) | 540 if (run_loop) |
541 MessageLoop::current()->Run(); | 541 MessageLoop::current()->Run(); |
542 | 542 |
543 EXPECT_EQ("", prefs->GetString(prefs::kCloudPrintEmail)); | 543 EXPECT_EQ("", prefs->GetString(prefs::kCloudPrintEmail)); |
544 | 544 |
545 ShutdownAndWaitForExitWithTimeout(handle); | 545 ShutdownAndWaitForExitWithTimeout(handle); |
546 profile_manager.DeleteTestingProfile("StartBrowserWithPolicy"); | 546 profile_manager.DeleteTestingProfile("StartBrowserWithPolicy"); |
547 } | 547 } |
OLD | NEW |