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

Unified Diff: content/public/test/test_utils.cc

Issue 2523583003: Fix some flaky tests. (Closed)
Patch Set: Undo change in DOMMessageQueue. Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/public/test/test_utils.h ('k') | content/test/content_browser_test_utils_internal.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/test/test_utils.cc
diff --git a/content/public/test/test_utils.cc b/content/public/test/test_utils.cc
index cc8757da101ae39a2ac59bc4a86bcdcdf27eabc7..a19a31d5aa36c9d1214c5c91a34c06ce96863b0b 100644
--- a/content/public/test/test_utils.cc
+++ b/content/public/test/test_utils.cc
@@ -208,9 +208,8 @@ bool RegisterJniForTesting(JNIEnv* env) {
}
#endif
-MessageLoopRunner::MessageLoopRunner()
- : loop_running_(false),
- quit_closure_called_(false) {
+MessageLoopRunner::MessageLoopRunner(QuitMode quit_mode)
+ : quit_mode_(quit_mode), loop_running_(false), quit_closure_called_(false) {
}
MessageLoopRunner::~MessageLoopRunner() = default;
@@ -239,7 +238,14 @@ void MessageLoopRunner::Quit() {
// Only run the quit task if we are running the message loop.
if (loop_running_) {
- GetQuitTaskForRunLoop(&run_loop_).Run();
+ switch (quit_mode_) {
+ case QuitMode::DEFERRED:
+ GetQuitTaskForRunLoop(&run_loop_).Run();
+ break;
+ case QuitMode::IMMEDIATE:
+ run_loop_.Quit();
+ break;
+ }
loop_running_ = false;
}
}
« no previous file with comments | « content/public/test/test_utils.h ('k') | content/test/content_browser_test_utils_internal.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698