Bug 1288885: Migrate alarms tests to xpcshell. r?aswan draft
authorKris Maglione <maglione.k@gmail.com>
Fri, 22 Jul 2016 16:21:42 -0700
changeset 392103 f1d3b7988bf9b805c9b75b8afb9a7339e005df58
parent 392102 fa18ba3d47b6cf1000c57e32b5ce279f5b323e97
child 392104 28a69b81bc31e94995227c4b6651ca3e79a26e4b
push id23940
push usermaglione.k@gmail.com
push dateSat, 23 Jul 2016 02:07:34 +0000
reviewersaswan
bugs1288885
milestone50.0a1
Bug 1288885: Migrate alarms tests to xpcshell. r?aswan MozReview-Commit-ID: 6NPOqsAfWSb
toolkit/components/extensions/test/mochitest/mochitest.ini
toolkit/components/extensions/test/mochitest/test_ext_alarms.html
toolkit/components/extensions/test/xpcshell/test_ext_alarms.js
toolkit/components/extensions/test/xpcshell/xpcshell.ini
--- a/toolkit/components/extensions/test/mochitest/mochitest.ini
+++ b/toolkit/components/extensions/test/mochitest/mochitest.ini
@@ -78,17 +78,16 @@ skip-if = (os == 'android' || buildapp =
 [test_ext_storage.html]
 [test_ext_storage_content.html]
 [test_ext_storage_tab.html]
 skip-if = os == 'android' # Android does not currently support tabs.
 [test_ext_background_runtime_connect_params.html]
 [test_ext_cookies.html]
 [test_ext_bookmarks.html]
 skip-if = (os == 'android' || buildapp == 'b2g') # unimplemented api. Bug 1258975 on android.
-[test_ext_alarms.html]
 [test_ext_background_window_properties.html]
 [test_ext_background_sub_windows.html]
 [test_ext_background_api_injection.html]
 [test_ext_background_generated_url.html]
 [test_ext_background_generated_reload.html]
 [test_ext_background_generated_load_events.html]
 [test_ext_i18n.html]
 skip-if = (os == 'android') # Bug 1258975 on android.
rename from toolkit/components/extensions/test/mochitest/test_ext_alarms.html
rename to toolkit/components/extensions/test/xpcshell/test_ext_alarms.js
--- a/toolkit/components/extensions/test/mochitest/test_ext_alarms.html
+++ b/toolkit/components/extensions/test/xpcshell/test_ext_alarms.js
@@ -1,22 +1,15 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-  <title>WebExtension test</title>
-  <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
-  <script type="text/javascript" src="/tests/SimpleTest/SpawnTask.js"></script>
-  <script type="text/javascript" src="/tests/SimpleTest/ExtensionTestUtils.js"></script>
-  <script type="text/javascript" src="head.js"></script>
-  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-</head>
-<body>
+/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* vim: set sts=2 sw=2 et tw=80: */
+"use strict";
 
-<script type="text/javascript">
-"use strict";
+/* globals browser */
+
+ExtensionTestUtils.init(this);
 
 add_task(function* test_alarm_without_permissions() {
   function backgroundScript() {
     browser.test.assertTrue(!browser.alarms,
                             "alarm API is not available when the alarm permission is not required");
     browser.test.notifyPass("alarms_permission");
   }
 
@@ -338,13 +331,8 @@ add_task(function* test_duplicate_alarm_
       permissions: ["alarms"],
     },
   });
 
   yield extension.startup();
   yield extension.awaitFinish("alarm-duplicate");
   yield extension.unload();
 });
-
-</script>
-
-</body>
-</html>
--- a/toolkit/components/extensions/test/xpcshell/xpcshell.ini
+++ b/toolkit/components/extensions/test/xpcshell/xpcshell.ini
@@ -1,14 +1,15 @@
 [DEFAULT]
 head = head.js
 tail =
 firefox-appdir = browser
 skip-if = toolkit == 'gonk' || appname == "thunderbird"
 
+[test_ext_alarms.js]
 [test_csp_custom_policies.js]
 [test_csp_validator.js]
 [test_locale_data.js]
 [test_locale_converter.js]
 [test_ext_contexts.js]
 [test_ext_json_parser.js]
 [test_ext_manifest_content_security_policy.js]
 [test_ext_manifest_incognito.js]