Backed out 17 changesets (bug 1363428) for various testfailures
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Wed, 21 Jun 2017 15:16:00 +0200
changeset 598360 fec6f08ea5ff7cda1154eceee994ab0762fcdd13
parent 598359 8282a7374309453f7a66bf1fbe0bcd8879a929e1
child 598361 147ad58662c7eb63eb80ca941d49f4489467f565
push id65172
push usergpascutto@mozilla.com
push dateWed, 21 Jun 2017 16:21:54 +0000
bugs1363428
milestone56.0a1
backs out70ce0f808a667d7d4764425436c7b82971c41094
5a9a4960a48aba052634394c838c63922eda948d
a927531f40db2777e72e9d397b024bd0a52aadc3
f1114f4af79ad008ef0146c5beda4d68eec2f374
4ea37712ed33ef508e1cbb10d6ebabbee1f4b4a1
11692e3c22ebe0926b8b147923f0d68a2ae52cd7
a85d3f3544cbc374eae165db68e81b82ed68a3f5
6a7985dda6a142f403e3a0b5dfe93cdc1cf96afc
f09573370d2fb3b9d6aa43a4c0588c22365ae68f
2b5ad17f890a1bd4df08f0f2504e6e5cf533525b
c7086fa5816cc33d4b2358fc5bd8d25fa1c13f74
d2f9bdba146c2b288f37bf99ed580613ebf91605
014b9aeb9ac2e5da135988fcf8c1d4f970499be4
41d682cbc05fc25da3f4eac84c9da8dfc5ca6086
e2e74e66ca3ecf29533db53aec350a40fb5f9679
97db3b14fafd81b64685844c95d2eefd5a2cc8fb
42e2ae6126635002bb3da3c179e3bc36e367e090
Backed out 17 changesets (bug 1363428) for various testfailures Backed out changeset 70ce0f808a66 (bug 1363428) Backed out changeset 5a9a4960a48a (bug 1363428) Backed out changeset a927531f40db (bug 1363428) Backed out changeset f1114f4af79a (bug 1363428) Backed out changeset 4ea37712ed33 (bug 1363428) Backed out changeset 11692e3c22eb (bug 1363428) Backed out changeset a85d3f3544cb (bug 1363428) Backed out changeset 6a7985dda6a1 (bug 1363428) Backed out changeset f09573370d2f (bug 1363428) Backed out changeset 2b5ad17f890a (bug 1363428) Backed out changeset c7086fa5816c (bug 1363428) Backed out changeset d2f9bdba146c (bug 1363428) Backed out changeset 014b9aeb9ac2 (bug 1363428) Backed out changeset 41d682cbc05f (bug 1363428) Backed out changeset e2e74e66ca3e (bug 1363428) Backed out changeset 97db3b14fafd (bug 1363428) Backed out changeset 42e2ae612663 (bug 1363428)
layout/tools/reftest/reftest-content.js
testing/marionette/browser.js
testing/marionette/capture.js
testing/marionette/driver.js
testing/marionette/jar.mn
testing/marionette/listener.js
testing/marionette/reftest.js
testing/marionette/reftest.xul
testing/mozharness/scripts/web_platform_tests.py
testing/profiles/prefs_general.js
testing/web-platform/mach_commands.py
testing/web-platform/meta/2dcontext/drawing-images-to-the-canvas/drawimage_html_image_14.html.ini
testing/web-platform/meta/2dcontext/drawing-images-to-the-canvas/drawimage_html_image_15.html.ini
testing/web-platform/meta/2dcontext/drawing-images-to-the-canvas/drawimage_html_image_3.html.ini
testing/web-platform/meta/2dcontext/drawing-images-to-the-canvas/drawimage_html_image_4.html.ini
testing/web-platform/meta/2dcontext/drawing-images-to-the-canvas/drawimage_html_image_5.html.ini
testing/web-platform/meta/2dcontext/drawing-images-to-the-canvas/drawimage_html_image_6.html.ini
testing/web-platform/meta/2dcontext/drawing-images-to-the-canvas/drawimage_html_image_7.html.ini
testing/web-platform/meta/2dcontext/drawing-images-to-the-canvas/drawimage_html_image_8.html.ini
testing/web-platform/meta/MANIFEST.json
testing/web-platform/meta/html/rendering/bindings/the-textarea-element-0/cols-zero.html.ini
testing/web-platform/meta/html/rendering/bindings/the-textarea-element-0/rows-zero.html.ini
testing/web-platform/meta/html/rendering/non-replaced-elements/lists/li-type-unsupported-lower-alpha.html.ini
testing/web-platform/meta/html/rendering/non-replaced-elements/lists/li-type-unsupported-lower-roman.html.ini
testing/web-platform/meta/html/rendering/non-replaced-elements/lists/li-type-unsupported-upper-roman.html.ini
testing/web-platform/meta/html/rendering/non-replaced-elements/lists/ol-type-supported-xhtml.xhtml.ini
testing/web-platform/meta/html/rendering/non-replaced-elements/lists/ol-type-unsupported-invalid.html.ini
testing/web-platform/meta/html/rendering/non-replaced-elements/lists/ul-type-supported-xhtml.xhtml.ini
testing/web-platform/meta/html/rendering/non-replaced-elements/lists/ul-type-supported.html.ini
testing/web-platform/meta/html/rendering/non-replaced-elements/lists/ul-type-unsupported-invalid.html.ini
testing/web-platform/meta/html/rendering/non-replaced-elements/tables/table-border-1.html.ini
testing/web-platform/meta/html/rendering/non-replaced-elements/tables/table-border-2.html.ini
testing/web-platform/meta/html/rendering/non-replaced-elements/tables/table-cell-width-s.html.ini
testing/web-platform/meta/html/rendering/non-replaced-elements/tables/table-cell-width.html.ini
testing/web-platform/meta/html/rendering/non-replaced-elements/tables/table-width-s.html.ini
testing/web-platform/meta/html/rendering/replaced-elements/embedded-content-rendering-rules/canvas_without_context_a.html.ini
testing/web-platform/meta/html/semantics/embedded-content/the-iframe-element/iframe-with-base.html.ini
testing/web-platform/meta/html/semantics/embedded-content/the-img-element/document-adopt-base-url.html.ini
testing/web-platform/meta/html/semantics/grouping-content/the-ol-element/reversed-1a.html.ini
testing/web-platform/meta/html/semantics/grouping-content/the-ol-element/reversed-1b.html.ini
testing/web-platform/meta/html/semantics/grouping-content/the-ol-element/reversed-1c.html.ini
testing/web-platform/meta/html/semantics/grouping-content/the-ol-element/reversed-1d.html.ini
testing/web-platform/meta/html/semantics/text-level-semantics/the-wbr-element/wbr-element.html.ini
testing/web-platform/meta/mathml/relations/html5-tree/href-click-1.html.ini
testing/web-platform/meta/mathml/relations/html5-tree/href-click-2.html.ini
testing/web-platform/meta/quirks-mode/historical/list-item-bullet-size.html.ini
testing/web-platform/meta/svg/shapes/rect-01.svg.ini
testing/web-platform/meta/svg/shapes/rect-02.svg.ini
testing/web-platform/meta/webvtt/rendering/cues-with-video/processing-model/basic.html.ini
testing/web-platform/meta/webvtt/rendering/cues-with-video/processing-model/bidi/bidi_ruby.html.ini
testing/web-platform/meta/webvtt/rendering/cues-with-video/processing-model/bidi/u0041_first.html.ini
testing/web-platform/meta/webvtt/rendering/cues-with-video/processing-model/bidi/u06E9_no_strong_dir.html.ini
testing/web-platform/meta/webvtt/rendering/cues-with-video/processing-model/selectors/default_styles/italic_object_default_font-style.html.ini
testing/web-platform/meta/webvtt/rendering/cues-with-video/processing-model/selectors/default_styles/underline_object_default_font-style.html.ini
testing/web-platform/meta/webvtt/rendering/cues-with-video/processing-model/too_many_cues.html.ini
testing/web-platform/tests/fonts/Ahem.ttf
testing/web-platform/tests/tools/wptrunner/wptrunner/browsers/firefox.py
testing/web-platform/tests/tools/wptrunner/wptrunner/executors/base.py
testing/web-platform/tests/tools/wptrunner/wptrunner/executors/executormarionette.py
testing/web-platform/tests/tools/wptrunner/wptrunner/testloader.py
testing/web-platform/tests/tools/wptrunner/wptrunner/testrunner.py
testing/web-platform/tests/tools/wptrunner/wptrunner/wptcommandline.py
testing/web-platform/tests/tools/wptrunner/wptrunner/wptrunner.py
testing/web-platform/tests/tools/wptrunner/wptrunner/wpttest.py
--- a/layout/tools/reftest/reftest-content.js
+++ b/layout/tools/reftest/reftest-content.js
@@ -442,17 +442,16 @@ function FlushRendering() {
 }
 
 function WaitForTestEnd(contentRootElement, inPrintMode, spellCheckedElements) {
     var stopAfterPaintReceived = false;
     var currentDoc = content.document;
     var state = STATE_WAITING_TO_FIRE_INVALIDATE_EVENT;
 
     function AfterPaintListener(event) {
-        dump("AfterPaintListener\n");
         LogInfo("AfterPaintListener in " + event.target.document.location.href);
         if (event.target.document != currentDoc) {
             // ignore paint events for subframes or old documents in the window.
             // Invalidation in subframes will cause invalidation in the toplevel document anyway.
             return;
         }
 
         SendUpdateCanvasForEvent(event, contentRootElement);
--- a/testing/marionette/browser.js
+++ b/testing/marionette/browser.js
@@ -122,31 +122,29 @@ browser.Context = class {
 
   /**
    * Returns the content browser for the currently selected tab.
    * If there is no tab selected, null will be returned.
    */
   get contentBrowser() {
     if (this.tab) {
       return browser.getBrowserForTab(this.tab);
-    } else if (this.tabBrowser && this.driver.isReftestBrowser(this.tabBrowser)) {
-      return this.tabBrowser;
     }
 
     return null;
   }
 
   /**
    * The current frame ID is managed per browser element on desktop in
    * case the ID needs to be refreshed. The currently selected window is
    * identified by a tab.
    */
   get curFrameId() {
     let rv = null;
-     if (this.tab || this.driver.isReftestBrowser(this.contentBrowser) ) {
+    if (this.tab) {
       rv = this.getIdForBrowser(this.contentBrowser);
     }
     return rv;
   }
 
   /**
    * Returns the current URL of the content browser.
    * If no browser is available, null will be returned.
@@ -206,17 +204,17 @@ browser.Context = class {
    *     A promise which is resolved when the current tab has been closed.
    *
    * @throws UnsupportedOperationError
    *     If tab handling for the current application isn't supported.
    */
   closeTab() {
     // If the current window is not a browser then close it directly. Do the
     // same if only one remaining tab is open, or no tab selected at all.
-    if (!this.tabBrowser || !this.tabBrowser.tabs || this.tabBrowser.tabs.length === 1 || !this.tab) {
+    if (!this.tabBrowser || this.tabBrowser.tabs.length === 1 || !this.tab) {
       return this.closeWindow();
     }
 
     return new Promise((resolve, reject) => {
       if (this.tabBrowser.closeTab) {
         // Fennec
         this.tabBrowser.deck.addEventListener("TabClose", ev => {
           resolve();
--- a/testing/marionette/capture.js
+++ b/testing/marionette/capture.js
@@ -39,17 +39,17 @@ capture.element = function (node, highli
   let rect = node.getBoundingClientRect();
 
   return capture.canvas(
       win,
       rect.left,
       rect.top,
       rect.width,
       rect.height,
-      {highlights});
+      highlights);
 };
 
 /**
  * Take a screenshot of the window's viewport by taking into account
  * the current offsets.
  *
  * @param {DOMWindow} win
  *     The DOM window providing the document element to capture,
@@ -65,17 +65,17 @@ capture.viewport = function (win, highli
   let rootNode = win.document.documentElement;
 
   return capture.canvas(
       win,
       win.pageXOffset,
       win.pageYOffset,
       rootNode.clientWidth,
       rootNode.clientHeight,
-      {highlights});
+      highlights);
 };
 
 /**
  * Low-level interface to draw a rectangle off the framebuffer.
  *
  * @param {DOMWindow} win
  *     The DOM window used for the framebuffer, and providing the interfaces
  *     for creating an HTMLCanvasElement.
@@ -85,51 +85,39 @@ capture.viewport = function (win, highli
  *     The top, Y axis offset of the rectangle.
  * @param {number} width
  *     The width dimension of the rectangle to paint.
  * @param {number} height
  *     The height dimension of the rectangle to paint.
  * @param {Array.<Node>=} highlights
  *     Optional array of nodes, around which a border will be marked to
  *     highlight them in the screenshot.
- * @param {HTMLCanvasElement=} canvas
- *     Optional canvas to reuse for the screenshot.
- * @param {number=} flags
- *     Optional integer representing flags to pass to drawWindow; these
- *     are defined on CanvasRenderingContext2D.
  *
  * @return {HTMLCanvasElement}
  *     The canvas on which the selection from the window's framebuffer
  *     has been painted on.
  */
-capture.canvas = function (win, left, top, width, height,
-    {highlights = [], canvas = null, flags = null} = {}) {
-    let scale = win.devicePixelRatio;
+capture.canvas = function (win, left, top, width, height, highlights = []) {
+  let scale = win.devicePixelRatio;
 
-  if (canvas === null) {
-    canvas = win.document.createElementNS(XHTML_NS, "canvas");
-    canvas.width = width * scale;
-    canvas.height = height * scale;
-  }
+  let canvas = win.document.createElementNS(XHTML_NS, "canvas");
+  canvas.width = width * scale;
+  canvas.height = height * scale;
 
   let ctx = canvas.getContext(CONTEXT_2D);
-  if (flags === null) {
-    flags = ctx.DRAWWINDOW_DRAW_CARET;
-    // Disabled in bug 1243415 for webplatform-test failures due to out of view elements.
-    // Needs https://github.com/w3c/web-platform-tests/issues/4383 fixed.
-    // ctx.DRAWWINDOW_DRAW_VIEW;
-    // Bug 1009762 - Crash in [@ mozilla::gl::ReadPixelsIntoDataSurface]
-    // ctx.DRAWWINDOW_USE_WIDGET_LAYERS;
-   }
+  let flags = ctx.DRAWWINDOW_DRAW_CARET;
+      // Disabled in bug 1243415 for webplatform-test failures due to out of view elements.
+      // Needs https://github.com/w3c/web-platform-tests/issues/4383 fixed.
+      // ctx.DRAWWINDOW_DRAW_VIEW;
+      // Bug 1009762 - Crash in [@ mozilla::gl::ReadPixelsIntoDataSurface]
+      // ctx.DRAWWINDOW_USE_WIDGET_LAYERS;
 
   ctx.scale(scale, scale);
   ctx.drawWindow(win, left, top, width, height, BG_COLOUR, flags);
-  if (highlights.length) {
-    ctx = capture.highlight_(ctx, highlights, top, left);
-  }
+  ctx = capture.highlight_(ctx, highlights, top, left);
 
   return canvas;
 };
 
 capture.highlight_ = function (context, highlights, top = 0, left = 0) {
   if (!highlights) {
     return;
   }
@@ -197,9 +185,9 @@ function hex(buffer) {
   for (let i = 0; i < view.byteLength; i += 4) {
     let value = view.getUint32(i);
     let stringValue = value.toString(16);
     let padding = '00000000';
     let paddedValue = (padding + stringValue).slice(-padding.length);
     hexCodes.push(paddedValue);
   }
   return hexCodes.join("");
-};
+};
\ No newline at end of file
--- a/testing/marionette/driver.js
+++ b/testing/marionette/driver.js
@@ -29,17 +29,16 @@ Cu.import("chrome://marionette/content/e
 Cu.import("chrome://marionette/content/evaluate.js");
 Cu.import("chrome://marionette/content/event.js");
 Cu.import("chrome://marionette/content/interaction.js");
 Cu.import("chrome://marionette/content/l10n.js");
 Cu.import("chrome://marionette/content/legacyaction.js");
 Cu.import("chrome://marionette/content/logging.js");
 Cu.import("chrome://marionette/content/modal.js");
 Cu.import("chrome://marionette/content/proxy.js");
-Cu.import("chrome://marionette/content/reftest.js");
 Cu.import("chrome://marionette/content/session.js");
 Cu.import("chrome://marionette/content/wait.js");
 
 this.EXPORTED_SYMBOLS = ["GeckoDriver", "Context"];
 
 var FRAME_SCRIPT = "chrome://marionette/content/listener.js";
 
 const CLICK_TO_START_PREF = "marionette.debugging.clicktostart";
@@ -79,28 +78,16 @@ this.Context.fromString = function (s) {
   s = s.toUpperCase();
   if (s in this) {
     return this[s];
   }
   return null;
 };
 
 /**
-* Helper function for converting an nsISimpleEnumerator to
-* a javascript iterator
-* @param{nsISimpleEnumerator} enumerator
-*    enumerator to convert
-*/
-function* enumeratorIterator (enumerator) {
-  while (enumerator.hasMoreElements()) {
-    yield enumerator.getNext();
-  }
-}
-
-/**
  * Implements (parts of) the W3C WebDriver protocol.  GeckoDriver lives
  * in chrome space and mediates calls to the message listener of the current
  * browsing context's content frame message listener via ListenerProxy.
  *
  * Throughout this prototype, functions with the argument {@code cmd}'s
  * documentation refers to the contents of the {@code cmd.parameters}
  * object.
  *
@@ -187,50 +174,47 @@ Object.defineProperty(GeckoDriver.protot
     return this.capabilities.get("timeouts");
   },
 
   set: function (newTimeouts) {
     this.capabilities.set("timeouts", newTimeouts);
   },
 });
 
-Object.defineProperty(GeckoDriver.prototype, "windows", {
-  get: function () {
-    return enumeratorIterator(Services.wm.getEnumerator(null));
-  }
-});
-
 Object.defineProperty(GeckoDriver.prototype, "windowHandles", {
   get: function () {
     let hs = [];
-
-    for (let win of this.windows) {
+    let winEn = Services.wm.getEnumerator(null);
+
+    while (winEn.hasMoreElements()) {
+      let win = winEn.getNext();
       let tabBrowser = browser.getTabBrowser(win);
 
       // Only return handles for browser windows
-      if (tabBrowser && tabBrowser.tabs) {
+      if (tabBrowser) {
         tabBrowser.tabs.forEach(tab => {
           let winId = this.getIdForBrowser(browser.getBrowserForTab(tab));
           if (winId !== null) {
             hs.push(winId);
           }
         });
       }
     }
 
     return hs;
   },
 });
 
 Object.defineProperty(GeckoDriver.prototype, "chromeWindowHandles", {
   get: function () {
     let hs = [];
-
-    for (let win of this.windows) {
-      hs.push(getOuterWindowId(win));
+    let winEn = Services.wm.getEnumerator(null);
+
+    while (winEn.hasMoreElements()) {
+      hs.push(getOuterWindowId(winEn.getNext()));
     }
 
     return hs;
   },
 });
 
 GeckoDriver.prototype.QueryInterface = XPCOMUtils.generateQI([
   Ci.nsIMessageListener,
@@ -357,33 +341,27 @@ GeckoDriver.prototype.getCurrentWindow =
         win = this.curBrowser.window;
       }
 
       break;
 
     case Context.CONTENT:
       if (this.curFrame !== null) {
         win = this.curFrame;
+
       } else if (this.curBrowser !== null && this.curBrowser.contentBrowser) {
-        win = this.curBrowser.window;
+          win = this.curBrowser.window;
       }
+
       break;
   }
 
   return win;
 };
 
-GeckoDriver.prototype.isReftestBrowser = function (element) {
-  return this._reftest &&
-    element &&
-    element.tagName === "xul:browser" &&
-    element.parentElement &&
-    element.parentElement.id === "reftest";
-}
-
 GeckoDriver.prototype.addFrameCloseListener = function (action) {
   let win = this.getCurrentWindow();
   this.mozBrowserClose = e => {
     if (e.target.id == this.oopFrameId) {
       win.removeEventListener("mozbrowserclose", this.mozBrowserClose, true);
       this.switchToGlobalMessageManager();
       throw new NoSuchWindowError("The window closed during action: " + action);
     }
@@ -1388,110 +1366,81 @@ GeckoDriver.prototype.switchToWindow = f
 
   // Window IDs are internally handled as numbers, but here it could also be the
   // name of the window.
   let switchTo = parseInt(cmd.parameters.name);
   if (isNaN(switchTo)) {
     switchTo = cmd.parameters.name;
   }
 
-  let byNameOrId = function (win, windowId) {
-    return switchTo === win.name || switchTo === windowId;
+  let byNameOrId = function (name, windowId) {
+    return switchTo === name || switchTo === windowId;
   };
 
-  let found = this.findWindow(this.windows, byNameOrId);
-
-  if (found) {
-      yield this.setWindowHandle(found, focus);
-  } else {
-    throw new NoSuchWindowError(`Unable to locate window: ${switchTo}`);
-  }
-};
-
-/**
- * Find a specific window according to some filter function.
- *
- * @param {Iterable.<Window>} winIterable
- *     Iterable that emits Windows.
- * @param {function(Window, number): boolean} filter
- *     A callback function taking two arguments; the window and
- *     the outerId of the window, and returning a boolean indicating
- *     whether the window is the target.
- *
- * @return {Object}
- *     A window handle object containing the window and some
- *     associated metadata.
- */
-GeckoDriver.prototype.findWindow = function (winIterable, filter) {
-  for (let win of winIterable) {
+  let found;
+  let winEn = Services.wm.getEnumerator(null);
+  while (winEn.hasMoreElements()) {
+    let win = winEn.getNext();
     let outerId = getOuterWindowId(win);
     let tabBrowser = browser.getTabBrowser(win);
-    if (filter(win, outerId)) {
+
+    if (byNameOrId(win.name, outerId)) {
       // In case the wanted window is a chrome window, we are done.
-      return {win: win, outerId: outerId, hasTabBrowser: !!tabBrowser};
-    } else if (tabBrowser && tabBrowser.tabs) {
+      found = {win: win, outerId: outerId, hasTabBrowser: !!tabBrowser};
+      break;
+
+    } else if (tabBrowser) {
       // Otherwise check if the chrome window has a tab browser, and that it
       // contains a tab with the wanted window handle.
       for (let i = 0; i < tabBrowser.tabs.length; ++i) {
         let contentBrowser = browser.getBrowserForTab(tabBrowser.tabs[i]);
         let contentWindowId = this.getIdForBrowser(contentBrowser);
 
-        if (filter(win, contentWindowId)) {
-          return {
+        if (byNameOrId(win.name, contentWindowId)) {
+          found = {
             win: win,
             outerId: outerId,
             hasTabBrowser: true,
             tabIndex: i,
           };
+          break;
         }
       }
     }
   }
-  return null;
-};
-
-/**
- * Switch the marionette window to a given window. If the browser in
- * the window is unregistered, registers that browser and waits for
- * the registration is complete. If |focus| is true then set the focus
- * on the window.
- *
- * @param {Object} winProperties
- *     Object containing window properties such as returned from
- *     GeckoDriver#findWindow
- * @param {boolean=} focus
- *     A boolean value which determines whether to focus the window.
- *     Defaults to true.
- */
-GeckoDriver.prototype.setWindowHandle = function* (winProperties, focus = true) {
-  if (!(winProperties.outerId in this.browsers)) {
-    // Initialise Marionette if the current chrome window has not been seen
-    // before. Also register the initial tab, if one exists.
-    let registerBrowsers, browserListening;
-
-    if (winProperties.hasTabBrowser) {
-      registerBrowsers = this.registerPromise();
-      browserListening = this.listeningPromise();
+
+  if (found) {
+    if (!(found.outerId in this.browsers)) {
+      // Initialise Marionette if the current chrome window has not been seen
+      // before. Also register the initial tab, if one exists.
+      let registerBrowsers, browserListening;
+
+      if (found.hasTabBrowser) {
+        registerBrowsers = this.registerPromise();
+        browserListening = this.listeningPromise();
+      }
+
+      this.startBrowser(found.win, false /* isNewSession */);
+
+      if (registerBrowsers && browserListening) {
+        yield registerBrowsers;
+        yield browserListening;
+      }
+
+    } else {
+      // Otherwise switch to the known chrome window, and activate the tab
+      // if it's a content browser.
+      this.curBrowser = this.browsers[found.outerId];
+
+      if ("tabIndex" in found) {
+        this.curBrowser.switchToTab(found.tabIndex, found.win, focus);
+      }
     }
-
-    this.startBrowser(winProperties.win, false /* isNewSession */);
-
-    if (registerBrowsers && browserListening) {
-      yield registerBrowsers;
-      yield browserListening;
-    }
-
   } else {
-    // Otherwise switch to the known chrome window, and activate the tab
-    // if it's a content browser.
-    this.curBrowser = this.browsers[winProperties.outerId];
-
-    if ("tabIndex" in winProperties) {
-      this.curBrowser.switchToTab(winProperties.tabIndex, winProperties.win, focus);
-    }
+    throw new NoSuchWindowError(`Unable to locate window: ${switchTo}`);
   }
 };
 
 GeckoDriver.prototype.getActiveFrame = function (cmd, resp) {
   assert.window(this.getCurrentWindow());
 
   switch (this.context) {
     case Context.CHROME:
@@ -2550,23 +2499,23 @@ GeckoDriver.prototype.deleteCookie = fun
  *     A modal dialog is open, blocking this operation.
  */
 GeckoDriver.prototype.close = function (cmd, resp) {
   assert.contentBrowser(this.curBrowser);
   assert.noUserPrompt(this.dialog);
 
   let nwins = 0;
 
-  for (let win of this.windows) {
-    // For browser windows count the tabs. Otherwise take the window itself.
+  let winEn = Services.wm.getEnumerator(null);
+  while (winEn.hasMoreElements()) {
+    let win = winEn.getNext();
     let tabbrowser = browser.getTabBrowser(win);
-    if (tabbrowser && tabbrowser.tabs) {
+
+    if (tabbrowser) {
       nwins += tabbrowser.tabs.length;
-    } else {
-      nwins += 1;
     }
   }
 
   // If there is only 1 window left, do not close it. Instead return a faked
   // empty array of window handles. This will instruct geckodriver to terminate
   // the application.
   if (nwins === 1) {
     return [];
@@ -2590,18 +2539,20 @@ GeckoDriver.prototype.close = function (
  *     Unique chrome window handles of remaining chrome windows.
  */
 GeckoDriver.prototype.closeChromeWindow = function (cmd, resp) {
   assert.firefox();
   assert.window(this.getCurrentWindow(Context.CHROME));
 
   let nwins = 0;
 
-  for (let _ of this.windows) {
+  let winEn = Services.wm.getEnumerator(null);
+  while (winEn.hasMoreElements()) {
     nwins++;
+    winEn.getNext();
   }
 
   // If there is only 1 window left, do not close it. Instead return a faked
   // empty array of window handles. This will instruct geckodriver to terminate
   // the application.
   if (nwins == 1) {
     return [];
   }
@@ -2626,17 +2577,19 @@ GeckoDriver.prototype.deleteSession = fu
     for (let win in this.browsers) {
       let browser = this.browsers[win];
       for (let i in browser.knownFrames) {
         globalMessageManager.broadcastAsyncMessage(
             "Marionette:deleteSession" + browser.knownFrames[i], {});
       }
     }
 
-    for (let win of this.windows) {
+    let winEn = Services.wm.getEnumerator(null);
+    while (winEn.hasMoreElements()) {
+      let win = winEn.getNext();
       if (win.messageManager) {
         win.messageManager.removeDelayedFrameScript(FRAME_SCRIPT);
       } else {
         logger.error(
             `Could not remove listener from page ${win.location.href}`);
       }
     }
 
@@ -3243,75 +3196,16 @@ GeckoDriver.prototype.localizeProperty =
   }
   if (typeof id != "string") {
     throw new InvalidArgumentError("Value of `id` should be of type 'string'");
   }
 
   resp.body.value = l10n.localizeProperty(urls, id);
 }
 
-/**
- * Initialize the reftest mode
- */
-GeckoDriver.prototype.setupReftest = function* (cmd, resp) {
-  if (this._reftest) {
-    throw new UnsupportedOperationError("Called reftest:setup with a reftest session already active");
-  }
-
-  if (this.context !== Context.CHROME) {
-    throw new UnsupportedOperationError("Must set chrome context before running reftests");
-  }
-
-  let {urlCount = {}, screenshot = "unexpected"} = cmd.parameters;
-  if (!["always", "fail", "unexpected"].includes(screenshot)) {
-    throw new InvalidArgumentError("Value of `screenshot` should be 'always', 'fail' or 'unexpected'");
-  }
-
-  this._reftest = new reftest.Runner(this);
-
-  yield this._reftest.setup(urlCount, screenshot);
-};
-
-
-/**
- * Run a reftest
- */
-GeckoDriver.prototype.runReftest = function* (cmd, resp) {
-  let {test, references, expected, timeout} = cmd.parameters;
-
-  if (!this._reftest) {
-    throw new UnsupportedOperationError("Called reftest:run before reftest:start");
-  }
-
-  assert.string(test);
-  assert.string(expected);
-  assert.array(references);
-
-  let result = yield this._reftest.run(test, references, expected, timeout);
-
-  resp.body.value = result;
-};
-
-/**
- * End a reftest run
- *
- * Closes the reftest window (without changing the current window handle),
- * and removes cached canvases.
- */
-GeckoDriver.prototype.teardownReftest = function* (cmd, resp) {
-  if (!this._reftest) {
-    throw new UnsupportedOperationError("Called reftest:teardown before reftest:start");
-  }
-
-  this._reftest.abort();
-
-  this._reftest = null;
-};
-
-
 GeckoDriver.prototype.commands = {
   "getMarionetteID": GeckoDriver.prototype.getMarionetteID,
   "sayHello": GeckoDriver.prototype.sayHello,
   "newSession": GeckoDriver.prototype.newSession,
   "getSessionCapabilities": GeckoDriver.prototype.getSessionCapabilities,
   "log": GeckoDriver.prototype.log,
   "getLogs": GeckoDriver.prototype.getLogs,
   "setContext": GeckoDriver.prototype.setContext,
@@ -3388,20 +3282,16 @@ GeckoDriver.prototype.commands = {
   "quitApplication": GeckoDriver.prototype.quit,  // deprecated, can be removed in Firefox 56
   "quit": GeckoDriver.prototype.quit,
 
   "localization:l10n:localizeEntity": GeckoDriver.prototype.localizeEntity,
   "localization:l10n:localizeProperty": GeckoDriver.prototype.localizeProperty,
 
   "addon:install": GeckoDriver.prototype.installAddon,
   "addon:uninstall": GeckoDriver.prototype.uninstallAddon,
-
-  "reftest:setup": GeckoDriver.prototype.setupReftest,
-  "reftest:run": GeckoDriver.prototype.runReftest,
-  "reftest:teardown": GeckoDriver.prototype.teardownReftest,
 };
 
 function copy (obj) {
   if (Array.isArray(obj)) {
     return obj.slice();
   } else if (typeof obj == "object") {
     return Object.assign({}, obj);
   }
--- a/testing/marionette/jar.mn
+++ b/testing/marionette/jar.mn
@@ -29,18 +29,16 @@ marionette.jar:
   content/navigate.js (navigate.js)
   content/l10n.js (l10n.js)
   content/assert.js (assert.js)
   content/addon.js (addon.js)
   content/session.js (session.js)
   content/transport.js (transport.js)
   content/packets.js (packets.js)
   content/stream-utils.js (stream-utils.js)
-  content/reftest.js (reftest.js)
-  content/reftest.xul (reftest.xul)
 #ifdef ENABLE_TESTS
   content/test.xul (chrome/test.xul)
   content/test2.xul (chrome/test2.xul)
   content/test_dialog.dtd (chrome/test_dialog.dtd)
   content/test_dialog.properties (chrome/test_dialog.properties)
   content/test_dialog.xul (chrome/test_dialog.xul)
   content/test_nested_iframe.xul (chrome/test_nested_iframe.xul)
   content/test_anonymous_content.xul (chrome/test_anonymous_content.xul)
--- a/testing/marionette/listener.js
+++ b/testing/marionette/listener.js
@@ -483,17 +483,16 @@ var releaseActionsFn = dispatch(releaseA
 var actionChainFn = dispatch(actionChain);
 var multiActionFn = dispatch(multiAction);
 var addCookieFn = dispatch(addCookie);
 var deleteCookieFn = dispatch(deleteCookie);
 var deleteAllCookiesFn = dispatch(deleteAllCookies);
 var executeFn = dispatch(execute);
 var executeInSandboxFn = dispatch(executeInSandbox);
 var sendKeysToElementFn = dispatch(sendKeysToElement);
-var reftestWaitFn = dispatch(reftestWait);
 
 /**
  * Start all message listeners
  */
 function startListeners() {
   addMessageListenerId("Marionette:newSession", newSession);
   addMessageListenerId("Marionette:execute", executeFn);
   addMessageListenerId("Marionette:executeInSandbox", executeInSandboxFn);
@@ -531,17 +530,16 @@ function startListeners() {
   addMessageListenerId("Marionette:deleteSession", deleteSession);
   addMessageListenerId("Marionette:sleepSession", sleepSession);
   addMessageListenerId("Marionette:getAppCacheStatus", getAppCacheStatus);
   addMessageListenerId("Marionette:takeScreenshot", takeScreenshotFn);
   addMessageListenerId("Marionette:addCookie", addCookieFn);
   addMessageListenerId("Marionette:getCookies", getCookiesFn);
   addMessageListenerId("Marionette:deleteAllCookies", deleteAllCookiesFn);
   addMessageListenerId("Marionette:deleteCookie", deleteCookieFn);
-  addMessageListenerId("Marionette:reftestWait", reftestWaitFn);
 }
 
 /**
  * Called when we start a new session. It registers the
  * current environment, and resets all values
  */
 function newSession(msg) {
   capabilities = session.Capabilities.fromJSON(msg.json);
@@ -1077,25 +1075,24 @@ function waitForPageLoaded(msg) {
 
 /**
  * Navigate to the given URL.  The operation will be performed on the
  * current browsing context, which means it handles the case where we
  * navigate within an iframe.  All other navigation is handled by the
  * driver (in chrome space).
  */
 function get(msg) {
-  let {command_id, pageTimeout, url, loadEventExpected=null} = msg.json;
+  let {command_id, pageTimeout, url} = msg.json;
+  let loadEventExpected = true;
 
   try {
     if (typeof url == "string") {
       try {
         let requestedURL = new URL(url).toString();
-        if (loadEventExpected === null) {
-          loadEventExpected = navigate.isLoadEventExpected(requestedURL);
-        }
+        loadEventExpected = navigate.isLoadEventExpected(requestedURL);
       } catch (e) {
         sendError(new InvalidArgumentError("Malformed URL: " + e.message), command_id);
         return;
       }
     }
 
     // We need to move to the top frame before navigating
     sendSyncMessage("Marionette:switchedToFrame", {frameValue: null});
@@ -1733,121 +1730,10 @@ function takeScreenshot(format, opts = {
     case capture.Format.Hash:
       return capture.toHash(canvas);
 
     default:
       throw new TypeError("Unknown screenshot format: " + format);
   }
 }
 
-function flushRendering() {
-  let content = curContainer.frame;
-  let anyPendingPaintsGeneratedInDescendants = false;
-
-  let windowUtils = content.QueryInterface(Ci.nsIInterfaceRequestor)
-    .getInterface(Ci.nsIDOMWindowUtils);
-
-  function flushWindow(win) {
-    let utils = win.QueryInterface(Ci.nsIInterfaceRequestor)
-      .getInterface(Ci.nsIDOMWindowUtils);
-    let afterPaintWasPending = utils.isMozAfterPaintPending;
-
-    let root = win.document.documentElement;
-    if (root) {
-      try {
-        // Flush pending restyles and reflows for this window
-        root.getBoundingClientRect();
-      } catch (e) {
-        logger.warning(`flushWindow failed: ${e}`);
-      }
-    }
-
-    if (!afterPaintWasPending && utils.isMozAfterPaintPending) {
-      anyPendingPaintsGeneratedInDescendants = true;
-    }
-
-    for (let i = 0; i < win.frames.length; ++i) {
-      flushWindow(win.frames[i]);
-    }
-  }
-  flushWindow(content);
-
-  if (anyPendingPaintsGeneratedInDescendants &&
-      !windowUtils.isMozAfterPaintPending) {
-    logger.error("Internal error: descendant frame generated a MozAfterPaint event, but the root document doesn't have one!");
-  }
-
-  logger.debug(`flushRendering ${windowUtils.isMozAfterPaintPending}`);
-  return windowUtils.isMozAfterPaintPending;
-}
-
-function* reftestWait(url, remote) {
-  let win = curContainer.frame;
-  let document = curContainer.frame.document;
-
-  let windowUtils = content.QueryInterface(Ci.nsIInterfaceRequestor)
-      .getInterface(Ci.nsIDOMWindowUtils);
-
-
-  let reftestWait = false;
-
-  if (document.location.href !== url || document.readyState != "complete") {
-    logger.debug(`Waiting for page load of ${url}`);
-    yield new Promise(resolve => {
-      let maybeResolve = (event) => {
-        if (event.target === curContainer.frame.document &&
-            event.target.location.href === url) {
-          win = curContainer.frame;
-          document = curContainer.frame.document;
-          reftestWait = document.documentElement.classList.contains("reftest-wait");
-          removeEventListener("load", maybeResolve, {once: true});
-          win.setTimeout(resolve, 0);
-        }
-      };
-      addEventListener("load", maybeResolve, true);
-    });
-  } else {
-    // Ensure that the event loop has spun at least once since load,
-    // so that setTimeout(fn, 0) in the load event has run
-    reftestWait = document.documentElement.classList.contains("reftest-wait");
-    yield new Promise(resolve => win.setTimeout(resolve, 0));
-  };
-
-  let root = document.documentElement;
-  if (reftestWait) {
-    // Check again in case reftest-wait was removed since the load event
-    if (root.classList.contains("reftest-wait")) {
-      logger.debug("Waiting for reftest-wait removal");
-      yield new Promise(resolve => {
-        let observer = new win.MutationObserver(() => {
-          if (!root.classList.contains("reftest-wait")) {
-            observer.disconnect();
-            logger.debug("reftest-wait removed");
-            win.setTimeout(resolve, 0);
-          }
-        });
-        observer.observe(root, {attributes: true});
-      });
-    }
-
-    logger.debug("Waiting for rendering");
-
-    yield new Promise(resolve => {
-      let maybeResolve = () => {
-        if (flushRendering()) {
-          win.addEventListener("MozAfterPaint", maybeResolve, {once: true});
-        } else {
-          win.setTimeout(resolve, 0);
-        }
-      };
-      maybeResolve();
-    });
-  } else {
-    flushRendering();
-  }
-
-  if (remote) {
-    windowUtils.updateLayerTree();
-  }
-}
-
 // Call register self when we get loaded
 registerSelf();
deleted file mode 100644
--- a/testing/marionette/reftest.js
+++ /dev/null
@@ -1,353 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-"use strict";
-
-const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
-
-Cu.import("resource://gre/modules/Log.jsm");
-Cu.import("resource://gre/modules/Preferences.jsm");
-Cu.import("resource://gre/modules/Task.jsm");
-
-Cu.import("chrome://marionette/content/assert.js");
-Cu.import("chrome://marionette/content/capture.js");
-
-this.EXPORTED_SYMBOLS = ["reftest"];
-
-const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
-const PREF_E10S = "browser.tabs.remote.autostart";
-
-const logger = Log.repository.getLogger("Marionette");
-
-const SCREENSHOT_MODE = {
-  unexpected: 0,
-  fail: 1,
-  always: 2
-};
-
-const STATUS = {
-  PASS: "PASS",
-  FAIL: "FAIL",
-  ERROR: "ERROR",
-  TIMEOUT: "TIMEOUT",
-};
-
-/**
- * Implements an fast runner for web-platform-tests format reftests
- * c.f. http://web-platform-tests.org/writing-tests/reftests.html
- */
-let reftest = {};
-
-reftest.Runner = class {
-  constructor(driver) {
-    this.driver = driver;
-    this.canvasCache = new Map([[null, []]]);
-    this.windowUtils = null;
-    this.lastUrl = null;
-    this.remote = Preferences.get(PREF_E10S);
-  }
-
-  /**
-   * Setup the required environment for running reftests.
-   *
-   * This will open a non-browser window in which the tests will
-   * be loaded, and set up various caches for the reftest run.
-   *
-   * @param {Object.<Number>} urlCount
-   *     Object holding a map of URL: number of times the URL
-   *     will be opened during the reftest run, where that's
-   *     greater than 1.
-   * @param {string} screenshotMode
-   *     String enum representing when screenshots should be taken
-   */
-  *setup(urlCount, screenshotMode) {
-    this.parentWindow =  assert.window(this.driver.getCurrentWindow());
-
-    this.screenshotMode = SCREENSHOT_MODE[screenshotMode] ||
-        SCREENSHOT_MODE["unexpected"];
-
-    this.urlCount = Object.keys(urlCount || {})
-        .reduce((map, key) => map.set(key, urlCount[key]), new Map());
-
-    yield this.ensureWindow();
-  };
-
-  *ensureWindow() {
-    if (this.reftestWin && !this.reftestWin.closed) {
-      return this.reftestWin;
-    }
-
-    let reftestWin = yield this.openWindow();
-
-    let found = this.driver.findWindow([reftestWin], () => true);
-    yield this.driver.setWindowHandle(found, true);
-
-    this.windowUtils = reftestWin.QueryInterface(Ci.nsIInterfaceRequestor)
-      .getInterface(Ci.nsIDOMWindowUtils);
-    this.reftestWin = reftestWin;
-    return reftestWin;
-  }
-
-  *openWindow() {
-    let reftestWin;
-    yield new Promise(resolve => {
-      reftestWin = this.parentWindow.openDialog("chrome://marionette/content/reftest.xul",
-                                                "reftest",
-                                                "chrome,dialog,height=600,width=600,all",
-                                                () => resolve());
-    });
-
-    let browser = reftestWin.document.createElementNS(XUL_NS, "xul:browser");
-    browser.permanentKey = {};
-    browser.setAttribute("id", "browser");
-    browser.setAttribute("anonid", "initialBrowser");
-    browser.setAttribute("type", "content");
-    browser.setAttribute("primary", "true");
-
-    if (this.remote) {
-      browser.setAttribute("remote", "true");
-      browser.setAttribute("remoteType", "web");
-    }
-    // Make sure the browser element is exactly 600x600, no matter
-    // what size our window is
-    const window_style = `padding: 0px; margin: 0px; border:none;
-min-width: 600px; min-height: 600px; max-width: 600px; max-height: 600px`;
-    browser.setAttribute("style", window_style);
-
-    let doc = reftestWin.document.documentElement;
-    while (doc.firstChild) {
-      doc.firstChild.remove();
-    }
-    doc.appendChild(browser);
-    reftestWin.gBrowser = browser;
-
-    return reftestWin;
-  }
-
-  abort() {
-    this.driver.close();
-    this.reftestWin = null;
-  }
-
-  /**
-   * Run a specific reftest.
-   *
-   * The assumed semantics are those of web-platform-tests where
-   * references form a tree and each test must meet all the conditions
-   * to reach one leaf node of the tree in order for the overall test
-   * to pass.
-   *
-   * @param {string} testUrl
-   *     URL of the test itself.
-   * @param {Array.<Array>} references
-   *     Array representing a tree of references to try. Each item in
-   *     the array represents a single reference node and has the form
-   *     [referenceUrl, references, relation], where referenceUrl is a
-   *     string to the url, relation is either "==" or "!=" depending on
-   *     the type of reftest, and references is another array containing
-   *     items of the same form, representing further comparisons treated
-   *     as AND with the current item. Sibling entries are treated as OR.
-   *     For example with testUrl of T:
-   *       references = [[A, [[B, [], ==]], ==]]
-   *       Must have T == A AND A == B to pass
-   *
-   *       references = [[A, [], ==], [B, [], !=]
-   *       Must have T == A OR T != B
-   *
-   *       references = [[A, [[B, [], ==], [C, [], ==]], ==], [D, [], ]]
-   *       Must have (T == A AND A == B) OR (T == A AND A == C) OR (T == D)
-   * @param {string} expected
-   *     Expected test outcome (e.g. PASS, FAIL).
-   * @param {number} timeout
-   *     Test timeout in ms
-   *
-   * @return {Object}
-   *     Result object with fields status, message and extra.
-   */
-  *run(testUrl, references, expected, timeout) {
-
-    let timeoutHandle;
-
-    let timeoutPromise = new Promise(resolve => {
-      timeoutHandle = this.parentWindow.setTimeout(() => {
-        resolve({status: STATUS.TIMEOUT, message: null, extra: {}});
-      }, timeout);
-    });
-
-    let testRunner = Task.spawn(function*() {
-      let result;
-      try {
-        result = yield this.runTest(testUrl, references, expected, timeout);
-      } catch (e) {
-        result = {status: STATUS.ERROR, message: e.stack, extra: {}};
-      }
-      return result;
-    }.bind(this));
-
-    let result = yield Promise.race([testRunner, timeoutPromise]);
-    this.parentWindow.clearTimeout(timeoutHandle);
-    if(result.status === STATUS.TIMEOUT) {
-      this.abort();
-    }
-
-    return result;
-  }
-
-  *runTest(testUrl, references, expected, timeout) {
-
-    let win = yield this.ensureWindow();
-
-    win.innerWidth = 600;
-    win.innerHeight = 600;
-
-    let message = "";
-
-    let screenshotData = [];
-
-    let stack = [];
-    for (let i = references.length-1; i >= 0; i--) {
-      let item = references[i];
-      stack.push([testUrl, item[0], item[1], item[2]]);
-    }
-
-    let status = STATUS.FAIL;
-
-    while (stack.length) {
-      let [lhsUrl, rhsUrl, references, relation] = stack.pop();
-      message += `Testing ${lhsUrl} ${relation} ${rhsUrl}\n`;
-
-      let comparison = yield this.compareUrls(win, lhsUrl, rhsUrl, relation, timeout);
-
-      function recordScreenshot() {
-        let toBase64 =  screenshot => screenshot.canvas.toDataURL().split(",")[1];
-        screenshotData.push([{url: lhsUrl, screenshot: toBase64(comparison.lhs)},
-                             relation,
-                             {url:rhsUrl, screenshot: toBase64(comparison.rhs)}]);
-      }
-
-      if (this.screenshotMode === SCREENSHOT_MODE.always) {
-        recordScreenshot();
-      }
-
-      if (comparison.passed) {
-        if (references.length) {
-          for (let i = references.length - 1; i >= 0; i--) {
-            let item = references[i];
-            stack.push([testUrl, item[0], item[1], item[2]]);
-          }
-        } else {
-          // Reached a leaf node so all of one reference chain passed
-          status = STATUS.PASS;
-          if (this.screenshotMode <= SCREENSHOT_MODE.fail && expected != status) {
-            recordScreenshot();
-          }
-          break;
-        }
-      } else if (!stack.length) {
-        // If we don't have any alternatives to try then this will be the last iteration,
-        // so save the failing screenshots if required
-        if (this.screenshotMode === SCREENSHOT_MODE.fail ||
-            (this.screenshotMode === SCREENSHOT_MODE.unexpected && expected != status)) {
-          recordScreenshot();
-        }
-      }
-
-      // Return any reusable canvases to the pool
-      let canvasPool = this.canvasCache.get(null);
-      [comparison.lhs, comparison.rhs].map(screenshot => {
-        if (screenshot.reuseCanvas) {
-          canvasPool.push(screenshot.canvas);
-        }
-      });
-      logger.debug(`Canvas pool is of length ${canvasPool.length}`);
-    }
-
-    let result = {status, message, extra: {}};
-    if (screenshotData.length) {
-      // For now the tbpl formatter only accepts one screenshot, so just return the
-      // last one we took.
-      result.extra.reftest_screenshots = screenshotData[screenshotData.length - 1];
-    }
-
-    return result;
-  };
-
-  *compareUrls(win, lhsUrl, rhsUrl, relation, timeout) {
-    logger.info(`Testing ${lhsUrl} ${relation} ${rhsUrl}`);
-
-    // Take the reference screenshot first so that if we pause
-    // we see the test rendering
-    let rhs = yield this.screenshot(win, rhsUrl, timeout);
-    let lhs = yield this.screenshot(win, lhsUrl, timeout);
-
-    let maxDifferences = {};
-
-    let differences = this.windowUtils.compareCanvases(lhs.canvas, rhs.canvas, {});
-
-    let passed;
-    switch (relation) {
-    case "==":
-      passed = differences === 0;
-      break;
-    case "!=":
-      passed = differences !== 0;
-      break;
-    default:
-      throw new InvalidArgumentError("Reftest operator should be '==' or '!='");
-    }
-
-    return {lhs, rhs, passed};
-  }
-
-  *screenshot(win, url, timeout) {
-    let canvas = null;
-    let remainingCount = this.urlCount.get(url) || 1;
-    let cache = remainingCount > 1;
-    logger.debug(`screenshot ${url} remainingCount: ${remainingCount} cache: ${cache}`);
-    let reuseCanvas = false;
-    if (this.canvasCache.has(url)) {
-      logger.debug(`screenshot ${url} taken from cache`);
-      canvas = this.canvasCache.get(url);
-      if (!cache) {
-        this.canvasCache.delete(url);
-      }
-    } else {
-      let canvases = this.canvasCache.get(null);
-      if (canvases.length) {
-        canvas = canvases.pop();
-      } else {
-        canvas = null;
-      }
-      reuseCanvas = !cache;
-
-      let ctxInterface = win.CanvasRenderingContext2D;
-      let flags = ctxInterface.DRAWWINDOW_DRAW_CARET |
-          ctxInterface.DRAWWINDOW_USE_WIDGET_LAYERS |
-          ctxInterface.DRAWWINDOW_DRAW_VIEW;
-
-      logger.debug(`Starting load of ${url}`);
-      if (this.lastUrl === url) {
-        logger.debug(`Refreshing page`);
-        yield this.driver.listener.refresh({commandId: this.driver.listener.activeMessageId,
-                                            pageTimeout: timeout});
-      } else {
-        yield this.driver.listener.get({commandId: this.driver.listener.activeMessageId,
-                                        url: url,
-                                        pageTimeout: timeout,
-                                        loadEventExpected: false});
-        this.lastUrl = url;
-      }
-
-      this.driver.curBrowser.contentBrowser.focus();
-      yield this.driver.listener.reftestWait(url, this.remote);
-
-      canvas = capture.canvas(win, 0, 0, win.innerWidth, win.innerHeight, {canvas, flags});
-    }
-    if (cache) {
-      this.canvasCache.set(url, canvas);
-    };
-    this.urlCount.set(url, remainingCount - 1);
-    return {canvas, reuseCanvas};
-  }
-};
deleted file mode 100644
--- a/testing/marionette/reftest.xul
+++ /dev/null
@@ -1,1 +0,0 @@
-<window id="reftest" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" onload="window.arguments[0]()"></window>
\ No newline at end of file
--- a/testing/mozharness/scripts/web_platform_tests.py
+++ b/testing/mozharness/scripts/web_platform_tests.py
@@ -211,37 +211,20 @@ class WebPlatformTest(TestingMixin, Merc
                           "bin/*",
                           "config/*",
                           "mozbase/*",
                           "marionette/*",
                           "tools/*",
                           "web-platform/*"],
             suite_categories=["web-platform"])
 
-    def _install_fonts(self):
-        # Ensure the Ahem font is available
-        dirs = self.query_abs_dirs()
-
-        if not sys.platform.startswith("darwin"):
-            font_path = os.path.join(os.path.dirname(self.binary_path), "fonts")
-        else:
-            font_path = os.path.join(os.path.dirname(self.binary_path), os.pardir, "Resources", "res", "fonts")
-        if not os.path.exists(font_path):
-            os.makedirs(font_path)
-        ahem_src = os.path.join(dirs["abs_wpttest_dir"], "tests", "fonts", "Ahem.ttf")
-        ahem_dest = os.path.join(font_path, "Ahem.ttf")
-        with open(ahem_src) as src, open(ahem_dest, "w") as dest:
-            dest.write(src.read())
-
     def run_tests(self):
         dirs = self.query_abs_dirs()
         cmd = self._query_cmd()
 
-        self._install_fonts()
-
         parser = StructuredOutputParser(config=self.config,
                                         log_obj=self.log_obj,
                                         log_compact=True,
                                         error_list=BaseErrorList + HarnessErrorList)
 
         env = {'MINIDUMP_SAVE_PATH': dirs['abs_blob_upload_dir']}
         env['RUST_BACKTRACE'] = '1'
 
--- a/testing/profiles/prefs_general.js
+++ b/testing/profiles/prefs_general.js
@@ -190,19 +190,16 @@ user_pref("layout.css.prefixes.device-pi
 user_pref("layout.css.shape-outside.enabled", true);
 
 // Enable CSS text-justify for testing
 user_pref("layout.css.text-justify.enabled", true);
 
 // Disable spammy layout warnings because they pollute test logs
 user_pref("layout.spammy_warnings.enabled", false);
 
-// Disable interuptable reflow
-user_pref("layout.interruptible-reflow.enabled", false);
-
 // Enable Media Source Extensions for testing
 user_pref("media.mediasource.mp4.enabled", true);
 user_pref("media.mediasource.webm.enabled", true);
 
 // Enable Gamepad
 user_pref("dom.gamepad.enabled", true);
 user_pref("dom.gamepad.non_standard_events.enabled", true);
 
--- a/testing/web-platform/mach_commands.py
+++ b/testing/web-platform/mach_commands.py
@@ -61,18 +61,16 @@ class WebPlatformTestsRunnerSetup(Mozbui
             if kwargs["host_cert_path"] is None:
                 kwargs["host_cert_path"] = os.path.join(here, "certs", "web-platform.test.pem")
 
         kwargs["capture_stdio"] = True
 
         if kwargs["webdriver_binary"] is None:
             kwargs["webdriver_binary"] = self.get_binary_path("geckodriver", validate_exists=False)
 
-        self.setup_fonts_firefox()
-
         kwargs = wptcommandline.check_args(kwargs)
 
     def kwargs_wptrun(self, kwargs):
         from wptrunner import wptcommandline
         here = os.path.join(self.topsrcdir, 'testing', 'web-platform')
 
         sys.path.insert(0, os.path.join(here, "tests", "tools"))
 
@@ -108,29 +106,16 @@ class WebPlatformTestsRunnerSetup(Mozbui
         dest_manifest = os.path.join(kwargs["metadata_root"], "MANIFEST.json")
 
         if not os.path.exists(dest_manifest) and os.path.exists(src_manifest):
             with open(src_manifest) as src, open(dest_manifest, "w") as dest:
                 dest.write(src.read())
 
         kwargs = wptcommandline.check_args(kwargs)
 
-    def setup_fonts_firefox(self):
-        # Ensure the Ahem font is available
-        if not sys.platform.startswith("darwin"):
-            font_path = os.path.join(os.path.dirname(self.get_binary_path()), "fonts")
-        else:
-            font_path = os.path.join(os.path.dirname(self.get_binary_path()), os.pardir, "Resources", "res", "fonts")
-        ahem_src = os.path.join(self.topsrcdir, "testing", "web-platform", "tests", "fonts", "Ahem.ttf")
-        ahem_dest = os.path.join(font_path, "Ahem.ttf")
-        if not os.path.exists(ahem_dest) and os.path.exists(ahem_src):
-            with open(ahem_src) as src, open(ahem_dest, "w") as dest:
-                dest.write(src.read())
-
-
 
 class WebPlatformTestsUpdater(MozbuildObject):
     """Update web platform tests."""
     def run_update(self, **kwargs):
         import update
         from update import updatecommandline
 
         if kwargs["config"] is None:
deleted file mode 100644
--- a/testing/web-platform/meta/2dcontext/drawing-images-to-the-canvas/drawimage_html_image_14.html.ini
+++ /dev/null
@@ -1,3 +0,0 @@
-[drawimage_html_image_14.html]
-  type: reftest
-  expected: FAIL
deleted file mode 100644
--- a/testing/web-platform/meta/2dcontext/drawing-images-to-the-canvas/drawimage_html_image_15.html.ini
+++ /dev/null
@@ -1,3 +0,0 @@
-[drawimage_html_image_15.html]
-  type: reftest
-  expected: FAIL
deleted file mode 100644
--- a/testing/web-platform/meta/2dcontext/drawing-images-to-the-canvas/drawimage_html_image_3.html.ini
+++ /dev/null
@@ -1,3 +0,0 @@
-[drawimage_html_image_3.html]
-  type: reftest
-  expected: FAIL
deleted file mode 100644
--- a/testing/web-platform/meta/2dcontext/drawing-images-to-the-canvas/drawimage_html_image_4.html.ini
+++ /dev/null
@@ -1,3 +0,0 @@
-[drawimage_html_image_4.html]
-  type: reftest
-  expected: FAIL
deleted file mode 100644
--- a/testing/web-platform/meta/2dcontext/drawing-images-to-the-canvas/drawimage_html_image_5.html.ini
+++ /dev/null
@@ -1,3 +0,0 @@
-[drawimage_html_image_5.html]
-  type: reftest
-  expected: FAIL
deleted file mode 100644
--- a/testing/web-platform/meta/2dcontext/drawing-images-to-the-canvas/drawimage_html_image_6.html.ini
+++ /dev/null
@@ -1,3 +0,0 @@
-[drawimage_html_image_6.html]
-  type: reftest
-  expected: FAIL
deleted file mode 100644
--- a/testing/web-platform/meta/2dcontext/drawing-images-to-the-canvas/drawimage_html_image_7.html.ini
+++ /dev/null
@@ -1,3 +0,0 @@
-[drawimage_html_image_7.html]
-  type: reftest
-  expected: FAIL
deleted file mode 100644
--- a/testing/web-platform/meta/2dcontext/drawing-images-to-the-canvas/drawimage_html_image_8.html.ini
+++ /dev/null
@@ -1,3 +0,0 @@
-[drawimage_html_image_8.html]
-  type: reftest
-  expected: FAIL
--- a/testing/web-platform/meta/MANIFEST.json
+++ b/testing/web-platform/meta/MANIFEST.json
@@ -47333,21 +47333,16 @@
      {}
     ]
    ],
    "fetch/nosniff/resources/worker.py": [
     [
      {}
     ]
    ],
-   "fonts/Ahem.ttf": [
-    [
-     {}
-    ]
-   ],
    "fonts/CanvasTest.ttf": [
     [
      {}
     ]
    ],
    "fonts/OWNERS": [
     [
      {}
@@ -175701,20 +175696,16 @@
   "fetch/nosniff/stylesheet.html": [
    "e2dda6ec5981c40dcad68c933336a0358639eec3",
    "testharness"
   ],
   "fetch/nosniff/worker.html": [
    "94af02c5ca5146386acd4fae5856f89cd244bed1",
    "testharness"
   ],
-  "fonts/Ahem.ttf": [
-   "8cdc9e68594fbb6db8c7b4bff643ab2432b51db6",
-   "support"
-  ],
   "fonts/CanvasTest.ttf": [
    "10a7017b4caead6817aa08b25f14950e6402dd95",
    "support"
   ],
   "fonts/OWNERS": [
    "946f23f945163bf9f9da080291b21473f6e1cbd0",
    "support"
   ],
deleted file mode 100644
--- a/testing/web-platform/meta/html/rendering/bindings/the-textarea-element-0/cols-zero.html.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[cols-zero.html]
-  type: reftest
-  expected:
-    if not debug and e10s and (os == "mac") and (version == "OS X 10.10.5") and (processor == "x86_64") and (bits == 64): FAIL
-    if debug and not stylo and e10s and (os == "mac") and (version == "OS X 10.10.5") and (processor == "x86_64") and (bits == 64): FAIL
deleted file mode 100644
--- a/testing/web-platform/meta/html/rendering/bindings/the-textarea-element-0/rows-zero.html.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[rows-zero.html]
-  type: reftest
-  expected:
-    if not debug and not stylo and e10s and (os == "mac") and (version == "OS X 10.10.5") and (processor == "x86_64") and (bits == 64): FAIL
-    if debug and not stylo and e10s and (os == "mac") and (version == "OS X 10.10.5") and (processor == "x86_64") and (bits == 64): FAIL
deleted file mode 100644
--- a/testing/web-platform/meta/html/rendering/non-replaced-elements/lists/li-type-unsupported-lower-alpha.html.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[li-type-unsupported-lower-alpha.html]
-  type: reftest
-  expected:
-    if not debug and e10s and (os == "mac") and (version == "OS X 10.10.5") and (processor == "x86_64") and (bits == 64): FAIL
-    if debug and not stylo and e10s and (os == "mac") and (version == "OS X 10.10.5") and (processor == "x86_64") and (bits == 64): FAIL
deleted file mode 100644
--- a/testing/web-platform/meta/html/rendering/non-replaced-elements/lists/li-type-unsupported-lower-roman.html.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[li-type-unsupported-lower-roman.html]
-  type: reftest
-  expected:
-    if not debug and not stylo and e10s and (os == "mac") and (version == "OS X 10.10.5") and (processor == "x86_64") and (bits == 64): FAIL
-    if debug and not stylo and e10s and (os == "mac") and (version == "OS X 10.10.5") and (processor == "x86_64") and (bits == 64): FAIL
deleted file mode 100644
--- a/testing/web-platform/meta/html/rendering/non-replaced-elements/lists/li-type-unsupported-upper-roman.html.ini
+++ /dev/null
@@ -1,4 +0,0 @@
-[li-type-unsupported-upper-roman.html]
-  type: reftest
-  expected:
-    if not debug and not stylo and e10s and (os == "mac") and (version == "OS X 10.10.5") and (processor == "x86_64") and (bits == 64): FAIL
deleted file mode 100644
--- a/testing/web-platform/meta/html/rendering/non-replaced-elements/lists/ol-type-supported-xhtml.xhtml.ini
+++ /dev/null
@@ -1,3 +0,0 @@
-[ol-type-supported-xhtml.xhtml]
-  disabled:
-    if (os == "mac"): https://bugzilla.mozilla.org/show_bug.cgi?id=1374968
deleted file mode 100644
--- a/testing/web-platform/meta/html/rendering/non-replaced-elements/lists/ol-type-unsupported-invalid.html.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[ol-type-unsupported-invalid.html]
-  type: reftest
-  expected:
-    if not debug and e10s and (os == "mac") and (version == "OS X 10.10.5") and (processor == "x86_64") and (bits == 64): FAIL
-    if debug and not stylo and e10s and (os == "mac") and (version == "OS X 10.10.5") and (processor == "x86_64") and (bits == 64): FAIL
deleted file mode 100644
--- a/testing/web-platform/meta/html/rendering/non-replaced-elements/lists/ul-type-supported-xhtml.xhtml.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[ul-type-supported-xhtml.xhtml]
-  type: reftest
-  expected:
-    if not debug and e10s and (os == "mac") and (version == "OS X 10.10.5") and (processor == "x86_64") and (bits == 64): FAIL
-    if debug and not stylo and e10s and (os == "mac") and (version == "OS X 10.10.5") and (processor == "x86_64") and (bits == 64): FAIL
deleted file mode 100644
--- a/testing/web-platform/meta/html/rendering/non-replaced-elements/lists/ul-type-supported.html.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[ul-type-supported.html]
-  type: reftest
-  expected:
-    if not debug and not stylo and e10s and (os == "mac") and (version == "OS X 10.10.5") and (processor == "x86_64") and (bits == 64): FAIL
-    if debug and not stylo and e10s and (os == "mac") and (version == "OS X 10.10.5") and (processor == "x86_64") and (bits == 64): FAIL
deleted file mode 100644
--- a/testing/web-platform/meta/html/rendering/non-replaced-elements/lists/ul-type-unsupported-invalid.html.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[ul-type-unsupported-invalid.html]
-  type: reftest
-  expected:
-    if not debug and e10s and (os == "mac") and (version == "OS X 10.10.5") and (processor == "x86_64") and (bits == 64): FAIL
-    if debug and not stylo and e10s and (os == "mac") and (version == "OS X 10.10.5") and (processor == "x86_64") and (bits == 64): FAIL
deleted file mode 100644
--- a/testing/web-platform/meta/html/rendering/non-replaced-elements/tables/table-border-1.html.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[table-border-1.html]
-  type: reftest
-  expected:
-    if not debug and e10s and (os == "mac") and (version == "OS X 10.10.5") and (processor == "x86_64") and (bits == 64): FAIL
-    if debug and not stylo and e10s and (os == "mac") and (version == "OS X 10.10.5") and (processor == "x86_64") and (bits == 64): FAIL
deleted file mode 100644
--- a/testing/web-platform/meta/html/rendering/non-replaced-elements/tables/table-border-2.html.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[table-border-2.html]
-  type: reftest
-  expected:
-    if not debug and not stylo and e10s and (os == "mac") and (version == "OS X 10.10.5") and (processor == "x86_64") and (bits == 64): FAIL
-    if debug and not stylo and e10s and (os == "mac") and (version == "OS X 10.10.5") and (processor == "x86_64") and (bits == 64): FAIL
--- a/testing/web-platform/meta/html/rendering/non-replaced-elements/tables/table-cell-width-s.html.ini
+++ b/testing/web-platform/meta/html/rendering/non-replaced-elements/tables/table-cell-width-s.html.ini
@@ -1,16 +1,3 @@
 [table-cell-width-s.html]
   type: reftest
-  expected:
-    if not debug and not stylo and e10s and (os == "win") and (version == "6.1.7601") and (processor == "x86") and (bits == 32): FAIL
-    if not debug and not stylo and not e10s and (os == "win") and (version == "6.1.7601") and (processor == "x86") and (bits == 32): FAIL
-    if debug and not stylo and e10s and (os == "win") and (version == "6.2.9200") and (processor == "x86_64") and (bits == 64): FAIL
-    if debug and not stylo and not e10s and (os == "win") and (version == "6.2.9200") and (processor == "x86_64") and (bits == 64): FAIL
-    if not debug and not stylo and e10s and (os == "win") and (version == "6.2.9200") and (processor == "x86_64") and (bits == 64): FAIL
-    if not debug and not stylo and not e10s and (os == "win") and (version == "6.2.9200") and (processor == "x86_64") and (bits == 64): FAIL
-    if debug and not stylo and not e10s and (os == "win") and (version == "10.0.15063") and (processor == "x86_64") and (bits == 64): FAIL
-    if debug and not stylo and e10s and (os == "win") and (version == "6.1.7601") and (processor == "x86") and (bits == 32): FAIL
-    if not debug and not stylo and e10s and (os == "win") and (version == "10.0.15063") and (processor == "x86_64") and (bits == 64): FAIL
-    if not debug and not stylo and not e10s and (os == "win") and (version == "10.0.15063") and (processor == "x86_64") and (bits == 64): FAIL
-    if not debug and not stylo and e10s and (os == "mac") and (version == "OS X 10.10.5") and (processor == "x86_64") and (bits == 64): FAIL
-    if debug and not stylo and not e10s and (os == "win") and (version == "6.1.7601") and (processor == "x86") and (bits == 32): FAIL
-    if debug and not stylo and e10s and (os == "win") and (version == "10.0.15063") and (processor == "x86_64") and (bits == 64): FAIL
+  expected: FAIL
deleted file mode 100644
--- a/testing/web-platform/meta/html/rendering/non-replaced-elements/tables/table-cell-width.html.ini
+++ /dev/null
@@ -1,3 +0,0 @@
-[table-cell-width.html]
-  disabled:
-    if (os == "mac"): https://bugzilla.mozilla.org/show_bug.cgi?id=1374968
--- a/testing/web-platform/meta/html/rendering/non-replaced-elements/tables/table-width-s.html.ini
+++ b/testing/web-platform/meta/html/rendering/non-replaced-elements/tables/table-width-s.html.ini
@@ -1,15 +1,3 @@
 [table-width-s.html]
   type: reftest
-  expected:
-    if not debug and not stylo and e10s and (os == "win") and (version == "6.1.7601") and (processor == "x86") and (bits == 32): FAIL
-    if not debug and not stylo and not e10s and (os == "win") and (version == "6.1.7601") and (processor == "x86") and (bits == 32): FAIL
-    if debug and not stylo and e10s and (os == "win") and (version == "6.2.9200") and (processor == "x86_64") and (bits == 64): FAIL
-    if debug and not stylo and not e10s and (os == "win") and (version == "6.2.9200") and (processor == "x86_64") and (bits == 64): FAIL
-    if not debug and not stylo and e10s and (os == "win") and (version == "6.2.9200") and (processor == "x86_64") and (bits == 64): FAIL
-    if not debug and not stylo and not e10s and (os == "win") and (version == "6.2.9200") and (processor == "x86_64") and (bits == 64): FAIL
-    if debug and not stylo and not e10s and (os == "win") and (version == "10.0.15063") and (processor == "x86_64") and (bits == 64): FAIL
-    if debug and not stylo and e10s and (os == "win") and (version == "6.1.7601") and (processor == "x86") and (bits == 32): FAIL
-    if not debug and not stylo and e10s and (os == "win") and (version == "10.0.15063") and (processor == "x86_64") and (bits == 64): FAIL
-    if not debug and not stylo and not e10s and (os == "win") and (version == "10.0.15063") and (processor == "x86_64") and (bits == 64): FAIL
-    if debug and not stylo and not e10s and (os == "win") and (version == "6.1.7601") and (processor == "x86") and (bits == 32): FAIL
-    if debug and not stylo and e10s and (os == "win") and (version == "10.0.15063") and (processor == "x86_64") and (bits == 64): FAIL
+  expected: FAIL
--- a/testing/web-platform/meta/html/rendering/replaced-elements/embedded-content-rendering-rules/canvas_without_context_a.html.ini
+++ b/testing/web-platform/meta/html/rendering/replaced-elements/embedded-content-rendering-rules/canvas_without_context_a.html.ini
@@ -1,15 +1,3 @@
 [canvas_without_context_a.html]
   type: reftest
-  expected:
-    if not debug and not stylo and e10s and (os == "win") and (version == "6.1.7601") and (processor == "x86") and (bits == 32): FAIL
-    if not debug and not stylo and not e10s and (os == "win") and (version == "6.1.7601") and (processor == "x86") and (bits == 32): FAIL
-    if debug and not stylo and e10s and (os == "win") and (version == "6.2.9200") and (processor == "x86_64") and (bits == 64): FAIL
-    if debug and not stylo and not e10s and (os == "win") and (version == "6.2.9200") and (processor == "x86_64") and (bits == 64): FAIL
-    if not debug and not stylo and e10s and (os == "win") and (version == "6.2.9200") and (processor == "x86_64") and (bits == 64): FAIL
-    if not debug and not stylo and not e10s and (os == "win") and (version == "6.2.9200") and (processor == "x86_64") and (bits == 64): FAIL
-    if debug and not stylo and not e10s and (os == "win") and (version == "10.0.15063") and (processor == "x86_64") and (bits == 64): FAIL
-    if debug and not stylo and e10s and (os == "win") and (version == "6.1.7601") and (processor == "x86") and (bits == 32): FAIL
-    if not debug and not stylo and e10s and (os == "win") and (version == "10.0.15063") and (processor == "x86_64") and (bits == 64): FAIL
-    if not debug and not stylo and not e10s and (os == "win") and (version == "10.0.15063") and (processor == "x86_64") and (bits == 64): FAIL
-    if debug and not stylo and not e10s and (os == "win") and (version == "6.1.7601") and (processor == "x86") and (bits == 32): FAIL
-    if debug and not stylo and e10s and (os == "win") and (version == "10.0.15063") and (processor == "x86_64") and (bits == 64): FAIL
+  expected: FAIL
deleted file mode 100644
--- a/testing/web-platform/meta/html/semantics/embedded-content/the-iframe-element/iframe-with-base.html.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[iframe-with-base.html]
-  type: reftest
-  expected:
-    if not debug and e10s and (os == "mac") and (version == "OS X 10.10.5") and (processor == "x86_64") and (bits == 64): FAIL
-    if debug and not stylo and e10s and (os == "mac") and (version == "OS X 10.10.5") and (processor == "x86_64") and (bits == 64): FAIL
deleted file mode 100644
--- a/testing/web-platform/meta/html/semantics/embedded-content/the-img-element/document-adopt-base-url.html.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[document-adopt-base-url.html]
-  type: reftest
-  expected:
-    if not debug and not stylo and e10s and (os == "mac") and (version == "OS X 10.10.5") and (processor == "x86_64") and (bits == 64): FAIL
-    if debug and not stylo and e10s and (os == "mac") and (version == "OS X 10.10.5") and (processor == "x86_64") and (bits == 64): FAIL
deleted file mode 100644
--- a/testing/web-platform/meta/html/semantics/grouping-content/the-ol-element/reversed-1a.html.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[reversed-1a.html]
-  type: reftest
-  expected:
-    if not debug and e10s and (os == "mac") and (version == "OS X 10.10.5") and (processor == "x86_64") and (bits == 64): FAIL
-    if debug and not stylo and e10s and (os == "mac") and (version == "OS X 10.10.5") and (processor == "x86_64") and (bits == 64): FAIL
deleted file mode 100644
--- a/testing/web-platform/meta/html/semantics/grouping-content/the-ol-element/reversed-1b.html.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[reversed-1b.html]
-  type: reftest
-  expected:
-    if not debug and not stylo and e10s and (os == "mac") and (version == "OS X 10.10.5") and (processor == "x86_64") and (bits == 64): FAIL
-    if debug and not stylo and e10s and (os == "mac") and (version == "OS X 10.10.5") and (processor == "x86_64") and (bits == 64): FAIL
deleted file mode 100644
--- a/testing/web-platform/meta/html/semantics/grouping-content/the-ol-element/reversed-1c.html.ini
+++ /dev/null
@@ -1,4 +0,0 @@
-[reversed-1c.html]
-  type: reftest
-  expected:
-    if not debug and not stylo and e10s and (os == "mac") and (version == "OS X 10.10.5") and (processor == "x86_64") and (bits == 64): FAIL
deleted file mode 100644
--- a/testing/web-platform/meta/html/semantics/grouping-content/the-ol-element/reversed-1d.html.ini
+++ /dev/null
@@ -1,3 +0,0 @@
-[reversed-1d.html]
-  disabled:
-    if (os == "mac"): https://bugzilla.mozilla.org/show_bug.cgi?id=1374968
--- a/testing/web-platform/meta/html/semantics/text-level-semantics/the-wbr-element/wbr-element.html.ini
+++ b/testing/web-platform/meta/html/semantics/text-level-semantics/the-wbr-element/wbr-element.html.ini
@@ -1,12 +1,3 @@
 [wbr-element.html]
   type: reftest
-  expected:
-    if not debug and e10s and (os == "linux") and (version == "Ubuntu 16.04") and (processor == "x86_64") and (bits == 64): PASS
-    if debug and not e10s and (os == "linux") and (version == "Ubuntu 16.04") and (processor == "x86") and (bits == 32): PASS
-    if not debug and e10s and (os == "linux") and (version == "Ubuntu 16.04") and (processor == "x86") and (bits == 32): PASS
-    if not debug and not e10s and (os == "linux") and (version == "Ubuntu 16.04") and (processor == "x86_64") and (bits == 64): PASS
-    if debug and e10s and (os == "linux") and (version == "Ubuntu 16.04") and (processor == "x86_64") and (bits == 64): PASS
-    if not debug and not e10s and (os == "linux") and (version == "Ubuntu 16.04") and (processor == "x86") and (bits == 32): PASS
-    if debug and e10s and (os == "linux") and (version == "Ubuntu 16.04") and (processor == "x86") and (bits == 32): PASS
-    if debug and not e10s and (os == "linux") and (version == "Ubuntu 16.04") and (processor == "x86_64") and (bits == 64): PASS
-    FAIL
+  expected: FAIL
deleted file mode 100644
--- a/testing/web-platform/meta/mathml/relations/html5-tree/href-click-1.html.ini
+++ /dev/null
@@ -1,22 +0,0 @@
-[href-click-1.html]
-  type: reftest
-  expected:
-    if not debug and not stylo and e10s and (os == "win") and (version == "6.1.7601") and (processor == "x86") and (bits == 32): PASS
-    if not debug and not stylo and not e10s and (os == "win") and (version == "6.1.7601") and (processor == "x86") and (bits == 32): PASS
-    if debug and not stylo and e10s and (os == "win") and (version == "6.2.9200") and (processor == "x86_64") and (bits == 64): PASS
-    if debug and not stylo and not e10s and (os == "win") and (version == "6.2.9200") and (processor == "x86_64") and (bits == 64): PASS
-    if not debug and not stylo and e10s and (os == "win") and (version == "6.2.9200") and (processor == "x86_64") and (bits == 64): PASS
-    if not debug and not stylo and not e10s and (os == "win") and (version == "6.2.9200") and (processor == "x86_64") and (bits == 64): PASS
-    if debug and not stylo and not e10s and (os == "win") and (version == "10.0.15063") and (processor == "x86_64") and (bits == 64): PASS
-    if debug and not stylo and e10s and (os == "win") and (version == "6.1.7601") and (processor == "x86") and (bits == 32): PASS
-    if not debug and not stylo and e10s and (os == "win") and (version == "10.0.15063") and (processor == "x86_64") and (bits == 64): PASS
-    if debug and not stylo and e10s and (os == "win") and (version == "10.0.15063") and (processor == "x86_64") and (bits == 64): PASS
-    if not debug and not stylo and not e10s and (os == "win") and (version == "10.0.15063") and (processor == "x86_64") and (bits == 64): PASS
-    if debug and not stylo and not e10s and (os == "linux") and (version == "Ubuntu 16.04") and (processor == "x86") and (bits == 32): PASS
-    if not debug and not stylo and not e10s and (os == "linux") and (version == "Ubuntu 16.04") and (processor == "x86") and (bits == 32): PASS
-    if not debug and stylo and not e10s and (os == "linux") and (version == "Ubuntu 16.04") and (processor == "x86_64") and (bits == 64): PASS
-    if debug and not stylo and not e10s and (os == "win") and (version == "6.1.7601") and (processor == "x86") and (bits == 32): PASS
-    if debug and stylo and not e10s and (os == "linux") and (version == "Ubuntu 16.04") and (processor == "x86_64") and (bits == 64): PASS
-    if debug and not stylo and not e10s and (os == "linux") and (version == "Ubuntu 16.04") and (processor == "x86_64") and (bits == 64): PASS
-    if not debug and not stylo and not e10s and (os == "linux") and (version == "Ubuntu 16.04") and (processor == "x86_64") and (bits == 64): PASS
-    FAIL
deleted file mode 100644
--- a/testing/web-platform/meta/mathml/relations/html5-tree/href-click-2.html.ini
+++ /dev/null
@@ -1,21 +0,0 @@
-[href-click-2.html]
-  type: reftest
-  expected:
-    if not debug and not stylo and e10s and (os == "win") and (version == "6.1.7601") and (processor == "x86") and (bits == 32): PASS
-    if not debug and not stylo and not e10s and (os == "win") and (version == "6.1.7601") and (processor == "x86") and (bits == 32): PASS
-    if debug and not stylo and e10s and (os == "win") and (version == "6.2.9200") and (processor == "x86_64") and (bits == 64): PASS
-    if debug and not stylo and not e10s and (os == "win") and (version == "6.2.9200") and (processor == "x86_64") and (bits == 64): PASS
-    if not debug and not stylo and e10s and (os == "win") and (version == "6.2.9200") and (processor == "x86_64") and (bits == 64): PASS
-    if not debug and not stylo and not e10s and (os == "win") and (version == "6.2.9200") and (processor == "x86_64") and (bits == 64): PASS
-    if debug and not stylo and not e10s and (os == "win") and (version == "10.0.15063") and (processor == "x86_64") and (bits == 64): PASS
-    if debug and not stylo and e10s and (os == "win") and (version == "6.1.7601") and (processor == "x86") and (bits == 32): PASS
-    if not debug and not stylo and e10s and (os == "win") and (version == "10.0.15063") and (processor == "x86_64") and (bits == 64): PASS
-    if debug and not stylo and e10s and (os == "win") and (version == "10.0.15063") and (processor == "x86_64") and (bits == 64): PASS
-    if not debug and not stylo and not e10s and (os == "win") and (version == "10.0.15063") and (processor == "x86_64") and (bits == 64): PASS
-    if debug and not stylo and not e10s and (os == "linux") and (version == "Ubuntu 16.04") and (processor == "x86") and (bits == 32): PASS
-    if not debug and not stylo and not e10s and (os == "linux") and (version == "Ubuntu 16.04") and (processor == "x86") and (bits == 32): PASS
-    if not debug and stylo and not e10s and (os == "linux") and (version == "Ubuntu 16.04") and (processor == "x86_64") and (bits == 64): PASS
-    if debug and not stylo and not e10s and (os == "win") and (version == "6.1.7601") and (processor == "x86") and (bits == 32): PASS
-    if debug and stylo and not e10s and (os == "linux") and (version == "Ubuntu 16.04") and (processor == "x86_64") and (bits == 64): PASS
-    if not debug and not stylo and not e10s and (os == "linux") and (version == "Ubuntu 16.04") and (processor == "x86_64") and (bits == 64): PASS
-    FAIL
--- a/testing/web-platform/meta/quirks-mode/historical/list-item-bullet-size.html.ini
+++ b/testing/web-platform/meta/quirks-mode/historical/list-item-bullet-size.html.ini
@@ -1,15 +1,3 @@
 [list-item-bullet-size.html]
   type: reftest
-  expected:
-    if not debug and not stylo and e10s and (os == "win") and (version == "6.1.7601") and (processor == "x86") and (bits == 32): FAIL
-    if not debug and not stylo and not e10s and (os == "win") and (version == "6.1.7601") and (processor == "x86") and (bits == 32): FAIL
-    if debug and not stylo and e10s and (os == "win") and (version == "6.2.9200") and (processor == "x86_64") and (bits == 64): FAIL
-    if debug and not stylo and not e10s and (os == "win") and (version == "6.2.9200") and (processor == "x86_64") and (bits == 64): FAIL
-    if not debug and not stylo and e10s and (os == "win") and (version == "6.2.9200") and (processor == "x86_64") and (bits == 64): FAIL
-    if not debug and not stylo and not e10s and (os == "win") and (version == "6.2.9200") and (processor == "x86_64") and (bits == 64): FAIL
-    if debug and not stylo and not e10s and (os == "win") and (version == "10.0.15063") and (processor == "x86_64") and (bits == 64): FAIL
-    if debug and not stylo and e10s and (os == "win") and (version == "6.1.7601") and (processor == "x86") and (bits == 32): FAIL
-    if not debug and not stylo and e10s and (os == "win") and (version == "10.0.15063") and (processor == "x86_64") and (bits == 64): FAIL
-    if not debug and not stylo and not e10s and (os == "win") and (version == "10.0.15063") and (processor == "x86_64") and (bits == 64): FAIL
-    if debug and not stylo and not e10s and (os == "win") and (version == "6.1.7601") and (processor == "x86") and (bits == 32): FAIL
-    if debug and not stylo and e10s and (os == "win") and (version == "10.0.15063") and (processor == "x86_64") and (bits == 64): FAIL
+  expected: FAIL
--- a/testing/web-platform/meta/svg/shapes/rect-01.svg.ini
+++ b/testing/web-platform/meta/svg/shapes/rect-01.svg.ini
@@ -1,15 +1,3 @@
 [rect-01.svg]
   type: reftest
-  expected:
-    if not debug and not stylo and e10s and (os == "win") and (version == "6.1.7601") and (processor == "x86") and (bits == 32): FAIL
-    if not debug and not stylo and not e10s and (os == "win") and (version == "6.1.7601") and (processor == "x86") and (bits == 32): FAIL
-    if debug and not stylo and e10s and (os == "win") and (version == "6.2.9200") and (processor == "x86_64") and (bits == 64): FAIL
-    if debug and not stylo and not e10s and (os == "win") and (version == "6.2.9200") and (processor == "x86_64") and (bits == 64): FAIL
-    if not debug and not stylo and e10s and (os == "win") and (version == "6.2.9200") and (processor == "x86_64") and (bits == 64): FAIL
-    if not debug and not stylo and not e10s and (os == "win") and (version == "6.2.9200") and (processor == "x86_64") and (bits == 64): FAIL
-    if debug and not stylo and not e10s and (os == "win") and (version == "10.0.15063") and (processor == "x86_64") and (bits == 64): FAIL
-    if debug and not stylo and e10s and (os == "win") and (version == "6.1.7601") and (processor == "x86") and (bits == 32): FAIL
-    if not debug and not stylo and e10s and (os == "win") and (version == "10.0.15063") and (processor == "x86_64") and (bits == 64): FAIL
-    if not debug and not stylo and not e10s and (os == "win") and (version == "10.0.15063") and (processor == "x86_64") and (bits == 64): FAIL
-    if debug and not stylo and not e10s and (os == "win") and (version == "6.1.7601") and (processor == "x86") and (bits == 32): FAIL
-    if debug and not stylo and e10s and (os == "win") and (version == "10.0.15063") and (processor == "x86_64") and (bits == 64): FAIL
+  expected: FAIL
--- a/testing/web-platform/meta/svg/shapes/rect-02.svg.ini
+++ b/testing/web-platform/meta/svg/shapes/rect-02.svg.ini
@@ -1,15 +1,3 @@
 [rect-02.svg]
   type: reftest
-  expected:
-    if not debug and not stylo and e10s and (os == "win") and (version == "6.1.7601") and (processor == "x86") and (bits == 32): FAIL
-    if not debug and not stylo and not e10s and (os == "win") and (version == "6.1.7601") and (processor == "x86") and (bits == 32): FAIL
-    if debug and not stylo and e10s and (os == "win") and (version == "6.2.9200") and (processor == "x86_64") and (bits == 64): FAIL
-    if debug and not stylo and not e10s and (os == "win") and (version == "6.2.9200") and (processor == "x86_64") and (bits == 64): FAIL
-    if not debug and not stylo and e10s and (os == "win") and (version == "6.2.9200") and (processor == "x86_64") and (bits == 64): FAIL
-    if not debug and not stylo and not e10s and (os == "win") and (version == "6.2.9200") and (processor == "x86_64") and (bits == 64): FAIL
-    if debug and not stylo and not e10s and (os == "win") and (version == "10.0.15063") and (processor == "x86_64") and (bits == 64): FAIL
-    if debug and not stylo and e10s and (os == "win") and (version == "6.1.7601") and (processor == "x86") and (bits == 32): FAIL
-    if not debug and not stylo and e10s and (os == "win") and (version == "10.0.15063") and (processor == "x86_64") and (bits == 64): FAIL
-    if not debug and not stylo and not e10s and (os == "win") and (version == "10.0.15063") and (processor == "x86_64") and (bits == 64): FAIL
-    if debug and not stylo and not e10s and (os == "win") and (version == "6.1.7601") and (processor == "x86") and (bits == 32): FAIL
-    if debug and not stylo and e10s and (os == "win") and (version == "10.0.15063") and (processor == "x86_64") and (bits == 64): FAIL
+  expected: FAIL
deleted file mode 100644
--- a/testing/web-platform/meta/webvtt/rendering/cues-with-video/processing-model/basic.html.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[basic.html]
-  type: reftest
-  expected:
-    if not debug and e10s and (os == "mac") and (version == "OS X 10.10.5") and (processor == "x86_64") and (bits == 64): FAIL
-    if debug and not stylo and e10s and (os == "mac") and (version == "OS X 10.10.5") and (processor == "x86_64") and (bits == 64): FAIL
deleted file mode 100644
--- a/testing/web-platform/meta/webvtt/rendering/cues-with-video/processing-model/bidi/bidi_ruby.html.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[bidi_ruby.html]
-  type: reftest
-  expected:
-    if not debug and not stylo and e10s and (os == "mac") and (version == "OS X 10.10.5") and (processor == "x86_64") and (bits == 64): FAIL
-    if debug and not stylo and e10s and (os == "mac") and (version == "OS X 10.10.5") and (processor == "x86_64") and (bits == 64): FAIL
deleted file mode 100644
--- a/testing/web-platform/meta/webvtt/rendering/cues-with-video/processing-model/bidi/u0041_first.html.ini
+++ /dev/null
@@ -1,4 +0,0 @@
-[u0041_first.html]
-  type: reftest
-  expected:
-    if not debug and not stylo and e10s and (os == "mac") and (version == "OS X 10.10.5") and (processor == "x86_64") and (bits == 64): FAIL
deleted file mode 100644
--- a/testing/web-platform/meta/webvtt/rendering/cues-with-video/processing-model/bidi/u06E9_no_strong_dir.html.ini
+++ /dev/null
@@ -1,3 +0,0 @@
-[u06E9_no_strong_dir.html]
-  disabled:
-    if (os == "mac"): https://bugzilla.mozilla.org/show_bug.cgi?id=1374968
deleted file mode 100644
--- a/testing/web-platform/meta/webvtt/rendering/cues-with-video/processing-model/selectors/default_styles/italic_object_default_font-style.html.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[italic_object_default_font-style.html]
-  type: reftest
-  expected:
-    if not debug and e10s and (os == "mac") and (version == "OS X 10.10.5") and (processor == "x86_64") and (bits == 64): FAIL
-    if debug and not stylo and e10s and (os == "mac") and (version == "OS X 10.10.5") and (processor == "x86_64") and (bits == 64): FAIL
deleted file mode 100644
--- a/testing/web-platform/meta/webvtt/rendering/cues-with-video/processing-model/selectors/default_styles/underline_object_default_font-style.html.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[underline_object_default_font-style.html]
-  type: reftest
-  expected:
-    if not debug and not stylo and e10s and (os == "mac") and (version == "OS X 10.10.5") and (processor == "x86_64") and (bits == 64): FAIL
-    if debug and not stylo and e10s and (os == "mac") and (version == "OS X 10.10.5") and (processor == "x86_64") and (bits == 64): FAIL
--- a/testing/web-platform/meta/webvtt/rendering/cues-with-video/processing-model/too_many_cues.html.ini
+++ b/testing/web-platform/meta/webvtt/rendering/cues-with-video/processing-model/too_many_cues.html.ini
@@ -1,6 +1,3 @@
 [too_many_cues.html]
   type: reftest
-  expected:
-    if not debug and e10s and (os == "mac") and (version == "OS X 10.10.5") and (processor == "x86_64") and (bits == 64): PASS
-    if debug and not stylo and e10s and (os == "mac") and (version == "OS X 10.10.5") and (processor == "x86_64") and (bits == 64): PASS
-    FAIL
+  expected: FAIL
deleted file mode 100644
index ac81cb03165ab831a36abb59145ff7a2f5675fb9..0000000000000000000000000000000000000000
GIT binary patch
literal 0
Hc$@<O00001
--- a/testing/web-platform/tests/tools/wptrunner/wptrunner/browsers/firefox.py
+++ b/testing/web-platform/tests/tools/wptrunner/wptrunner/browsers/firefox.py
@@ -83,19 +83,16 @@ def browser_kwargs(test_type, run_info_d
 def executor_kwargs(test_type, server_config, cache_manager, run_info_data,
                     **kwargs):
     executor_kwargs = base_executor_kwargs(test_type, server_config,
                                            cache_manager, **kwargs)
     executor_kwargs["close_after_done"] = test_type != "reftest"
     executor_kwargs["timeout_multiplier"] = get_timeout_multiplier(test_type,
                                                                    run_info_data,
                                                                    **kwargs)
-    if test_type == "reftest":
-        executor_kwargs["reftest_internal"] = kwargs["reftest_internal"]
-        executor_kwargs["reftest_screenshot"] = kwargs["reftest_screenshot"]
     if test_type == "wdspec":
         executor_kwargs["binary"] = kwargs["binary"]
         executor_kwargs["webdriver_binary"] = kwargs.get("webdriver_binary")
         executor_kwargs["webdriver_args"] = kwargs.get("webdriver_args")
         fxOptions = {}
         if kwargs["binary"]:
             fxOptions["binary"] = kwargs["binary"]
         if kwargs["binary_args"]:
@@ -182,19 +179,17 @@ class FirefoxBrowser(Browser):
         preferences = self.load_prefs()
 
         self.profile = FirefoxProfile(locations=locations,
                                       preferences=preferences)
         self.profile.set_preferences({"marionette.port": self.marionette_port,
                                       "dom.disable_open_during_load": False,
                                       "network.dns.localDomains": ",".join(hostnames),
                                       "network.proxy.type": 0,
-                                      "places.history.enabled": False,
-                                      "dom.send_after_paint_to_content": True,
-                                      "layout.interruptible-reflow.enabled": False})
+                                      "places.history.enabled": False})
         if self.e10s:
             self.profile.set_preferences({"browser.tabs.remote.autostart": True})
 
         if self.leak_check and kwargs.get("check_leaks", True):
             self.leak_report_file = os.path.join(self.profile.profile, "runtests_leaks.log")
             if os.path.exists(self.leak_report_file):
                 os.remove(self.leak_report_file)
             env["XPCOM_MEM_BLOAT_LOG"] = self.leak_report_file
--- a/testing/web-platform/tests/tools/wptrunner/wptrunner/executors/base.py
+++ b/testing/web-platform/tests/tools/wptrunner/wptrunner/executors/base.py
@@ -210,22 +210,16 @@ class RefTestImplementation(object):
         self.executor = executor
         # Cache of url:(screenshot hash, screenshot). Typically the
         # screenshot is None, but we set this value if a test fails
         # and the screenshot was taken from the cache so that we may
         # retrieve the screenshot from the cache directly in the future
         self.screenshot_cache = self.executor.screenshot_cache
         self.message = None
 
-    def setup(self):
-        pass
-
-    def teardown(self):
-        pass
-
     @property
     def logger(self):
         return self.executor.logger
 
     def get_hash(self, test, viewport_size, dpi):
         timeout = test.timeout * self.timeout_multiplier
         key = (test.url, viewport_size, dpi)
 
--- a/testing/web-platform/tests/tools/wptrunner/wptrunner/executors/executormarionette.py
+++ b/testing/web-platform/tests/tools/wptrunner/wptrunner/executors/executormarionette.py
@@ -462,71 +462,53 @@ class MarionetteTestharnessExecutor(Test
 
         rv = marionette.execute_async_script(script, new_sandbox=False)
         return rv
 
 
 class MarionetteRefTestExecutor(RefTestExecutor):
     def __init__(self, browser, server_config, timeout_multiplier=1,
                  screenshot_cache=None, close_after_done=True,
-                 debug_info=None, reftest_internal=False,
-                 reftest_screenshot="unexpected",
-                 queue_metadata=None, **kwargs):
+                 debug_info=None, **kwargs):
+
         """Marionette-based executor for reftests"""
         RefTestExecutor.__init__(self,
                                  browser,
                                  server_config,
                                  screenshot_cache=screenshot_cache,
                                  timeout_multiplier=timeout_multiplier,
                                  debug_info=debug_info)
         self.protocol = MarionetteProtocol(self, browser)
-        self.implementation = (InternalRefTestImplementation
-                               if reftest_internal
-                               else RefTestImplementation)(self)
-        self.implementation_kwargs = ({"screenshot": reftest_screenshot} if
-                                      reftest_internal else {})
-
+        self.implementation = RefTestImplementation(self)
         self.close_after_done = close_after_done
         self.has_window = False
         self.original_pref_values = {}
-        self.queue_metadata = queue_metadata
 
         with open(os.path.join(here, "reftest.js")) as f:
             self.script = f.read()
         with open(os.path.join(here, "reftest-wait.js")) as f:
             self.wait_script = f.read()
 
-    def setup(self, runner):
-        super(self.__class__, self).setup(runner)
-        self.implementation.setup(**self.implementation_kwargs)
-
-    def teardown(self):
-        self.implementation.teardown()
-        handle = self.protocol.marionette.window_handles[0]
-        self.protocol.marionette.switch_to_window(handle)
-        super(self.__class__, self).teardown()
-
     def is_alive(self):
         return self.protocol.is_alive
 
     def on_environment_change(self, new_environment):
         self.protocol.on_environment_change(self.last_environment, new_environment)
 
     def do_test(self, test):
-        if not isinstance(self.implementation, InternalRefTestImplementation):
-            if self.close_after_done and self.has_window:
-                self.protocol.marionette.close()
-                self.protocol.marionette.switch_to_window(
-                    self.protocol.marionette.window_handles[-1])
-                self.has_window = False
+        if self.close_after_done and self.has_window:
+            self.protocol.marionette.close()
+            self.protocol.marionette.switch_to_window(
+                self.protocol.marionette.window_handles[-1])
+            self.has_window = False
 
-            if not self.has_window:
-                self.protocol.marionette.execute_script(self.script)
-                self.protocol.marionette.switch_to_window(self.protocol.marionette.window_handles[-1])
-                self.has_window = True
+        if not self.has_window:
+            self.protocol.marionette.execute_script(self.script)
+            self.protocol.marionette.switch_to_window(self.protocol.marionette.window_handles[-1])
+            self.has_window = True
 
         result = self.implementation.run_test(test)
         return self.convert_result(test, result)
 
     def screenshot(self, test, viewport_size, dpi):
         # https://github.com/w3c/wptrunner/issues/166
         assert viewport_size is None
         assert dpi is None
@@ -549,59 +531,16 @@ class MarionetteRefTestExecutor(RefTestE
         screenshot = marionette.screenshot(full=False)
         # strip off the data:img/png, part of the url
         if screenshot.startswith("data:image/png;base64,"):
             screenshot = screenshot.split(",", 1)[1]
 
         return screenshot
 
 
-class InternalRefTestImplementation(object):
-    def __init__(self, executor):
-        self.timeout_multiplier = executor.timeout_multiplier
-        self.executor = executor
-
-    @property
-    def logger(self):
-        return self.executor.logger
-
-    def setup(self, screenshot="unexpected"):
-        data = {"screenshot": screenshot}
-        if self.executor.queue_metadata is not None:
-            data["urlCount"] = {urlparse.urljoin(self.executor.server_url(key[0]), key[1]):value
-                                for key, value in self.executor.queue_metadata.get("url_count", {}).iteritems()
-                                if value > 1}
-        self.executor.protocol.marionette.set_context(self.executor.protocol.marionette.CONTEXT_CHROME)
-        self.executor.protocol.marionette._send_message("reftest:setup", data)
-
-    def run_test(self, test):
-        viewport_size = test.viewport_size
-        dpi = test.dpi
-
-        references = self.get_references(test)
-        rv = self.executor.protocol.marionette._send_message("reftest:run",
-                                                             {"test": self.executor.test_url(test),
-                                                              "references": references,
-                                                              "expected": test.expected(),
-                                                              "timeout": test.timeout * 1000})["value"]
-        return rv
-
-    def get_references(self, node):
-        rv = []
-        for item, relation in node.references:
-            rv.append([self.executor.test_url(item), self.get_references(item), relation])
-        return rv
-
-    def teardown(self):
-        try:
-            self.executor.protocol.marionette._send_message("reftest:teardown", {})
-            self.executor.protocol.marionette.set_context(self.executor.protocol.marionette.CONTEXT_CONTENT)
-        except socket.error:
-            pass
-
 class WdspecRun(object):
     def __init__(self, func, session, path, timeout):
         self.func = func
         self.result = (None, None)
         self.session = session
         self.path = path
         self.timeout = timeout
         self.result_flag = threading.Event()
@@ -635,17 +574,17 @@ class WdspecRun(object):
             self.result = False, ("ERROR", message)
         finally:
             self.result_flag.set()
 
 
 class MarionetteWdspecExecutor(WdspecExecutor):
     def __init__(self, browser, server_config, webdriver_binary,
                  timeout_multiplier=1, close_after_done=True, debug_info=None,
-                 capabilities=None, webdriver_args=None, binary=None, **kwargs):
+                 capabilities=None, webdriver_args=None, binary=None):
         self.do_delayed_imports()
         WdspecExecutor.__init__(self, browser, server_config,
                                 timeout_multiplier=timeout_multiplier,
                                 debug_info=debug_info)
         self.webdriver_binary = webdriver_binary
         self.webdriver_args = webdriver_args + ["--binary", binary]
         self.capabilities = capabilities
         self.protocol = RemoteMarionetteProtocol(self, browser)
--- a/testing/web-platform/tests/tools/wptrunner/wptrunner/testloader.py
+++ b/testing/web-platform/tests/tools/wptrunner/wptrunner/testloader.py
@@ -558,79 +558,80 @@ class TestLoader(object):
                 group = test.url.split("/")[1]
                 groups.add(group)
 
         return groups
 
 
 class TestSource(object):
     __metaclass__ = ABCMeta
-    def __init__(self, test_queue):
-        self.test_queue = test_queue
-        self.current_queue = None
-        self.current_metadata = None
 
     @abstractmethod
-    def queue_tests(self, test_queue, test_type, tests, **kwargs):
+    def queue_tests(self, test_queue):
+        pass
+
+    @abstractmethod
+    def requeue_test(self, test):
         pass
 
     def __enter__(self):
         return self
 
-    def get_queue(self):
-        if not self.current_queue or len(self.current_queue) == 0:
-            try:
-                self.current_queue, self.current_metadata = self.test_queue.get(block=False)
-            except Empty:
-                return None, None
-        return self.current_queue, self.current_metadata
-
     def __exit__(self, *args, **kwargs):
         pass
 
 
-class GroupedSource(TestSource):
-    @classmethod
-    def new_group(cls, state, test, **kwargs):
-        raise NotImplementedError
+class SingleTestSource(TestSource):
+    def __init__(self, test_queue):
+        self.test_queue = test_queue
 
     @classmethod
-    def queue_tests(cls, test_queue, test_type, tests, **kwargs):
-        state = {}
+    def queue_tests(cls, test_queue, test_type, tests):
+        for test in tests[test_type]:
+            test_queue.put(test)
+
+    def get_queue(self):
+        if self.test_queue.empty():
+            return None
+        return self.test_queue
+
+    def requeue_test(self, test):
+        self.test_queue.put(test)
+
+class PathGroupedSource(TestSource):
+    def __init__(self, test_queue):
+        self.test_queue = test_queue
+        self.current_queue = None
+
+    @classmethod
+    def queue_tests(cls, test_queue, test_type, tests, depth=None):
+        if depth is True:
+            depth = None
+
+        prev_path = None
         group = None
 
         for test in tests[test_type]:
-            if cls.new_group(state, test, **kwargs):
-                group = deque([])
-                metadata = {}
-                test_queue.put((group, metadata))
+            path = urlparse.urlsplit(test.url).path.split("/")[1:-1][:depth]
+            if path != prev_path:
+                group = []
+                test_queue.put(group)
+                prev_path = path
 
             group.append(test)
-            test.update_metadata(metadata)
-
 
-class SingleTestSource(TestSource):
-    @classmethod
-    def queue_tests(cls, test_queue, test_type, tests, **kwargs):
-        processes = kwargs["processes"]
-        queues = [deque([]) for _ in xrange(processes)]
-        metadatas = [{} for _ in xrange(processes)]
-        for test in tests[test_type]:
-            idx = hash(test.id) % processes
-            group = queues[idx]
-            metadata = metadatas[idx]
-            group.append(test)
-            test.update_metadata(metadata)
+    def get_queue(self):
+        if not self.current_queue or self.current_queue.empty():
+            try:
+                data = self.test_queue.get(block=True, timeout=1)
+                self.current_queue = Queue()
+                for item in data:
+                    self.current_queue.put(item)
+            except Empty:
+                return None
+        return self.current_queue
 
-        for item in zip(queues, metadatas):
-            test_queue.put(item)
-
+    def requeue_test(self, test):
+        self.current_queue.put(test)
 
-class PathGroupedSource(GroupedSource):
-    @classmethod
-    def new_group(cls, state, test, **kwargs):
-        depth = kwargs.get("depth")
-        if depth is True:
-            depth = None
-        path = urlparse.urlsplit(test.url).path.split("/")[1:-1][:depth]
-        rv = path != state.get("prev_path")
-        state["prev_path"] = path
-        return rv
+    def __exit__(self, *args, **kwargs):
+        if self.current_queue:
+            self.current_queue.close()
--- a/testing/web-platform/tests/tools/wptrunner/wptrunner/testrunner.py
+++ b/testing/web-platform/tests/tools/wptrunner/wptrunner/testrunner.py
@@ -142,16 +142,18 @@ manager_count = 0
 
 def next_manager_number():
     global manager_count
     local = manager_count = manager_count + 1
     return local
 
 
 class BrowserManager(object):
+    init_lock = threading.Lock()
+
     def __init__(self, logger, browser, command_queue, no_timeout=False):
         self.logger = logger
         self.browser = browser
         self.no_timeout = no_timeout
         self.browser_settings = None
         self.last_test = None
 
         self.started = False
@@ -166,41 +168,44 @@ class BrowserManager(object):
         self.browser_settings = browser_settings
         self.last_test = test
         return restart_required
 
     def init(self):
         """Launch the browser that is being tested,
         and the TestRunner process that will run the tests."""
         # It seems that this lock is helpful to prevent some race that otherwise
-        # sometimes stops the spawned processes initialising correctly, and
+        # sometimes stops the spawned processes initalising correctly, and
         # leaves this thread hung
         if self.init_timer is not None:
             self.init_timer.cancel()
 
         self.logger.debug("Init called, starting browser and runner")
 
-        if not self.no_timeout:
-            self.init_timer = threading.Timer(self.browser.init_timeout,
-                                              self.init_timeout)
-        try:
-            if self.init_timer is not None:
-                self.init_timer.start()
-            self.logger.debug("Starting browser with settings %r" % self.browser_settings)
-            self.browser.start(**self.browser_settings)
-            self.browser_pid = self.browser.pid()
-        except:
-            self.logger.warning("Failure during init %s" % traceback.format_exc())
-            if self.init_timer is not None:
-                self.init_timer.cancel()
-            self.logger.error(traceback.format_exc())
-            succeeded = False
-        else:
-            succeeded = True
-            self.started = True
+        with self.init_lock:
+            # Guard against problems initialising the browser or the browser
+            # remote control method
+            if not self.no_timeout:
+                self.init_timer = threading.Timer(self.browser.init_timeout,
+                                                  self.init_timeout)
+            try:
+                if self.init_timer is not None:
+                    self.init_timer.start()
+                self.logger.debug("Starting browser with settings %r" % self.browser_settings)
+                self.browser.start(**self.browser_settings)
+                self.browser_pid = self.browser.pid()
+            except:
+                self.logger.warning("Failure during init %s" % traceback.format_exc())
+                if self.init_timer is not None:
+                    self.init_timer.cancel()
+                self.logger.error(traceback.format_exc())
+                succeeded = False
+            else:
+                succeeded = True
+                self.started = True
 
         return succeeded
 
     def send_message(self, command, *args):
         self.command_queue.put((command, args))
 
     def init_timeout(self):
         # This is called from a seperate thread, so we send a message to the
@@ -227,28 +232,30 @@ class BrowserManager(object):
         self.browser.log_crash(process=self.browser_pid, test=test_id)
 
     def is_alive(self):
         return self.browser.is_alive()
 
 
 class _RunnerManagerState(object):
     before_init = namedtuple("before_init", [])
-    initializing = namedtuple("initializing_browser",
-                             ["test", "test_queue", "queue_metadata", "failure_count"])
+    initalizing = namedtuple("initalizing_browser",
+                             ["test", "test_queue", "failure_count"])
     running = namedtuple("running", ["test", "test_queue"])
-    restarting = namedtuple("restarting", ["test", "test_queue", "queue_metadata"])
+    restarting = namedtuple("restarting", ["test", "test_queue"])
     error = namedtuple("error", [])
     stop = namedtuple("stop", [])
 
 
 RunnerManagerState = _RunnerManagerState()
 
 
 class TestRunnerManager(threading.Thread):
+    init_lock = threading.Lock()
+
     def __init__(self, suite_name, tests, test_source_cls, browser_cls, browser_kwargs,
                  executor_cls, executor_kwargs, stop_flag, pause_after_test=False,
                  pause_on_unexpected=False, restart_on_unexpected=True, debug_info=None):
         """Thread that owns a single TestRunner process and any processes required
         by the TestRunner (e.g. the Firefox binary).
 
         TestRunnerManagers are responsible for launching the browser process and the
         runner process, and for logging the test progress. The actual test running
@@ -317,17 +324,17 @@ class TestRunnerManager(threading.Thread
         with self.browser_cls(self.logger, **self.browser_kwargs) as browser, self.test_source_cls(self.tests) as test_source:
             self.browser = BrowserManager(self.logger,
                                           browser,
                                           self.command_queue,
                                           no_timeout=self.debug_info is not None)
             self.test_source = test_source
             dispatch = {
                 RunnerManagerState.before_init: self.start_init,
-                RunnerManagerState.initializing: self.init,
+                RunnerManagerState.initalizing: self.init,
                 RunnerManagerState.running: self.run_test,
                 RunnerManagerState.restarting: self.restart_runner
             }
 
             self.state = RunnerManagerState.before_init()
             end_states = (RunnerManagerState.stop,
                           RunnerManagerState.error)
 
@@ -362,17 +369,17 @@ class TestRunnerManager(threading.Thread
                 clean = isinstance(self.state, RunnerManagerState.stop)
                 self.stop_runner(force=not clean)
                 self.teardown()
         self.logger.debug("TestRunnerManager main loop terminated")
 
     def wait_event(self):
         dispatch = {
             RunnerManagerState.before_init: {},
-            RunnerManagerState.initializing:
+            RunnerManagerState.initalizing:
             {
                 "init_succeeded": self.init_succeeded,
                 "init_failed": self.init_failed,
             },
             RunnerManagerState.running:
             {
                 "test_ended": self.test_ended,
                 "wait_finished": self.wait_finished,
@@ -425,47 +432,45 @@ class TestRunnerManager(threading.Thread
                 return
             return f(*data)
 
 
     def should_stop(self):
         return self.child_stop_flag.is_set() or self.parent_stop_flag.is_set()
 
     def start_init(self):
-        test, test_queue, queue_metadata = self.get_next_test()
+        test, test_queue = self.get_next_test()
         if test is None:
             return RunnerManagerState.stop()
         else:
-            return RunnerManagerState.initializing(test, test_queue, queue_metadata, 0)
+            return RunnerManagerState.initalizing(test, test_queue, 0)
 
     def init(self):
-        assert isinstance(self.state, RunnerManagerState.initializing)
+        assert isinstance(self.state, RunnerManagerState.initalizing)
         if self.state.failure_count > self.max_restarts:
             self.logger.error("Max restarts exceeded")
             return RunnerManagerState.error()
 
         self.browser.update_settings(self.state.test)
 
         result = self.browser.init()
         if result is Stop:
             return RunnerManagerState.error()
         elif not result:
-            return RunnerManagerState.initializing(self.state.test,
-                                                   self.state.test_queue,
-                                                   self.state.queue_metadata,
-                                                   self.state.failure_count + 1)
+            return RunnerManagerState.initalizing(self.state.test,
+                                                  self.state.test_queue,
+                                                  self.state.failure_count + 1)
         else:
-            self.executor_kwargs["queue_metadata"] = self.state.queue_metadata
             self.start_test_runner()
 
     def start_test_runner(self):
         # Note that we need to be careful to start the browser before the
         # test runner to ensure that any state set when the browser is started
         # can be passed in to the test runner.
-        assert isinstance(self.state, RunnerManagerState.initializing)
+        assert isinstance(self.state, RunnerManagerState.initalizing)
         assert self.command_queue is not None
         assert self.remote_queue is not None
         self.logger.info("Starting runner")
         executor_browser_cls, executor_browser_kwargs = self.browser.browser.executor_browser()
 
         args = (self.remote_queue,
                 self.command_queue,
                 self.executor_cls,
@@ -476,53 +481,53 @@ class TestRunnerManager(threading.Thread
         self.test_runner_proc = Process(target=start_runner,
                                         args=args,
                                         name="Thread-TestRunner-%i" % self.manager_number)
         self.test_runner_proc.start()
         self.logger.debug("Test runner started")
         # Now we wait for either an init_succeeded event or an init_failed event
 
     def init_succeeded(self):
-        assert isinstance(self.state, RunnerManagerState.initializing)
+        assert isinstance(self.state, RunnerManagerState.initalizing)
         self.browser.after_init()
         return RunnerManagerState.running(self.state.test,
                                           self.state.test_queue)
 
     def init_failed(self):
-        assert isinstance(self.state, RunnerManagerState.initializing)
+        assert isinstance(self.state, RunnerManagerState.initalizing)
         self.browser.after_init()
         self.stop_runner(force=True)
-        return RunnerManagerState.initializing(self.state.test,
-                                               self.state.test_queue,
-                                               self.state.queue_metadata,
-                                               self.state.failure_count + 1)
+        return RunnerManagerState.initalizing(self.state.test,
+                                              self.state.test_queue,
+                                              self.state.failure_count + 1)
 
     def get_next_test(self, test_queue=None):
         test = None
         while test is None:
             if test_queue is None:
-                test_queue, queue_metadata = self.test_source.get_queue()
+                test_queue = self.test_source.get_queue()
                 if test_queue is None:
                     self.logger.info("No more tests")
-                    return None, None, None
-                if len(test_queue) == 0:
-                    test_queue, queue_metadata = None, None
-                else:
-                    test = test_queue.popleft()
-        return test, test_queue, queue_metadata
+                    return None, None
+            try:
+                # Need to block here just to allow for contention with other processes
+                test = test_queue.get(block=True, timeout=2)
+            except Empty:
+                if test_queue.empty():
+                    test_queue = None
+        return test, test_queue
 
     def run_test(self):
         assert isinstance(self.state, RunnerManagerState.running)
         assert self.state.test is not None
 
         if self.browser.update_settings(self.state.test):
             self.logger.info("Restarting browser for new test environment")
             return RunnerManagerState.restarting(self.state.test,
-                                                 self.state.test_queue,
-                                                 self.state.queue_metadata)
+                                                 self.state.test_queue)
 
         self.logger.test_start(self.state.test.id)
         self.send_message("run_test", self.state.test)
 
     def test_ended(self, test, results):
         """Handle the end of a test.
 
         Output the result of each subtest, and the result of the overall
@@ -585,32 +590,32 @@ class TestRunnerManager(threading.Thread
         # The browser should be stopped already, but this ensures we do any post-stop
         # processing
         self.logger.debug("Wait finished")
 
         return self.after_test_end(True)
 
     def after_test_end(self, restart):
         assert isinstance(self.state, RunnerManagerState.running)
-        test, test_queue, queue_metadata = self.get_next_test()
+        test, test_queue = self.get_next_test()
         if test is None:
             return RunnerManagerState.stop()
         if test_queue != self.state.test_queue:
             # We are starting a new group of tests, so force a restart
             restart = True
         if restart:
-            return RunnerManagerState.restarting(test, test_queue, queue_metadata)
+            return RunnerManagerState.restarting(test, test_queue)
         else:
             return RunnerManagerState.running(test, test_queue)
 
     def restart_runner(self):
         """Stop and restart the TestRunner"""
         assert isinstance(self.state, RunnerManagerState.restarting)
         self.stop_runner()
-        return RunnerManagerState.initializing(self.state.test, self.state.test_queue, self.state.queue_metadata, 0)
+        return RunnerManagerState.initalizing(self.state.test, self.state.test_queue, 0)
 
     def log(self, action, kwargs):
         getattr(self.logger, action)(**kwargs)
 
     def error(self, message):
         self.logger.error(message)
         self.restart_runner()
 
--- a/testing/web-platform/tests/tools/wptrunner/wptrunner/wptcommandline.py
+++ b/testing/web-platform/tests/tools/wptrunner/wptrunner/wptcommandline.py
@@ -176,23 +176,16 @@ scheme host and port.""")
                              help="Path to directory containing assertion stack fixing scripts")
     gecko_group.add_argument("--setpref", dest="extra_prefs", action='append',
                              default=[], metavar="PREF=VALUE",
                              help="Defines an extra user preference (overrides those in prefs_root)")
     gecko_group.add_argument("--leak-check", dest="leak_check", action="store_true",
                              help="Enable leak checking")
     gecko_group.add_argument("--stylo-threads", action="store", type=int, default=1,
                              help="Number of parallel threads to use for stylo")
-    gecko_group.add_argument("--reftest-internal", dest="reftest_internal", action="store_true",
-                             default=None, help="Enable reftest runner implemented inside Marionette")
-    gecko_group.add_argument("--reftest-external", dest="reftest_internal", action="store_false",
-                             help="Disable reftest runner implemented inside Marionette")
-    gecko_group.add_argument("--reftest-screenshot", dest="reftest_screenshot", action="store",
-                             choices=["always", "fail", "unexpected"], default="unexpected",
-                             help="With --reftest-internal, when to take a screenshot")
 
     servo_group = parser.add_argument_group("Servo-specific")
     servo_group.add_argument("--user-stylesheet",
                              default=[], action="append", dest="user_stylesheets",
                              help="Inject a user CSS stylesheet into every test.")
 
     sauce_group = parser.add_argument_group("Sauce Labs-specific")
     sauce_group.add_argument("--sauce-browser", dest="sauce_browser",
@@ -388,20 +381,16 @@ def check_args(kwargs):
     if kwargs['extra_prefs']:
         missing = any('=' not in prefarg for prefarg in kwargs['extra_prefs'])
         if missing:
             print >> sys.stderr, "Preferences via --setpref must be in key=value format"
             sys.exit(1)
         kwargs['extra_prefs'] = [tuple(prefarg.split('=', 1)) for prefarg in
                                  kwargs['extra_prefs']]
 
-    if kwargs["reftest_internal"] is None:
-        # Default to the internal reftest implementation on Linux and OSX
-        kwargs["reftest_internal"] = sys.platform.startswith("linux") or sys.platform.startswith("darwin")
-
     return kwargs
 
 
 def check_args_update(kwargs):
     set_from_config(kwargs)
 
     if kwargs["product"] is None:
         kwargs["product"] = "firefox"
--- a/testing/web-platform/tests/tools/wptrunner/wptrunner/wptrunner.py
+++ b/testing/web-platform/tests/tools/wptrunner/wptrunner/wptrunner.py
@@ -127,23 +127,23 @@ def run_tests(config, test_paths, produc
             test_loader = kwargs["test_loader"]
         else:
             run_info, test_loader = get_loader(test_paths,
                                                product,
                                                ssl_env,
                                                run_info_extras=run_info_extras(**kwargs),
                                                **kwargs)
 
-        test_source_kwargs = {"processes": kwargs["processes"]}
         if kwargs["run_by_dir"] is False:
             test_source_cls = testloader.SingleTestSource
+            test_source_kwargs = {}
         else:
             # A value of None indicates infinite depth
             test_source_cls = testloader.PathGroupedSource
-            test_source_kwargs["depth"] = kwargs["run_by_dir"]
+            test_source_kwargs = {"depth": kwargs["run_by_dir"]}
 
         logger.info("Using %i client processes" % kwargs["processes"])
 
         unexpected_total = 0
 
         kwargs["pause_after_test"] = get_pause_after_test(test_loader, **kwargs)
 
         with env.TestEnvironment(test_paths,
--- a/testing/web-platform/tests/tools/wptrunner/wptrunner/wpttest.py
+++ b/testing/web-platform/tests/tools/wptrunner/wptrunner/wpttest.py
@@ -1,10 +1,9 @@
 import os
-from collections import defaultdict
 
 import mozinfo
 
 from wptmanifest.parser import atoms
 
 atom_reset = atoms["Reset"]
 enabled_tests = set(["testharness", "reftest", "wdspec"])
 
@@ -111,21 +110,16 @@ class Test(object):
         self._test_metadata = test_metadata
         self.timeout = timeout if timeout is not None else self.default_timeout
         self.path = path
         self.environment = {"protocol": protocol, "prefs": self.prefs}
 
     def __eq__(self, other):
         return self.id == other.id
 
-    def update_metadata(self, metadata=None):
-        if metadata is None:
-            metadata = {}
-        return metadata
-
     @classmethod
     def from_manifest(cls, manifest_item, inherit_metadata, test_metadata):
         timeout = cls.long_timeout if manifest_item.timeout == "long" else cls.default_timeout
         protocol = "https" if hasattr(manifest_item, "https") and manifest_item.https else "http"
         return cls(manifest_item.source_file.tests_root,
                    manifest_item.url,
                    inherit_metadata,
                    test_metadata,
@@ -323,27 +317,16 @@ class ReftestTest(Test):
                                         [],
                                         None,
                                         [])
 
             node.references.append((reference, ref_type))
 
         return node
 
-    def update_metadata(self, metadata):
-        if not "url_count" in metadata:
-            metadata["url_count"] = defaultdict(int)
-        for reference, _ in self.references:
-            # We assume a naive implementation in which a url with multiple
-            # possible screenshots will need to take both the lhs and rhs screenshots
-            # for each possible match
-            metadata["url_count"][(self.environment["protocol"], reference.url)] += 1
-            reference.update_metadata(metadata)
-        return metadata
-
     @property
     def id(self):
         return self.url
 
     @property
     def keys(self):
         return ("reftype", "refurl")