Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(170)

Side by Side Diff: chrome/browser/chromeos/login/login_utils_browsertest.cc

Issue 360733005: Poll CanPredictNetworkActions in Predictor class. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/net/net_pref_observer.cc » ('j') | chrome/browser/net/predictor.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/net/net_pref_observer.cc » ('j') | chrome/browser/net/predictor.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698