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 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
395 | 395 |
396 private: | 396 private: |
397 bool seen_; | 397 bool seen_; |
398 bool running_; | 398 bool running_; |
399 }; | 399 }; |
400 | 400 |
401 WindowedChannelConnectionObserver observer_; | 401 WindowedChannelConnectionObserver observer_; |
402 }; | 402 }; |
403 | 403 |
404 CloudPrintProxyPolicyStartupTest::CloudPrintProxyPolicyStartupTest() | 404 CloudPrintProxyPolicyStartupTest::CloudPrintProxyPolicyStartupTest() |
405 : // TaskScheduler must run on its own thread because the main thread waits | 405 : thread_bundle_(content::TestBrowserThreadBundle::REAL_IO_THREAD) { |
406 // for a task running in it. | |
407 thread_bundle_(content::TestBrowserThreadBundle::REAL_IO_THREAD | | |
408 content::TestBrowserThreadBundle::REAL_TASK_SCHEDULER) { | |
409 // Although is really a unit test which runs in the browser_tests binary, it | 406 // Although is really a unit test which runs in the browser_tests binary, it |
410 // doesn't get the unit setup which normally happens in the unit test binary. | 407 // doesn't get the unit setup which normally happens in the unit test binary. |
411 ChromeUnitTestSuite::InitializeProviders(); | 408 ChromeUnitTestSuite::InitializeProviders(); |
412 ChromeUnitTestSuite::InitializeResourceBundle(); | 409 ChromeUnitTestSuite::InitializeResourceBundle(); |
413 } | 410 } |
414 | 411 |
415 CloudPrintProxyPolicyStartupTest::~CloudPrintProxyPolicyStartupTest() { | 412 CloudPrintProxyPolicyStartupTest::~CloudPrintProxyPolicyStartupTest() { |
416 } | 413 } |
417 | 414 |
418 void CloudPrintProxyPolicyStartupTest::SetUp() { | 415 void CloudPrintProxyPolicyStartupTest::SetUp() { |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
542 // constructed. | 539 // constructed. |
543 chrome::TestingIOThreadState testing_io_thread_state; | 540 chrome::TestingIOThreadState testing_io_thread_state; |
544 | 541 |
545 base::Process process = | 542 base::Process process = |
546 Launch("CloudPrintMockService_StartEnabledWaitForQuit"); | 543 Launch("CloudPrintMockService_StartEnabledWaitForQuit"); |
547 WaitForConnect(); | 544 WaitForConnect(); |
548 ShutdownAndWaitForExitWithTimeout(std::move(process)); | 545 ShutdownAndWaitForExitWithTimeout(std::move(process)); |
549 ServiceProcessControl::GetInstance()->Disconnect(); | 546 ServiceProcessControl::GetInstance()->Disconnect(); |
550 content::RunAllPendingInMessageLoop(); | 547 content::RunAllPendingInMessageLoop(); |
551 } | 548 } |
OLD | NEW |