Backed out 14 changesets (bug 1319237) for android xpcshell failures a=backout
authorWes Kocher <wkocher@mozilla.com>
Mon, 06 Feb 2017 11:28:28 -0800
changeset 341042 4f4dcc23d36b2c9598349c0a05583efb9fefd0c3
parent 341041 19cd77acf2e0cf418224ecea75078d40dcf6e0da
child 341043 4f8b2d44eaa0c67bc7e7f5bac4e41e9a4b2e27c7
child 341083 48c77c39e587b7b920defb69fd2b6898cff06093
push id86615
push userkwierso@gmail.com
push dateTue, 07 Feb 2017 01:52:08 +0000
treeherdermozilla-inbound@f0453084d86e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbackout
bugs1319237
milestone54.0a1
backs outc85849b790c53624b644348e494649e6d17e9a47
9746878e5fc7ef0760833ce65fedb307147208ca
1f7f75c57c59733835ea3168abbc22f6a8e24d62
4dc796bbcfaa497154f21abe3f501933a64392db
f8449c471b8fbe6518063072e0de193f06af6229
f2bdf078f39a113f9c97b8180e6984d262129b11
8df8cda569426d4c7a545e607f7f682903593da3
f651a9e54a5785862f6241baf4eed5a31a3d9236
76c8aafbd933586655ebe34a3a293d356758a219
a2096fa29cd762175d01fb38ad826a18aec375d6
af71a9376bef3c2070703d680170e94b45a05f98
778721edd8b932f7b06a89611f490d80525cd7c8
feaf6ba3bd9a781a68adecf8846457b8f2549a74
f5f206ed675b42e520c03c2754a4d56437790390
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out 14 changesets (bug 1319237) for android xpcshell failures a=backout Backed out changeset c85849b790c5 (bug 1319237) Backed out changeset 9746878e5fc7 (bug 1319237) Backed out changeset 1f7f75c57c59 (bug 1319237) Backed out changeset 4dc796bbcfaa (bug 1319237) Backed out changeset f8449c471b8f (bug 1319237) Backed out changeset f2bdf078f39a (bug 1319237) Backed out changeset 8df8cda56942 (bug 1319237) Backed out changeset f651a9e54a57 (bug 1319237) Backed out changeset 76c8aafbd933 (bug 1319237) Backed out changeset a2096fa29cd7 (bug 1319237) Backed out changeset af71a9376bef (bug 1319237) Backed out changeset 778721edd8b9 (bug 1319237) Backed out changeset feaf6ba3bd9a (bug 1319237) Backed out changeset f5f206ed675b (bug 1319237) MozReview-Commit-ID: EpmToL8Xqfz
testing/marionette/browser.js
testing/marionette/driver.js
testing/marionette/element.js
testing/marionette/harness/marionette_harness/tests/unit/test_window_position.py
testing/marionette/jar.mn
testing/marionette/test_wait.js
testing/marionette/unit.ini
testing/marionette/wait.js
testing/web-platform/harness/wptrunner/executors/pytestrunner/fixtures.py
testing/web-platform/harness/wptrunner/executors/pytestrunner/runner.py
testing/web-platform/meta/webdriver/contexts.py.ini
testing/web-platform/tests/webdriver/contexts.py
testing/web-platform/tests/webdriver/navigation.py
--- a/testing/marionette/browser.js
+++ b/testing/marionette/browser.js
@@ -366,16 +366,26 @@ browser.Context = class {
   executeWhenReady(cb) {
     if (this.hasRemotenessChange()) {
       this.pendingCommands.push(cb);
     } else {
       cb();
     }
   }
 
+  /**
+   * Returns the position of the OS window.
+   */
+  get position() {
+    return {
+      x: this.window.screenX,
+      y: this.window.screenY,
+    };
+  }
+
 };
 
 /**
  * The window storage is used to save outer window IDs mapped to weak
  * references of Window objects.
  *
  * Usage:
  *
--- a/testing/marionette/driver.js
+++ b/testing/marionette/driver.js
@@ -31,17 +31,16 @@ Cu.import("chrome://marionette/content/e
 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/session.js");
 Cu.import("chrome://marionette/content/simpletest.js");
-Cu.import("chrome://marionette/content/wait.js");
 
 this.EXPORTED_SYMBOLS = ["GeckoDriver", "Context"];
 
 var FRAME_SCRIPT = "chrome://marionette/content/listener.js";
 const BROWSER_STARTUP_FINISHED = "browser-delayed-startup-finished";
 const CLICK_TO_START_PREF = "marionette.debugging.clicktostart";
 const CONTENT_LISTENER_PREF = "marionette.contentListener";
 
@@ -1152,55 +1151,41 @@ GeckoDriver.prototype.getChromeWindowHan
 
 /**
  * Get the current window position.
  *
  * @return {Object.<string, number>}
  *     Object with |x| and |y| coordinates.
  */
 GeckoDriver.prototype.getWindowPosition = function (cmd, resp) {
-  let win = this.getCurrentWindow();
-  return {
-    x: win.screenX,
-    y: win.screenY,
-  };
+  return this.curBrowser.position;
 };
 
 /**
  * Set the window position of the browser on the OS Window Manager
  *
  * @param {number} x
  *     X coordinate of the top/left of the window that it will be
  *     moved to.
  * @param {number} y
  *     Y coordinate of the top/left of the window that it will be
  *     moved to.
  *
  * @return {Object.<string, number>}
  *     Object with |x| and |y| coordinates.
  */
