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

Side by Side Diff: content/public/test/test_utils.h

Issue 2893823003: Flush all TaskScheduler<->MainLoop tasks in ~TestBrowserThreadBundle() (Closed)
Patch Set: . Created 3 years, 7 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 | « content/public/test/test_browser_thread_bundle.cc ('k') | no next file » | no next file with comments »
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 #ifndef CONTENT_PUBLIC_TEST_TEST_UTILS_H_ 5 #ifndef CONTENT_PUBLIC_TEST_TEST_UTILS_H_
6 #define CONTENT_PUBLIC_TEST_TEST_UTILS_H_ 6 #define CONTENT_PUBLIC_TEST_TEST_UTILS_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 // then resets nestable tasks to what they were originally. Prefer this 49 // then resets nestable tasks to what they were originally. Prefer this
50 // over MessageLoop::RunAllPending for in process browser tests to run 50 // over MessageLoop::RunAllPending for in process browser tests to run
51 // all pending tasks. Can only be called from the UI thread. 51 // all pending tasks. Can only be called from the UI thread.
52 void RunAllPendingInMessageLoop(); 52 void RunAllPendingInMessageLoop();
53 53
54 // Blocks the current thread until all the pending messages in the loop of the 54 // Blocks the current thread until all the pending messages in the loop of the
55 // thread |thread_id| have been processed. Can only be called from the UI 55 // thread |thread_id| have been processed. Can only be called from the UI
56 // thread. 56 // thread.
57 void RunAllPendingInMessageLoop(BrowserThread::ID thread_id); 57 void RunAllPendingInMessageLoop(BrowserThread::ID thread_id);
58 58
59 // Runs until both the blocking pool and the current message loop are empty 59 // Runs until the blocking pool, task scheduler, and the current message loop
60 // (have no more scheduled tasks) and no tasks are running. 60 // are all empty (have no more scheduled tasks) and no tasks are running.
61 // 61 //
62 // TODO(fdoray): Rename to RunAllTaskSchedulerTasksUntilIdle() once the blocking 62 // TODO(fdoray): Rename to RunAllTaskSchedulerTasksUntilIdle() once the blocking
63 // pool is fully deprecated. https://crbug.com/667892 63 // pool is fully deprecated. https://crbug.com/667892
64 void RunAllBlockingPoolTasksUntilIdle(); 64 void RunAllBlockingPoolTasksUntilIdle();
65 65
66 // Get task to quit the given RunLoop. It allows a few generations of pending 66 // Get task to quit the given RunLoop. It allows a few generations of pending
67 // tasks to run as opposed to run_loop->QuitClosure(). 67 // tasks to run as opposed to run_loop->QuitClosure().
68 base::Closure GetDeferredQuitTaskForRunLoop(base::RunLoop* run_loop); 68 base::Closure GetDeferredQuitTaskForRunLoop(base::RunLoop* run_loop);
69 69
70 // Executes the specified JavaScript in the specified frame, and runs a nested 70 // Executes the specified JavaScript in the specified frame, and runs a nested
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 void WebContentsDestroyed() override; 307 void WebContentsDestroyed() override;
308 308
309 base::RunLoop run_loop_; 309 base::RunLoop run_loop_;
310 310
311 DISALLOW_COPY_AND_ASSIGN(WebContentsDestroyedWatcher); 311 DISALLOW_COPY_AND_ASSIGN(WebContentsDestroyedWatcher);
312 }; 312 };
313 313
314 } // namespace content 314 } // namespace content
315 315
316 #endif // CONTENT_PUBLIC_TEST_TEST_UTILS_H_ 316 #endif // CONTENT_PUBLIC_TEST_TEST_UTILS_H_
OLDNEW
« no previous file with comments | « content/public/test/test_browser_thread_bundle.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698