Revision: 5424
Author:   [email protected]
Date:     Fri May 24 09:23:04 2013
Log:      Make testDimensionProperties not fail when reloaded on Firefox.
https://codereview.appspot.com/9699043

The test testDimensionProperties (I might have the name wrong) scrolls
a scrollable element. Unfortunately, Firefox remembers the scroll
position across page reloads, causing spurious test failures if the test
page is reloaded. Reset the position to the initial state after the test
runs to avoid this.

Fixes <https://code.google.com/p/google-caja/issues/detail?id=1710>.

[email protected]

http://code.google.com/p/google-caja/source/detail?r=5424

Modified:
 /trunk/tests/com/google/caja/plugin/es53-test-domado-dom-guest.html

=======================================
--- /trunk/tests/com/google/caja/plugin/es53-test-domado-dom-guest.html Thu May 23 10:22:00 2013 +++ /trunk/tests/com/google/caja/plugin/es53-test-domado-dom-guest.html Fri May 24 09:23:04 2013
@@ -1524,6 +1524,14 @@
     assertPropEq(200, scroll, 'scrollTop');  // can scroll
     assertPropEq(100, scroll, 'scrollLeft');

+    // Firefox remembers scroll position across page reload, which causes
+ // spurious failures if we don't reset the position to what we're expecting. + // It would be more robust to do this reset at the beginning of the test,
+    // but that might hide bugs in the actual initial state.
+    scroll.scrollTop = 0;
+    scroll.scrollLeft = 0;
+    console.log('reset!');
+
     pass('testDimensionProperties');
   });
 </script>

--

--- You received this message because you are subscribed to the Google Groups "Google Caja Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to