From 3b94427c99bdf12836fd455eeb1499fdde511e26 Mon Sep 17 00:00:00 2001 From: "finnur@chromium.org" Date: Wed, 1 Dec 2010 15:19:40 +0000 Subject: Revert 67849 - Figure out error in test PrepopulateRespectBlank. Revert previous traces and add one targeted test. My traces seem to indicate that something else than a Chrome window has focus when the test fails. Lets figure out what that is... BUG=62937 TEST=Tracking down problem in test Review URL: http://codereview.chromium.org/5463001 TBR=finnur@chromium.org Review URL: http://codereview.chromium.org/5451002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@67852 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/test/ui_test_utils.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'chrome/test/ui_test_utils.cc') diff --git a/chrome/test/ui_test_utils.cc b/chrome/test/ui_test_utils.cc index d6310f3..b7db307 100644 --- a/chrome/test/ui_test_utils.cc +++ b/chrome/test/ui_test_utils.cc @@ -341,6 +341,12 @@ bool ExecuteJavaScriptHelper(RenderViewHost* render_view_host, return true; } +void Checkpoint(const char* message, const base::TimeTicks& start_time) { + LOG(INFO) << message << " : " + << (base::TimeTicks::Now() - start_time).InMilliseconds() + << " ms" << std::flush; +} + } // namespace void RunMessageLoop() { @@ -606,11 +612,13 @@ bool SendKeyPressSync(const Browser* browser, bool alt, bool command) { base::TimeTicks start_time = base::TimeTicks::Now(); + Checkpoint("SendKeyPressSync", start_time); gfx::NativeWindow window = NULL; if (!GetNativeWindow(browser, &window)) return false; + Checkpoint("SendKeyPressNotifyWhenDone", start_time); if (!ui_controls::SendKeyPressNotifyWhenDone( window, key, control, shift, alt, command, new MessageLoop::QuitTask())) { @@ -620,7 +628,9 @@ bool SendKeyPressSync(const Browser* browser, // Run the message loop. It'll stop running when either the key was received // or the test timed out (in which case testing::Test::HasFatalFailure should // be set). + Checkpoint("Running loop", start_time); RunMessageLoop(); + Checkpoint("Check if HasFatalFailure", start_time); return !testing::Test::HasFatalFailure(); } -- cgit v1.1