Bug 1286530 - Switch RIL-related mochitests to chrome draft
authorAlexandre Lissy <lissyx@lissyx.dyndns.org>
Tue, 10 May 2016 10:26:29 +0200
changeset 387264 45a0e4b0925e979b1d20f1474abb55ef964a8905
parent 387263 3072b8398620a09d80a274d1893826a266c35fb9
child 387265 aa1d9a788da84da7cde43dc24d3b271412d12185
push id22914
push userbmo:lissyx+mozillians@lissyx.dyndns.org
push dateWed, 13 Jul 2016 15:39:24 +0000
bugs1286530
milestone50.0a1
Bug 1286530 - Switch RIL-related mochitests to chrome MozReview-Commit-ID: KGiYPgpSED7
dom/mobilemessage/moz.build
dom/mobilemessage/tests/mochitest/chrome.ini
dom/mobilemessage/tests/mochitest/mochitest.ini
dom/mobilemessage/tests/mochitest/test_sms_basics.html
--- a/dom/mobilemessage/moz.build
+++ b/dom/mobilemessage/moz.build
@@ -1,17 +1,17 @@
 # -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
 # vim: set filetype=python:
 # 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/.
 
 DIRS += ['interfaces']
 
-MOCHITEST_MANIFESTS += ['tests/mochitest/mochitest.ini']
+MOCHITEST_CHROME_MANIFESTS += ['tests/mochitest/chrome.ini']
 XPCSHELL_TESTS_MANIFESTS += ['tests/xpcshell/xpcshell.ini']
 
 EXPORTS.mozilla.dom.mobilemessage += [
     'Constants.h',            # Required by almost all cpp files
     'ipc/SmsChild.h',
     'ipc/SmsParent.h',
     'Types.h',                # Required by IPDL SmsTypes.h
 ]
rename from dom/mobilemessage/tests/mochitest/mochitest.ini
rename to dom/mobilemessage/tests/mochitest/chrome.ini
--- a/dom/mobilemessage/tests/mochitest/test_sms_basics.html
+++ b/dom/mobilemessage/tests/mochitest/test_sms_basics.html
@@ -1,14 +1,14 @@
 <!DOCTYPE HTML>
 <html>
 <head>
   <title>Test for WebSMS</title>
-  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
-  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
+  <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
+  <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
 </head>
 <body>
 <p id="display"></p>
 <div id="content" style="display: none">
 <iframe></iframe>
 </div>
 <pre id="test">
 <script type="application/javascript;version=1.8">
@@ -68,47 +68,39 @@ function checkWebidlInterfaceNotInWindow
     ok(!(iface in window), iface + " should not be there");
   }
 }
 
 function test() {
   checkWebidlInterfaceNotInWindow();
 
   // If sms is disabled and permission is removed, sms is disabled.
-  SpecialPowers.pushPrefEnv({"set": [["dom.sms.enabled", false]]}, function() {
-    SpecialPowers.pushPermissions([{'type': 'sms', 'remove': true, 'context': document}], test2);
-  });
+  SpecialPowers.pushPrefEnv({"set": [["dom.sms.enabled", false]]}, test2);
 }
 
 function test2() {
   checkSmsDisabled();
 
   // If sms is enabled and permission is removed, sms is disabled.
-  SpecialPowers.pushPrefEnv({"set": [["dom.sms.enabled", true]]}, function() {
-    SpecialPowers.pushPermissions([{'type': 'sms', 'remove': true, 'context': document}], test3);
-  });
+  SpecialPowers.pushPrefEnv({"set": [["dom.sms.enabled", true]]}, test3);
 }
 
 function test3() {
   checkSmsDisabled();
 
   // If sms is disabled and permission is granted, sms is disabled.
-  SpecialPowers.pushPrefEnv({"set": [["dom.sms.enabled", false]]}, function() {
-    SpecialPowers.pushPermissions([{'type': 'sms', 'allow': true, 'context': document}], test4);
-  });
+  SpecialPowers.pushPrefEnv({"set": [["dom.sms.enabled", false]]}, test4);
 }
 
 function test4() {
   checkSmsDisabled();
 
   // Even if sms is enabled and permission is granted, sms is still disabled due
   // to the webidl check "AvailableIn=CertifiedApps."
-  SpecialPowers.pushPrefEnv({"set": [["dom.sms.enabled", true]]}, function() {
-    SpecialPowers.pushPermissions([{'type': 'sms', 'allow': true, 'context': document}], test5);
-  });
+  SpecialPowers.pushPrefEnv({"set": [["dom.sms.enabled", true]]}, test5);
 }
 
 function test5() {
   checkSmsDisabled();
 
   var iframeElt = document.getElementsByTagName('iframe')[0];
   iframeElt.addEventListener("load", function() {
     iframeElt.removeEventListener("load", arguments.callee);