Bug 1318351 - Remove B2G related assertions.
MozReview-Commit-ID: Iy0wYJoodvO
--- a/testing/marionette/assert.js
+++ b/testing/marionette/assert.js
@@ -10,17 +10,16 @@ Cu.import("resource://gre/modules/AppCon
Cu.import("resource://gre/modules/Preferences.jsm");
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("chrome://marionette/content/error.js");
this.EXPORTED_SYMBOLS = ["assert"];
const isFennec = () => AppConstants.platform == "android";
-const isB2G = () => AppConstants.MOZ_B2G;
const isFirefox = () => Services.appinfo.name == "Firefox";
/** Shorthands for common assertions made in Marionette. */
this.assert = {};
/**
* Asserts that Marionette has a session.
*
@@ -65,30 +64,16 @@ assert.firefox = function (msg = "") {
* If current browser is not Fennec.
*/
assert.fennec = function (msg = "") {
msg = msg || "Only supported in Fennec";
assert.that(isFennec, msg, UnsupportedOperationError)();
};
/**
- * Asserts that the current browser is B2G.
- *
- * @param {string=} msg
- * Custom error message.
- *
- * @throws {UnsupportedOperationError}
- * If the current browser is not B2G.
- */
-assert.b2g = function (msg = "") {
- msg = msg || "Only supported in B2G";
- assert.that(isB2G, msg, UnsupportedOperationError)();
-};
-
-/**
* Asserts that the current |context| is content.
*
* @param {string} context
* Context to test.
* @param {string=} msg
* Custom error message.
*
* @return {string}
@@ -98,31 +83,16 @@ assert.b2g = function (msg = "") {
* If |context| is not content.
*/
assert.content = function (context, msg = "") {
msg = msg || "Only supported in content context";
assert.that(c => c.toString() == "content", msg, UnsupportedOperationError)(context);
};
/**
- * Asserts that the current browser is a mobile browser, that is either
- * B2G or Fennec.
- *
- * @param {string=} msg
- * Custom error message.
- *
- * @throws {UnsupportedOperationError}
- * If the current browser is not B2G or Fennec.
- */
-assert.mobile = function (msg = "") {
- msg = msg || "Only supported in Fennec or B2G";
- assert.that(() => isFennec() || isB2G(), msg, UnsupportedOperationError)();
-};
-
-/**
* Asserts that |win| is open.
*
* @param {ChromeWindow} win
* Chrome window to test.
* @param {string=} msg
* Custom error message.
*
* @return {ChromeWindow}
--- a/testing/marionette/test_assert.js
+++ b/testing/marionette/test_assert.js
@@ -16,17 +16,17 @@ add_test(function test_session() {
}
run_next_test();
});
add_test(function test_platforms() {
// at least one will fail
let raised;
- for (let fn of [assert.firefox, assert.fennec, assert.b2g, assert.mobile]) {
+ for (let fn of [assert.firefox, assert.fennec]) {
try {
fn();
} catch (e) {
raised = e;
}
}
ok(raised instanceof UnsupportedOperationError);