Bug 1322383 - Hardening screenshot tests by forcing about:blank to be loaded by default.
If no default page is set it can be that former tests loaded a page which still shows
the load status at the lower left corner of Firefox. This can lead to intermittent
test failures.
MozReview-Commit-ID: 77MDIRtjA4j
--- a/testing/marionette/harness/marionette_harness/tests/unit/test_screenshot.py
+++ b/testing/marionette/harness/marionette_harness/tests/unit/test_screenshot.py
@@ -35,16 +35,20 @@ svg = inline("""
class ScreenCaptureTestCase(MarionetteTestCase):
def setUp(self):
super(ScreenCaptureTestCase, self).setUp()
self._device_pixel_ratio = None
+ # Ensure that each screenshot test runs on a blank page to avoid left
+ # over elements or focus which could interfer with taking screenshots
+ self.marionette.navigate("about:blank")
+
@property
def device_pixel_ratio(self):
if self._device_pixel_ratio is None:
self._device_pixel_ratio = self.marionette.execute_script("""
return window.devicePixelRatio
""")
return self._device_pixel_ratio