| 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 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 312 class CloudPrintProxyPolicyStartupTest : public base::MultiProcessTest, | 312 class CloudPrintProxyPolicyStartupTest : public base::MultiProcessTest, |
| 313 public IPC::Listener { | 313 public IPC::Listener { |
| 314 public: | 314 public: |
| 315 CloudPrintProxyPolicyStartupTest(); | 315 CloudPrintProxyPolicyStartupTest(); |
| 316 ~CloudPrintProxyPolicyStartupTest() override; | 316 ~CloudPrintProxyPolicyStartupTest() override; |
| 317 | 317 |
| 318 void SetUp() override; | 318 void SetUp() override; |
| 319 void TearDown() override; | 319 void TearDown() override; |
| 320 | 320 |
| 321 scoped_refptr<base::SingleThreadTaskRunner> IOTaskRunner() { | 321 scoped_refptr<base::SingleThreadTaskRunner> IOTaskRunner() { |
| 322 return BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO); | 322 return BrowserThread::GetTaskRunnerForThread(BrowserThread::IO); |
| 323 } | 323 } |
| 324 base::Process Launch(const std::string& name); | 324 base::Process Launch(const std::string& name); |
| 325 void WaitForConnect(); | 325 void WaitForConnect(); |
| 326 bool Send(IPC::Message* message); | 326 bool Send(IPC::Message* message); |
| 327 void ShutdownAndWaitForExitWithTimeout(base::Process process); | 327 void ShutdownAndWaitForExitWithTimeout(base::Process process); |
| 328 | 328 |
| 329 // IPC::Listener implementation | 329 // IPC::Listener implementation |
| 330 bool OnMessageReceived(const IPC::Message& message) override { return false; } | 330 bool OnMessageReceived(const IPC::Message& message) override { return false; } |
| 331 void OnChannelConnected(int32_t peer_pid) override; | 331 void OnChannelConnected(int32_t peer_pid) override; |
| 332 | 332 |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 520 // LocalState for the BrowserProcess. Must be created before profiles are | 520 // LocalState for the BrowserProcess. Must be created before profiles are |
| 521 // constructed. | 521 // constructed. |
| 522 chrome::TestingIOThreadState testing_io_thread_state; | 522 chrome::TestingIOThreadState testing_io_thread_state; |
| 523 | 523 |
| 524 base::Process process = | 524 base::Process process = |
| 525 Launch("CloudPrintMockService_StartEnabledWaitForQuit"); | 525 Launch("CloudPrintMockService_StartEnabledWaitForQuit"); |
| 526 WaitForConnect(); | 526 WaitForConnect(); |
| 527 ShutdownAndWaitForExitWithTimeout(std::move(process)); | 527 ShutdownAndWaitForExitWithTimeout(std::move(process)); |
| 528 content::RunAllPendingInMessageLoop(); | 528 content::RunAllPendingInMessageLoop(); |
| 529 } | 529 } |
| OLD | NEW |