Bug 1318351 - Remove B2G related assertions. draft
authorHenrik Skupin <mail@hskupin.info>
Wed, 03 May 2017 16:40:37 +0200
changeset 575482 022d12667aa4b0ff84767a6b9eaafb3e1e78400d
parent 575481 910ebb3ac4cc59eafab6f21939ce37352fec7ee0
child 575483 210c02862ba4a883aa4900f4be00a888c3af9564
push id58064
push userbmo:hskupin@gmail.com
push dateWed, 10 May 2017 13:57:21 +0000
bugs1318351
milestone55.0a1
Bug 1318351 - Remove B2G related assertions. MozReview-Commit-ID: Iy0wYJoodvO
testing/marionette/assert.js
testing/marionette/test_assert.js
--- 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);