summaryrefslogtreecommitdiffstats
path: root/chrome/test/base
diff options
context:
space:
mode:
authorlushnikov@chromium.org <lushnikov@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-12-10 22:19:48 +0000
committerlushnikov@chromium.org <lushnikov@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-12-10 22:19:48 +0000
commitf9631b954532779683bce063ceaec6818d0967a6 (patch)
tree6d874f396f428360c3aff1e809bd0ca593f25566 /chrome/test/base
parent6485a3054403d7b61584585c48cfc2615b7b1253 (diff)
downloadchromium_src-f9631b954532779683bce063ceaec6818d0967a6.zip
chromium_src-f9631b954532779683bce063ceaec6818d0967a6.tar.gz
chromium_src-f9631b954532779683bce063ceaec6818d0967a6.tar.bz2
DevTools: fix flaky DevToolsBeforeUnloadTest
This CL fixes flakiness in devtools beforeunload tests. It was caused by the fact that hang timeout for renderer during processing beforeunload events was set to only 1 second, which was not enough from time to time. Drive-by: ui_test_utils::WaitForAppModalDialog should check for any existing modal before installing an observer (otherwise, it might wait forever) BUG=323847,321673 Review URL: https://codereview.chromium.org/108153003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@239868 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/base')
-rw-r--r--chrome/test/base/ui_test_utils.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/chrome/test/base/ui_test_utils.cc b/chrome/test/base/ui_test_utils.cc
index 59f4560..e60fe0e 100644
--- a/chrome/test/base/ui_test_utils.cc
+++ b/chrome/test/base/ui_test_utils.cc
@@ -36,6 +36,7 @@
#include "chrome/browser/search_engines/template_url_service_test_util.h"
#include "chrome/browser/thumbnails/render_widget_snapshot_taker.h"
#include "chrome/browser/ui/app_modal_dialogs/app_modal_dialog.h"
+#include "chrome/browser/ui/app_modal_dialogs/app_modal_dialog_queue.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_commands.h"
#include "chrome/browser/ui/browser_finder.h"
@@ -321,6 +322,10 @@ bool GetRelativeBuildDirectory(base::FilePath* build_dir) {
}
AppModalDialog* WaitForAppModalDialog() {
+ AppModalDialogQueue* dialog_queue = AppModalDialogQueue::GetInstance();
+ if (dialog_queue->HasActiveDialog())
+ return dialog_queue->active_dialog();
+
content::WindowedNotificationObserver observer(
chrome::NOTIFICATION_APP_MODAL_DIALOG_SHOWN,
content::NotificationService::AllSources());