-GeckoDriver.prototype.setWindowPosition = function* (cmd, resp) {
+GeckoDriver.prototype.setWindowPosition = function (cmd, resp) {
   assert.firefox()
 
   let {x, y} = cmd.parameters;
   assert.positiveInteger(x);
   assert.positiveInteger(y);
 
   let win = this.getCurrentWindow();
-  let orig = {screenX: win.screenX, screenY: win.screenY};
-
   win.moveTo(x, y);
-  yield wait.until((resolve, reject) => {
-    if ((x == win.screenX && y == win.screenY) ||
-      (win.screenX != orig.screenX || win.screenY != orig.screenY)) {
-      resolve();
-    } else {
-      reject();
-    }
-  });
 
   return this.curBrowser.position;
 };
 
 /**
  * Switch current top-level browsing context by name or server-assigned ID.
  * Searches for windows by name, then ID.  Content windows take precedence.
  *
@@ -2411,43 +2396,34 @@ GeckoDriver.prototype.setScreenOrientati
  * Get the size of the browser window currently in focus.
  *
  * Will return the current browser window size in pixels. Refers to
  * window outerWidth and outerHeight values, which include scroll bars,
  * title bars, etc.
  */
 GeckoDriver.prototype.getWindowSize = function (cmd, resp) {
   let win = this.getCurrentWindow();
-  return {
-    width: win.outerWidth,
-    height: win.outerHeight,
-  };
+  resp.body.width = win.outerWidth;
+  resp.body.height = win.outerHeight;
 };
 
 /**
  * Set the size of the browser window currently in focus.
  *
  * Not supported on B2G. The supplied width and height values refer to
  * the window outerWidth and outerHeight values, which include scroll
  * bars, title bars, etc.
  */
-GeckoDriver.prototype.setWindowSize = function* (cmd, resp) {
+GeckoDriver.prototype.setWindowSize = function (cmd, resp) {
   assert.firefox()
 
   let {width, height} = cmd.parameters;
-
   let win = this.getCurrentWindow();
-  yield new Promise(resolve => {
-    win.addEventListener("resize", resolve, {once: true});
-    win.resizeTo(width, height);
-  });
-  return {
-    width: win.outerWidth,
-    height: win.outerHeight,
-  };
+  win.resizeTo(width, height);
+  this.getWindowSize(cmd, resp);
 };
 
 /**
  * Maximizes the user agent window as if the user pressed the maximise
  * button.
  *
  * Not Supported on B2G or Fennec.
  */
--- a/testing/marionette/element.js
+++ b/testing/marionette/element.js
@@ -5,17 +5,16 @@
 "use strict";
 
 const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
 
 Cu.import("resource://gre/modules/Log.jsm");
 
 Cu.import("chrome://marionette/content/atom.js");
 Cu.import("chrome://marionette/content/error.js");
-Cu.import("chrome://marionette/content/wait.js");
 
 const logger = Log.repository.getLogger("Marionette");
 
 /**
  * This module provides shared functionality for dealing with DOM-
  * and web elements in Marionette.
  *
  * A web element is an abstraction used to identify an element when it
@@ -242,24 +241,19 @@ element.find = function (container, stra
   let searchFn;
   if (opts.all) {
     searchFn = findElements.bind(this);
   } else {
     searchFn = findElement.bind(this);
   }
 
   return new Promise((resolve, reject) => {
-    let findElements = wait.until((resolve, reject) => {
-      let res = find_(container, strategy, selector, searchFn, opts);
-      if (res.length > 0) {
-        resolve(Array.from(res));
-      } else {
-        reject([]);
-      }
-    }, opts.timeout);
+    let findElements = implicitlyWaitFor(
+        () => find_(container, strategy, selector, searchFn, opts),
+        opts.timeout);
 
     findElements.then(foundEls => {
       // the following code ought to be moved into findElement
       // and findElements when bug 1254486 is addressed
       if (!opts.all && (!foundEls || foundEls.length == 0)) {
         let msg;
         switch (strategy) {
           case element.Strategy.AnonAttribute:
@@ -557,16 +551,92 @@ function findElements(using, value, root
       }
       return [];
 
     default:
       throw new InvalidSelectorError(`No such strategy: ${using}`);
   }
 }
 
+/**
+ * Runs function off the main thread until its return value is truthy
+ * or the provided timeout is reached.  The function is guaranteed to be
+ * run at least once, irregardless of the timeout.
+ *
+ * A truthy return value constitutes a truthful boolean, positive number,
+ * object, or non-empty array.
+ *
+ * The |func| is evaluated every |interval| for as long as its runtime
+ * duration does not exceed |interval|.  If the runtime evaluation duration
+ * of |func| is greater than |interval|, evaluations of |func| are queued.
+ *
+ * @param {function(): ?} func
+ *     Function to run off the main thread.
+ * @param {number} timeout
+ *     Desired timeout.  If 0 or less than the runtime evaluation time
+ *     of |func|, |func| is guaranteed to run at least once.
+ * @param {number=} interval
+ *     Duration between each poll of |func| in milliseconds.  Defaults to
+ *     100 milliseconds.
+ *
+ * @return {Promise}
+ *     Yields the return value from |func|.  The promise is rejected if
+ *     |func| throws.
+ */
+function implicitlyWaitFor(func, timeout, interval = 100) {
+  let timer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
+
+  return new Promise((resolve, reject) => {
+    let startTime = new Date().getTime();
+    let endTime = startTime + timeout;
+
+    let elementSearch = function() {
+      let res;
+      try {
+        res = func();
+      } catch (e) {
+        reject(e);
+      }
+
+      if (
+        // collections that might contain web elements
+        // should be checked until they are not empty
+        (element.isCollection(res) && res.length > 0)
+
+        // !![] (ensuring boolean type on empty array) always returns true
+        // and we can only use it on non-collections
+        || (!element.isCollection(res) && !!res)
+
+        // return immediately if timeout is 0,
+        // allowing |func| to be evaluted at least once
+        || startTime == endTime
+
+        // return if timeout has elapsed
+        || new Date().getTime() >= endTime
+      ) {
+        resolve(res);
+      }
+    };
+
+    // the repeating slack timer waits |interval|
+    // before invoking |elementSearch|
+    elementSearch();
+
+    timer.init(elementSearch, interval, Ci.nsITimer.TYPE_REPEATING_SLACK);
+
+  // cancel timer and propagate result
+  }).then(res => {
+    timer.cancel();
+    return res;
+  }, err => {
+    timer.cancel();
+    throw err;
+  });
+}
+
 /** Determines if |obj| is an HTML or JS collection. */
 element.isCollection = function (seq) {
   switch (Object.prototype.toString.call(seq)) {
     case "[object Arguments]":
     case "[object Array]":
     case "[object FileList]":
     case "[object HTMLAllCollection]":
     case "[object HTMLCollection]":
--- a/testing/marionette/harness/marionette_harness/tests/unit/test_window_position.py
+++ b/testing/marionette/harness/marionette_harness/tests/unit/test_window_position.py
@@ -1,40 +1,42 @@
-# 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/.
+#Copyright 2007-2009 WebDriver committers
+#
+#Licensed under the Apache License, Version 2.0 (the "License");
+#you may not use this file except in compliance with the License.
+#You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+#Unless required by applicable law or agreed to in writing, software
+#distributed under the License is distributed on an "AS IS" BASIS,
+#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#See the License for the specific language governing permissions and
+#limitations under the License.
 
 from marionette_driver.errors import InvalidArgumentException
 
 from marionette_harness import MarionetteTestCase
 
 
 class TestWindowPosition(MarionetteTestCase):
     def test_get_types(self):
         position = self.marionette.get_window_position()
-        self.assertIsInstance(position["x"], int)
-        self.assertIsInstance(position["y"], int)
+        self.assertTrue(isinstance(position["x"], int))
+        self.assertTrue(isinstance(position["y"], int))
 
     def test_set_types(self):
         for x, y in (["a", "b"], [1.2, 3.4], [True, False], [[], []], [{}, {}]):
-            print("testing invalid type position ({},{})".format(x, y))
             with self.assertRaises(InvalidArgumentException):
                 self.marionette.set_window_position(x, y)
 
     def test_out_of_bounds_arguments(self):
-        for x, y in [(-1,0), (0,-1), (-1,-1)]:
-            print("testing out of bounds position ({},{})".format(x, y))
-            with self.assertRaises(InvalidArgumentException):
-                self.marionette.set_window_position(x, y)
+        with self.assertRaises(InvalidArgumentException):
+            self.marionette.set_window_position(-1, 0)
+        with self.assertRaises(InvalidArgumentException):
+            self.marionette.set_window_position(0, -1)
 
-    def test_move_to_new_position(self):
+    def test_move(self):
         old_position = self.marionette.get_window_position()
         new_position = {"x": old_position["x"] + 10, "y": old_position["y"] + 10}
         self.marionette.set_window_position(new_position["x"], new_position["y"])
-        self.assertNotEqual(old_position["x"], new_position["x"])
-        self.assertNotEqual(old_position["y"], new_position["y"])
-
-    def test_move_to_existing_position(self):
-        old_position = self.marionette.get_window_position()
-        self.marionette.set_window_position(old_position["x"], old_position["y"])
-        new_position = self.marionette.get_window_position()
-        self.assertEqual(old_position["x"], new_position["x"])
-        self.assertEqual(old_position["y"], new_position["y"])
+        self.assertNotEqual(old_position['x'], new_position["x"])
+        self.assertNotEqual(old_position['y'], new_position["y"])
--- a/testing/marionette/jar.mn
+++ b/testing/marionette/jar.mn
@@ -13,17 +13,16 @@ marionette.jar:
   content/accessibility.js (accessibility.js)
   content/listener.js (listener.js)
   content/element.js (element.js)
   content/simpletest.js (simpletest.js)
   content/frame.js (frame.js)
   content/cert.js (cert.js)
   content/event.js  (event.js)
   content/error.js (error.js)
-  content/wait.js (wait.js)
   content/message.js (message.js)
   content/dispatcher.js (dispatcher.js)
   content/modal.js (modal.js)
   content/proxy.js (proxy.js)
   content/capture.js (capture.js)
   content/cookies.js (cookies.js)
   content/atom.js (atom.js)
   content/evaluate.js (evaluate.js)
deleted file mode 100644
--- a/testing/marionette/test_wait.js
+++ /dev/null
@@ -1,74 +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/. */
-
-const {utils: Cu} = Components;
-
-Cu.import("chrome://marionette/content/wait.js");
-
-add_task(function* test_until_types() {
-  for (let typ of [true, false, "foo", 42, [], {}]) {
-    strictEqual(typ, yield wait.until(resolve => resolve(typ)));
-  }
-});
-
-add_task(function* test_until_timeoutElapse() {
-  let nevals = 0;
-  let start = new Date().getTime();
-  yield wait.until((resolve, reject) => {
-    ++nevals;
-    reject();
-  });
-  let end = new Date().getTime();
-  greaterOrEqual((end - start), 2000);
-  greaterOrEqual(nevals, 150);
-});
-
-add_task(function* test_until_rethrowError() {
-  let nevals = 0;
-  let err;
-  try {
-    yield wait.until(() => {
-      ++nevals;
-      throw new Error();
-    });
-  } catch (e) {
-    err = e;
-  }
-  equal(1, nevals);
-  ok(err instanceof Error);
-});
-
-add_task(function* test_until_noTimeout() {
-  // run at least once when timeout is 0
-  let nevals = 0;
-  let start = new Date().getTime();
-  yield wait.until((resolve, reject) => {
-    ++nevals;
-    reject();
-  }, 0);
-  let end = new Date().getTime();
-  equal(1, nevals);
-  less((end - start), 2000);
-});
-
-add_task(function* test_until_timeout() {
-  let nevals = 0;
-  let start = new Date().getTime();
-  yield wait.until((resolve, reject) => {
-    ++nevals;
-    reject();
-  }, 100);
-  let end = new Date().getTime();
-  greater(nevals, 1);
-  greaterOrEqual((end - start), 100);
-});
-
-add_task(function* test_until_interval() {
-  let nevals = 0;
-  yield wait.until((resolve, reject) => {
-    ++nevals;
-    reject();
-  }, 100, 100);
-  equal(2, nevals);
-});
--- a/testing/marionette/unit.ini
+++ b/testing/marionette/unit.ini
@@ -9,9 +9,8 @@ skip-if = appname == "thunderbird"
 
 [test_action.js]
 [test_assert.js]
 [test_element.js]
 [test_error.js]
 [test_message.js]
 [test_navigate.js]
 [test_session.js]
-[test_wait.js]
deleted file mode 100644
--- a/testing/marionette/wait.js
+++ /dev/null
@@ -1,96 +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("chrome://marionette/content/error.js");
-
-this.EXPORTED_SYMBOLS = ["wait"];
-
-/** Implicit wait utilities. */
-this.wait = {};
-
-/**
- * Runs a promise-like function off the main thread until it is resolved
- * through |resolve| or |rejected| callbacks.  The function is guaranteed
- * to be run at least once, irregardless of the timeout.
- *
- * The |func| is evaluated every |interval| for as long as its runtime
- * duration does not exceed |interval|.  Evaluations occur sequentially,
- * meaning that evaluations of |func| are queued if the runtime evaluation
- * duration of |func| is greater than |interval|.
- *
- * |func| is given two arguments, |resolve| and |reject|, of which one
- * must be called for the evaluation to complete.  Calling |resolve| with
- * an argument indicates that the expected wait condition was met and
- * will return the passed value to the caller.  Conversely, calling
- * |reject| will evaluate |func| again until the |timeout| duration has
- * elapsed or |func| throws.  The passed value to |reject| will also be
- * returned to the caller once the wait has expired.
- *
- * Usage:
- *
- *     let els = wait.until((resolve, reject) => {
- *       let res = document.querySelectorAll("p");
- *       if (res.length > 0) {
- *         resolve(Array.from(res));
- *       } else {
- *         reject([]);
- *       }
- *     });
- *
- * @param {function(resolve: function(?), reject: function(?)): ?} func
- *     Function to run off the main thread.
- * @param {number=} timeout
- *     Desired timeout.  If 0 or less than the runtime evaluation time
- *     of |func|, |func| is guaranteed to run at least once.  The default
- *     is 2000 milliseconds.
- * @param {number=} interval
- *     Duration between each poll of |func| in milliseconds.  Defaults to
- *     10 milliseconds.
- *
- * @return {Promise: ?}
- *     Yields the value passed to |func|'s |resolve| or |reject|
- *     callbacks.
- *
- * @throws {?}
- *     If |func| throws, its error is propagated.
- */
-wait.until = function (func, timeout = 2000, interval = 10) {
-  const timer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
-
-  return new Promise((resolve, reject) => {
-    const start = new Date().getTime();
-    const end = start + timeout;
-
-    let evalFn = () => {
-      new Promise(func).then(resolve, rejected => {
-        if (error.isError(rejected)) {
-          throw rejected;
-        }
-
-        // return if timeout is 0, allowing |func| to be evaluated at least once
-        if (start == end || new Date().getTime() >= end) {
-          resolve(rejected);
-        }
-      }).catch(reject);
-    };
-
-    // the repeating slack timer waits |interval|
-    // before invoking |evalFn|
-    evalFn();
-
-    timer.init(evalFn, interval, Ci.nsITimer.TYPE_REPEATING_SLACK);
-
-  // cancel timer and propagate result
-  }).then(res => {
-    timer.cancel();
-    return res;
-  }, err => {
-    timer.cancel();
-    throw err;
-  });
-};
--- a/testing/web-platform/harness/wptrunner/executors/pytestrunner/fixtures.py
+++ b/testing/web-platform/harness/wptrunner/executors/pytestrunner/fixtures.py
@@ -53,17 +53,17 @@ class Session(object):
     When the test function goes out of scope, any remaining user prompts
     and opened windows are closed, and the current browsing context is
     switched back to the top-level browsing context.
     """
 
     def __init__(self, client):
         self.client = client
 
-    @pytest.fixture(scope="module")
+    @pytest.fixture(scope="function")
     def session(self, request):
         # finalisers are popped off a stack,
         # making their ordering reverse
         request.addfinalizer(self.switch_to_top_level_browsing_context)
         request.addfinalizer(self.restore_windows)
         request.addfinalizer(self.dismiss_user_prompts)
 
         return self.client
--- a/testing/web-platform/harness/wptrunner/executors/pytestrunner/runner.py
+++ b/testing/web-platform/harness/wptrunner/executors/pytestrunner/runner.py
@@ -87,17 +87,19 @@ class SubtestResultRecorder(object):
 
     def record_error(self, report):
         # error in setup/teardown
         if report.when != "call":
             message = "%s error" % report.when
         self.record(report.nodeid, "ERROR", message, report.longrepr)
 
     def record_skip(self, report):
-        self.record(report.nodeid, "PASS")
+        self.record(report.nodeid, "ERROR",
+                    "In-test skip decorators are disallowed, "
+                    "please use WPT metadata to ignore tests.")
 
     def record(self, test, status, message=None, stack=None):
         if stack is not None:
             stack = str(stack)
         new_result = (test, status, message, stack)
         self.results.append(new_result)
 
 
--- a/testing/web-platform/meta/webdriver/contexts.py.ini
+++ b/testing/web-platform/meta/webdriver/contexts.py.ini
@@ -1,8 +1,12 @@
 [contexts.py]
   type: wdspec
   disabled:
     if (os == "linux") and (bits == 64) and debug: https://bugzilla.mozilla.org/show_bug.cgi?id=1318724
+  expected:
+    if not debug and (version != "Ubuntu 16.04"): TIMEOUT
   [contexts.py::test_resize]
     expected: FAIL
+
   [contexts.py::test_resize_by_script]
     expected: FAIL
+
--- a/testing/web-platform/tests/webdriver/contexts.py
+++ b/testing/web-platform/tests/webdriver/contexts.py
@@ -1,50 +1,32 @@
 import json
 import pytest
 import webdriver
 
-def window_size_supported(session):
-    try:
-        session.window.size = ("a", "b")
-    except webdriver.UnsupportedOperationException:
-        return False
-    except webdriver.InvalidArgumentException:
-        return True
 
-def window_position_supported(session):
-    try:
-        session.window.position = ("a", "b")
-    except webdriver.UnsupportedOperationException:
-        return False
-    except webdriver.InvalidArgumentException:
-        return True
-
+@pytest.mark.xfail(raises=webdriver.UnsupportedOperationException)
 def test_window_size_types(http, session):
-    if not window_size_supported(session):
-        pytest.skip()
-
+    session.start()
     with http.get("/session/%s/window/size" % session.session_id) as resp:
         assert resp.status == 200
         body = json.load(resp)
     assert "width" in body
     assert "height" in body
     assert isinstance(body["width"], int)
     assert isinstance(body["height"], int)
 
     size = session.window.size
     assert isinstance(size, tuple)
     assert isinstance(size[0], int)
     assert isinstance(size[1], int)
 
 
+@pytest.mark.xfail(raises=webdriver.UnsupportedOperationException)
 def test_window_resize(session):
-    if not window_size_supported(session):
-        pytest.skip()
-
     # setting the window size by webdriver is synchronous
     # so we should see the results immediately
 
     session.window.size = (400, 500)
     assert session.window.size == (400, 500)
 
     session.window.size = (500, 600)
     assert session.window.size == (500, 600)
@@ -71,24 +53,23 @@ def test_window_resize_by_script(session
     session.execute_script("window.resizeTo(800, 900)")
     size2 = session.window.size
     while size1 == size2:
         size2 = session.window.size
         assert size2 == (800, 900)
     assert size2 == {"width": 200, "height": 100}
 """
 
+@pytest.mark.xfail(raises=webdriver.UnsupportedOperationException)
 def test_window_position_types(http, session):
-    if not window_position_supported(session):
-        pytest.skip()
-
+    session.start()
     with http.get("/session/%s/window/position" % session.session_id) as resp:
         assert resp.status == 200
         body = json.load(resp)
     assert "x" in body
     assert "y" in body
     assert isinstance(body["x"], int)
     assert isinstance(body["y"], int)
 
-    pos = session.window.position
-    assert isinstance(pos, tuple)
-    assert isinstance(pos[0], int)
-    assert isinstance(pos[1], int)
+    size = session.window.position
+    assert isinstance(size, tuple)
+    assert isinstance(size[0], int)
+    assert isinstance(size[1], int)
--- a/testing/web-platform/tests/webdriver/navigation.py
+++ b/testing/web-platform/tests/webdriver/navigation.py
@@ -60,26 +60,22 @@ def test_get_current_url_payload(http, s
     assert isinstance(body["value"], types.StringTypes)
 
 
 def test_get_current_url_special_pages(session):
     session.url = "about:blank"
     assert session.url == "about:blank"
 
 
-"""
-Disabled due to https://bugzilla.mozilla.org/show_bug.cgi?id=1332122
-
 # TODO(ato): This test requires modification to pass on Windows
 def test_get_current_url_file_protocol(session):
     # tests that the browsing context remains the same
     # when navigated privileged documents
     session.url = "file:///"
     assert session.url == "file:///"
-"""
 
 
 # TODO(ato): Test for http:// and https:// protocols.
 # We need to expose a fixture for accessing
 # documents served by wptserve in order to test this.
 
 
 def test_get_current_url_malformed_url(session):
@@ -99,15 +95,15 @@ def test_get_current_url_nested_browsing
     session.switch_frame(frame)
     assert session.url == top_level_url
 
 
 def test_get_current_url_nested_browsing_contexts(session):
     session.url = two_frames_doc
     top_level_url = session.url
 
-    outer_frame = session.find.css("iframe", all=False)
+    outer_frame = session.find("iframe", all=False)
     session.switch_frame(outer_frame)
 
-    inner_frame = session.find.css("iframe", all=False)
+    inner_frame = session.find("iframe", all=False)
     session.switch_frame(frame)
 
     assert session.url == top_level_url