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 <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
513 cl.AppendSwitchNative(kProcessChannelID, startup_channel_handle_.name); | 513 cl.AppendSwitchNative(kProcessChannelID, startup_channel_handle_.name); |
514 #if defined(OS_MACOSX) | 514 #if defined(OS_MACOSX) |
515 cl.AppendSwitchASCII(kTestExecutablePath, executable_path_.value()); | 515 cl.AppendSwitchASCII(kTestExecutablePath, executable_path_.value()); |
516 #endif | 516 #endif |
517 return cl; | 517 return cl; |
518 } | 518 } |
519 | 519 |
520 TEST_F(CloudPrintProxyPolicyStartupTest, StartAndShutdown) { | 520 TEST_F(CloudPrintProxyPolicyStartupTest, StartAndShutdown) { |
521 mojo::edk::Init(); | 521 mojo::edk::Init(); |
522 mojo::edk::ScopedIPCSupport ipc_support( | 522 mojo::edk::ScopedIPCSupport ipc_support( |
523 BrowserThread::UnsafeGetMessageLoopForThread(BrowserThread::IO) | 523 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO)); |
524 ->task_runner()); | |
525 | 524 |
526 TestingBrowserProcess* browser_process = | 525 TestingBrowserProcess* browser_process = |
527 TestingBrowserProcess::GetGlobal(); | 526 TestingBrowserProcess::GetGlobal(); |
528 TestingProfileManager profile_manager(browser_process); | 527 TestingProfileManager profile_manager(browser_process); |
529 ASSERT_TRUE(profile_manager.SetUp()); | 528 ASSERT_TRUE(profile_manager.SetUp()); |
530 | 529 |
531 // Must be created after the TestingProfileManager since that creates the | 530 // Must be created after the TestingProfileManager since that creates the |
532 // LocalState for the BrowserProcess. Must be created before profiles are | 531 // LocalState for the BrowserProcess. Must be created before profiles are |
533 // constructed. | 532 // constructed. |
534 chrome::TestingIOThreadState testing_io_thread_state; | 533 chrome::TestingIOThreadState testing_io_thread_state; |
535 | 534 |
536 base::Process process = | 535 base::Process process = |
537 Launch("CloudPrintMockService_StartEnabledWaitForQuit"); | 536 Launch("CloudPrintMockService_StartEnabledWaitForQuit"); |
538 WaitForConnect(); | 537 WaitForConnect(); |
539 ShutdownAndWaitForExitWithTimeout(std::move(process)); | 538 ShutdownAndWaitForExitWithTimeout(std::move(process)); |
540 ServiceProcessControl::GetInstance()->Disconnect(); | 539 ServiceProcessControl::GetInstance()->Disconnect(); |
541 content::RunAllPendingInMessageLoop(); | 540 content::RunAllPendingInMessageLoop(); |
542 } | 541 } |
OLD | NEW |