| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #include "chrome/test/base/testing_io_thread_state.h" | 5 #include "chrome/test/base/testing_io_thread_state.h" |
| 6 | 6 |
| 7 #include "base/message_loop/message_loop_proxy.h" | 7 #include "base/message_loop/message_loop_proxy.h" |
| 8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
| 9 #include "base/time/tick_clock.h" | 9 #include "base/time/tick_clock.h" |
| 10 #include "chrome/browser/io_thread.h" | 10 #include "chrome/browser/io_thread.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 } | 33 } |
| 34 } | 34 } |
| 35 | 35 |
| 36 } // namespace | 36 } // namespace |
| 37 | 37 |
| 38 namespace chrome { | 38 namespace chrome { |
| 39 | 39 |
| 40 TestingIOThreadState::TestingIOThreadState() { | 40 TestingIOThreadState::TestingIOThreadState() { |
| 41 #if defined(OS_CHROMEOS) | 41 #if defined(OS_CHROMEOS) |
| 42 // Needed by IOThread constructor. | 42 // Needed by IOThread constructor. |
| 43 chromeos::DBusThreadManager::InitializeWithStub(); | 43 chromeos::DBusThreadManager::Initialize(); |
| 44 chromeos::NetworkHandler::Initialize(); | 44 chromeos::NetworkHandler::Initialize(); |
| 45 #endif | 45 #endif |
| 46 | 46 |
| 47 io_thread_state_.reset( | 47 io_thread_state_.reset( |
| 48 new IOThread(TestingBrowserProcess::GetGlobal()->local_state(), | 48 new IOThread(TestingBrowserProcess::GetGlobal()->local_state(), |
| 49 TestingBrowserProcess::GetGlobal()->policy_service(), | 49 TestingBrowserProcess::GetGlobal()->policy_service(), |
| 50 NULL, NULL)); | 50 NULL, NULL)); |
| 51 | 51 |
| 52 // Safe because there are no virtuals. | 52 // Safe because there are no virtuals. |
| 53 base::RunLoop run_loop; | 53 base::RunLoop run_loop; |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 | 88 |
| 89 void TestingIOThreadState::Shutdown(const base::Closure& done) { | 89 void TestingIOThreadState::Shutdown(const base::Closure& done) { |
| 90 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 90 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 91 | 91 |
| 92 delete io_thread_state_->globals(); | 92 delete io_thread_state_->globals(); |
| 93 io_thread_state_->SetGlobalsForTesting(NULL); | 93 io_thread_state_->SetGlobalsForTesting(NULL); |
| 94 done.Run(); | 94 done.Run(); |
| 95 } | 95 } |
| 96 | 96 |
| 97 } // namespace chrome | 97 } // namespace chrome |
| OLD | NEW |