| 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 #include "chrome/browser/chromeos/login/login_utils.h" | 5 #include "chrome/browser/chromeos/login/login_utils.h" |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/files/scoped_temp_dir.h" | 10 #include "base/files/scoped_temp_dir.h" |
| (...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 312 // chrome_browser_net::Predictor usually skips its shutdown routines on | 312 // chrome_browser_net::Predictor usually skips its shutdown routines on |
| 313 // unit_tests, but does the full thing when | 313 // unit_tests, but does the full thing when |
| 314 // g_browser_process->profile_manager() is valid during initialization. | 314 // g_browser_process->profile_manager() is valid during initialization. |
| 315 // That includes a WaitableEvent on UI waiting for a task on IO, so that | 315 // That includes a WaitableEvent on UI waiting for a task on IO, so that |
| 316 // task must execute. Do it directly from here now. | 316 // task must execute. Do it directly from here now. |
| 317 std::vector<Profile*> profiles = | 317 std::vector<Profile*> profiles = |
| 318 browser_process_->profile_manager()->GetLoadedProfiles(); | 318 browser_process_->profile_manager()->GetLoadedProfiles(); |
| 319 for (size_t i = 0; i < profiles.size(); ++i) { | 319 for (size_t i = 0; i < profiles.size(); ++i) { |
| 320 chrome_browser_net::Predictor* predictor = | 320 chrome_browser_net::Predictor* predictor = |
| 321 profiles[i]->GetNetworkPredictor(); | 321 profiles[i]->GetNetworkPredictor(); |
| 322 if (predictor) { | 322 if (predictor) |
| 323 predictor->EnablePredictorOnIOThread(false); | |
| 324 predictor->Shutdown(); | 323 predictor->Shutdown(); |
| 325 } | |
| 326 } | 324 } |
| 327 } | 325 } |
| 328 | 326 |
| 329 void RunUntilIdle() { | 327 void RunUntilIdle() { |
| 330 loop_.RunUntilIdle(); | 328 loop_.RunUntilIdle(); |
| 331 BrowserThread::GetBlockingPool()->FlushForTesting(); | 329 BrowserThread::GetBlockingPool()->FlushForTesting(); |
| 332 loop_.RunUntilIdle(); | 330 loop_.RunUntilIdle(); |
| 333 } | 331 } |
| 334 | 332 |
| 335 // Invokes |task| on the IO loop and returns after it has executed. | 333 // Invokes |task| on the IO loop and returns after it has executed. |
| (...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 704 } | 702 } |
| 705 | 703 |
| 706 INSTANTIATE_TEST_CASE_P( | 704 INSTANTIATE_TEST_CASE_P( |
| 707 LoginUtilsBlockingLoginTestInstance, | 705 LoginUtilsBlockingLoginTestInstance, |
| 708 LoginUtilsBlockingLoginTest, | 706 LoginUtilsBlockingLoginTest, |
| 709 testing::Values(0, 1, 2, 3, 4, 5)); | 707 testing::Values(0, 1, 2, 3, 4, 5)); |
| 710 | 708 |
| 711 } // namespace | 709 } // namespace |
| 712 | 710 |
| 713 } // namespace chromeos | 711 } // namespace chromeos |
| OLD | NEW |