summaryrefslogtreecommitdiffstats
path: root/chrome/browser/apps/app_window_interactive_uitest.cc
diff options
context:
space:
mode:
authorbenwells@chromium.org <benwells@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-17 09:41:27 +0000
committerbenwells@chromium.org <benwells@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-17 09:41:27 +0000
commit599f982a262960408e6a6485be64156dfd0b3240 (patch)
treea1d740a5cf667adce65ee5a7faebbb46188e48aa /chrome/browser/apps/app_window_interactive_uitest.cc
parentffc5f68f914366f3d4b4c0d109d35bb03da3b05c (diff)
downloadchromium_src-599f982a262960408e6a6485be64156dfd0b3240.zip
chromium_src-599f982a262960408e6a6485be64156dfd0b3240.tar.gz
chromium_src-599f982a262960408e6a6485be64156dfd0b3240.tar.bz2
Make LoadAndLaunchPlatformApp harder to make flaky tests with.
LoadAndLaunchPlatformApp will send a launched event to the app it is launching, which will often end up with windows being opened. If the test does not wait for the window to stop opening, the test will be flaky. This change updates LoadAndLaunchPlatformApp to wait for a signal to come back from the app after it is launched before returning. TBR=sky BUG=383260 Review URL: https://codereview.chromium.org/324333002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@277688 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/apps/app_window_interactive_uitest.cc')
-rw-r--r--chrome/browser/apps/app_window_interactive_uitest.cc21
1 files changed, 6 insertions, 15 deletions
diff --git a/chrome/browser/apps/app_window_interactive_uitest.cc b/chrome/browser/apps/app_window_interactive_uitest.cc
index 0c90e44..c7bfa91 100644
--- a/chrome/browser/apps/app_window_interactive_uitest.cc
+++ b/chrome/browser/apps/app_window_interactive_uitest.cc
@@ -37,11 +37,7 @@ class AppWindowInteractiveTest : public extensions::PlatformAppBrowserTest {
public:
bool RunAppWindowInteractiveTest(const char* testName) {
ExtensionTestMessageListener launched_listener("Launched", true);
- LoadAndLaunchPlatformApp("window_api_interactive");
- if (!launched_listener.WaitUntilSatisfied()) {
- message_ = "Did not get the 'Launched' message.";
- return false;
- }
+ LoadAndLaunchPlatformApp("window_api_interactive", &launched_listener);
ResultCatcher catcher;
launched_listener.Reply(testName);
@@ -83,8 +79,7 @@ IN_PROC_BROWSER_TEST_F(AppWindowInteractiveTest, ESCLeavesFullscreenWindow) {
#endif
ExtensionTestMessageListener launched_listener("Launched", true);
- LoadAndLaunchPlatformApp("leave_fullscreen");
- ASSERT_TRUE(launched_listener.WaitUntilSatisfied());
+ LoadAndLaunchPlatformApp("leave_fullscreen", &launched_listener);
// We start by making sure the window is actually focused.
ASSERT_TRUE(ui_test_utils::ShowAndFocusNativeWindow(
@@ -127,8 +122,7 @@ IN_PROC_BROWSER_TEST_F(AppWindowInteractiveTest, ESCLeavesFullscreenDOM) {
#endif
ExtensionTestMessageListener launched_listener("Launched", true);
- LoadAndLaunchPlatformApp("leave_fullscreen");
- ASSERT_TRUE(launched_listener.WaitUntilSatisfied());
+ LoadAndLaunchPlatformApp("leave_fullscreen", &launched_listener);
// We start by making sure the window is actually focused.
ASSERT_TRUE(ui_test_utils::ShowAndFocusNativeWindow(
@@ -179,8 +173,7 @@ IN_PROC_BROWSER_TEST_F(AppWindowInteractiveTest,
#endif
ExtensionTestMessageListener launched_listener("Launched", true);
- LoadAndLaunchPlatformApp("prevent_leave_fullscreen");
- ASSERT_TRUE(launched_listener.WaitUntilSatisfied());
+ LoadAndLaunchPlatformApp("prevent_leave_fullscreen", &launched_listener);
// We start by making sure the window is actually focused.
ASSERT_TRUE(ui_test_utils::ShowAndFocusNativeWindow(
@@ -228,8 +221,7 @@ IN_PROC_BROWSER_TEST_F(AppWindowInteractiveTest,
#endif
ExtensionTestMessageListener launched_listener("Launched", true);
- LoadAndLaunchPlatformApp("prevent_leave_fullscreen");
- ASSERT_TRUE(launched_listener.WaitUntilSatisfied());
+ LoadAndLaunchPlatformApp("prevent_leave_fullscreen", &launched_listener);
// We start by making sure the window is actually focused.
ASSERT_TRUE(ui_test_utils::ShowAndFocusNativeWindow(
@@ -287,8 +279,7 @@ IN_PROC_BROWSER_TEST_F(AppWindowInteractiveTest,
#endif
ExtensionTestMessageListener launched_listener("Launched", true);
- LoadAndLaunchPlatformApp("prevent_leave_fullscreen_old");
- ASSERT_TRUE(launched_listener.WaitUntilSatisfied());
+ LoadAndLaunchPlatformApp("prevent_leave_fullscreen_old", &launched_listener);
// We start by making sure the window is actually focused.
ASSERT_TRUE(ui_test_utils::ShowAndFocusNativeWindow(