Bug 910859 - Part 2: Wait for DOMTitleChanged event in waitForPageLoad. r=lucasr
authorMichael Comella <michael.l.comella@gmail.com>
Wed, 04 Dec 2013 18:32:53 -0800
changeset 174528 db9eae6662a0814221ed6f66552f0af15bc3ed7b
parent 174527 b3096c58816b3f36508025d042bb2d7a061c34f5
child 174529 cedb942aa081be44a5919902ae0ed5630ac04d72
push id445
push userffxbld
push dateMon, 10 Mar 2014 22:05:19 +0000
treeherdermozilla-release@dc38b741b04e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerslucasr
bugs910859
milestone28.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 910859 - Part 2: Wait for DOMTitleChanged event in waitForPageLoad. r=lucasr
mobile/android/base/tests/helpers/WaitHelper.java
--- a/mobile/android/base/tests/helpers/WaitHelper.java
+++ b/mobile/android/base/tests/helpers/WaitHelper.java
@@ -75,21 +75,26 @@ public final class WaitHelper {
         // the page has finished loading (e.g. a page title update). As such, we ensure this
         // UI state has changed before returning from this method; here we store the initial
         // state.
         final ChangeVerifier[] pageLoadVerifiers = PAGE_LOAD_VERIFIERS;
         for (final ChangeVerifier verifier : pageLoadVerifiers) {
             verifier.storeState();
         }
 
-        // Wait for the page load event.
+        // Wait for the page load and title changed event.
         final EventExpecter contentEventExpecter = sActions.expectGeckoEvent("DOMContentLoaded");
+        final EventExpecter titleEventExpecter = sActions.expectGeckoEvent("DOMTitleChanged");
+
         initiatingAction.run();
+
         contentEventExpecter.blockForEventDataWithTimeout(PAGE_LOAD_WAIT_MS);
         contentEventExpecter.unregisterListener();
+        titleEventExpecter.blockForEventDataWithTimeout(PAGE_LOAD_WAIT_MS);
+        titleEventExpecter.unregisterListener();
 
         // Verify remaining state has changed.
         for (final ChangeVerifier verifier : pageLoadVerifiers) {
             // If we timeout, either the state is set to the same value (which is fine), or
             // the state has not yet changed. Since we can't be sure it will ever change, move
             // on and let the assertions fail if applicable.
             final boolean hasTimedOut = !sSolo.waitForCondition(new Condition() {
                 @Override