summaryrefslogtreecommitdiffstats
path: root/chrome_frame
diff options
context:
space:
mode:
authorjbates@chromium.org <jbates@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-28 22:57:30 +0000
committerjbates@chromium.org <jbates@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-28 22:57:30 +0000
commit8e937c1e6a1cf0bdce081324965e105a6b17a3fc (patch)
treeffec2c670d3ceb188c0c1244b846b15adbe7838e /chrome_frame
parented50d3ee0ed2e26da0ff805dc52ee0c03f80df2e (diff)
downloadchromium_src-8e937c1e6a1cf0bdce081324965e105a6b17a3fc.zip
chromium_src-8e937c1e6a1cf0bdce081324965e105a6b17a3fc.tar.gz
chromium_src-8e937c1e6a1cf0bdce081324965e105a6b17a3fc.tar.bz2
Add base::RunLoop and update ui_test_utils to use it to reduce flakiness
Timeout flakiness has been observed in multiple tests that use Quit. This changes various test utility APIs to use QuitNow via base::RunLoop instead. Some instances of Quit are left as-is where it appears they may have a use case. The ui_test_utils QuitThisRunLoop function does a safer form of MessageLoop::QuitWhenIdle that allows a few generations of tasks to run before actually quitting the MessageLoop. This addresses the design assumptions of many existing tests while hopefully reducing flaky timeouts by moving away from QuitWhenIdle. This fixes throughput_tests.cc which is currently timing out on Mac. BUG=124906,130141,131220,128305,132932 Review URL: https://chromiumcodereview.appspot.com/10479018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@144824 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame')
-rw-r--r--chrome_frame/test/chrome_frame_automation_mock.cc12
-rw-r--r--chrome_frame/test/chrome_frame_test_utils.h1
2 files changed, 9 insertions, 4 deletions
diff --git a/chrome_frame/test/chrome_frame_automation_mock.cc b/chrome_frame/test/chrome_frame_automation_mock.cc
index 8b553a5..d307712 100644
--- a/chrome_frame/test/chrome_frame_automation_mock.cc
+++ b/chrome_frame/test/chrome_frame_automation_mock.cc
@@ -16,7 +16,8 @@ TEST(ChromeFrame, Launch) {
loop.PostDelayedTask(FROM_HERE, MessageLoop::QuitClosure(), kLongWaitTimeout);
mock_launch.Navigate("about:blank");
- loop.RunWithDispatcher(NULL);
+ base::RunLoop run_loop(NULL);
+ run_loop.Run();
EXPECT_TRUE(mock_launch.launch_result());
}
@@ -28,7 +29,8 @@ TEST(ChromeFrame, Navigate) {
loop.PostDelayedTask(FROM_HERE, MessageLoop::QuitClosure(), kLongWaitTimeout);
mock_navigate.NavigateRelativeFile(L"postmessage_basic_frame.html");
- loop.RunWithDispatcher(NULL);
+ base::RunLoop run_loop(NULL);
+ run_loop.Run();
EXPECT_FALSE(mock_navigate.navigation_result());
}
@@ -40,7 +42,8 @@ TEST(ChromeFrame, PostMessage) {
loop.PostDelayedTask(FROM_HERE, MessageLoop::QuitClosure(), kLongWaitTimeout);
mock_postmessage.NavigateRelativeFile(L"postmessage_basic_frame.html");
- loop.RunWithDispatcher(NULL);
+ base::RunLoop run_loop(NULL);
+ run_loop.Run();
EXPECT_FALSE(mock_postmessage.postmessage_result());
}
@@ -52,7 +55,8 @@ TEST(ChromeFrame, RequestStart) {
loop.PostDelayedTask(FROM_HERE, MessageLoop::QuitClosure(), kLongWaitTimeout);
mock_request_start.NavigateRelative(L"postmessage_basic_frame.html");
- loop.RunWithDispatcher(NULL);
+ base::RunLoop run_loop(NULL);
+ run_loop.Run();
EXPECT_TRUE(mock_request_start.request_start_result());
}
diff --git a/chrome_frame/test/chrome_frame_test_utils.h b/chrome_frame/test/chrome_frame_test_utils.h
index b4ef4fd..bca9ae1 100644
--- a/chrome_frame/test/chrome_frame_test_utils.h
+++ b/chrome_frame/test/chrome_frame_test_utils.h
@@ -18,6 +18,7 @@
#include "base/file_path.h"
#include "base/memory/scoped_ptr.h"
#include "base/message_loop.h"
+#include "base/run_loop.h"
#include "base/process_util.h"
#include "base/time.h"
#include "base/test/test_reg_util_win.h"