Bug 1286530 - Switch TV-related mochitests to chrome draft
authorAlexandre Lissy <lissyx@lissyx.dyndns.org>
Mon, 09 May 2016 12:25:54 +0200
changeset 387266 f5e37ee85406cffee639d83af33129aff13ead58
parent 387265 aa1d9a788da84da7cde43dc24d3b271412d12185
child 387267 c0ec666d6fa77ad09fe8190d48462a16cb6818f3
push id22914
push userbmo:lissyx+mozillians@lissyx.dyndns.org
push dateWed, 13 Jul 2016 15:39:24 +0000
bugs1286530
milestone50.0a1
Bug 1286530 - Switch TV-related mochitests to chrome MozReview-Commit-ID: CKoc9nz9FDe Conflicts: dom/presentation/tests/mochitest/mochitest.ini dom/presentation/tests/mochitest/test_presentation_sender_startWithDevice.html
dom/presentation/tests/mochitest/chrome.ini
dom/presentation/tests/mochitest/mochitest.ini
dom/presentation/tests/mochitest/test_presentation_device_info.html
dom/presentation/tests/mochitest/test_presentation_device_info_permission.html
dom/presentation/tests/mochitest/test_presentation_sender_startWithDevice.html
dom/presentation/tests/mochitest/test_presentation_tcp_sender.html
dom/presentation/tests/mochitest/test_presentation_tcp_sender_default_request.html
--- a/dom/presentation/tests/mochitest/chrome.ini
+++ b/dom/presentation/tests/mochitest/chrome.ini
@@ -1,4 +1,14 @@
 [DEFAULT]
-skip-if = buildapp == 'b2g' || os == 'android'
+support-files =
+  PresentationDeviceInfoChromeScript.js
+  PresentationSessionChromeScript.js
 
 [test_presentation_datachannel_sessiontransport.html]
+skip-if = buildapp == 'b2g' || os == 'android'
+[test_presentation_device_info.html]
+[test_presentation_sender_startWithDevice.html]
+skip-if = toolkit == 'android' # Bug 1129785
+[test_presentation_tcp_sender.html]
+skip-if = toolkit == 'android' # Bug 1129785
+[test_presentation_tcp_sender_default_request.html]
+skip-if = toolkit == 'android' # Bug 1129785
--- a/dom/presentation/tests/mochitest/mochitest.ini
+++ b/dom/presentation/tests/mochitest/mochitest.ini
@@ -23,28 +23,21 @@ skip-if = (e10s || toolkit == 'gonk' || 
 [test_presentation_1ua_sender_and_receiver.html]
 skip-if = (e10s || toolkit == 'gonk' || toolkit == 'android') # Bug 1129785
 [test_presentation_1ua_sender_and_receiver_oop.html]
 skip-if = (e10s || toolkit == 'gonk' || toolkit == 'android') # Bug 1129785
 [test_presentation_1ua_connection_wentaway_inproc.html]
 skip-if = (e10s || toolkit == 'gonk' || toolkit == 'android') # Bug 1129785
 [test_presentation_1ua_connection_wentaway_oop.html]
 skip-if = (e10s || toolkit == 'gonk' || toolkit == 'android') # Bug 1129785
-[test_presentation_device_info.html]
 [test_presentation_device_info_permission.html]
-[test_presentation_sender_startWithDevice.html]
-skip-if = toolkit == 'android' # Bug 1129785
 [test_presentation_tcp_sender_disconnect.html]
 skip-if = toolkit == 'android' # Bug 1129785
 [test_presentation_tcp_sender_establish_connection_error.html]
 skip-if = toolkit == 'android' # Bug 1129785
-[test_presentation_tcp_sender.html]
-skip-if = toolkit == 'android' # Bug 1129785
-[test_presentation_tcp_sender_default_request.html]
-skip-if = toolkit == 'android' # Bug 1129785
 [test_presentation_tcp_receiver_establish_connection_error.html]
 skip-if = (e10s || toolkit == 'gonk' || toolkit == 'android' || os == 'mac' || os == 'win' || buildapp == 'mulet') # Bug 1129785, Bug 1204709
 [test_presentation_tcp_receiver_establish_connection_timeout.html]
 skip-if = (e10s || toolkit == 'gonk' || toolkit == 'android') # Bug 1129785
 [test_presentation_tcp_receiver.html]
 skip-if = (e10s || toolkit == 'gonk' || toolkit == 'android') # Bug 1129785
 [test_presentation_tcp_receiver_oop.html]
 skip-if = (e10s || toolkit == 'gonk' || toolkit == 'android') # Bug 1129785
--- a/dom/presentation/tests/mochitest/test_presentation_device_info.html
+++ b/dom/presentation/tests/mochitest/test_presentation_device_info.html
@@ -1,17 +1,17 @@
 <!DOCTYPE HTML>
 <html>
 <!-- Any copyright is dedicated to the Public Domain.
    - http://creativecommons.org/publicdomain/zero/1.0/ -->
 <head>
   <meta charset="utf-8">
   <title>Test for B2G Presentation Device Info API</title>
-  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
+  <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
+  <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
 </head>
 <body>
 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1080474">Test for B2G Presentation Device Info API</a>
 <script type="application/javascript;version=1.8">
 
 'use strict';
 
 SimpleTest.waitForExplicitFinish();
@@ -126,23 +126,19 @@ function runTests() {
     info('test finished, teardown');
     gScript.sendAsyncMessage('teardown', '');
     gScript.destroy();
     SimpleTest.finish();
   });
 }
 
 window.addEventListener('load', function() {
-  SpecialPowers.pushPermissions([
-    {type: 'presentation-device-manage', allow: true, context: document},
-  ], function() {
-    SpecialPowers.pushPrefEnv({
-      'set': [
-        ['dom.presentation.enabled', true],
-      ]
-    }, runTests);
-  });
+  SpecialPowers.pushPrefEnv({
+    'set': [
+      ['dom.presentation.enabled', true],
+    ]
+  }, runTests);
 });
 
 </script>
 </pre>
 </body>
 </html>
--- a/dom/presentation/tests/mochitest/test_presentation_device_info_permission.html
+++ b/dom/presentation/tests/mochitest/test_presentation_device_info_permission.html
@@ -17,23 +17,19 @@
 SimpleTest.waitForExplicitFinish();
 
 function runTests() {
   is(navigator.mozPresentationDeviceInfo, undefined, 'navigator.mozPresentationDeviceInfo is undefined');
   SimpleTest.finish();
 }
 
 window.addEventListener('load', function() {
-  SpecialPowers.pushPermissions([
-    {type: 'presentation-device-manage', allow: false, context: document},
-  ], function() {
-    SpecialPowers.pushPrefEnv({
-      'set': [
-        ['dom.presentation.enabled', true],
-      ]
-    }, runTests);
-  });
+  SpecialPowers.pushPrefEnv({
+    'set': [
+      ['dom.presentation.enabled', true],
+    ]
+  }, runTests);
 });
 
 </script>
 </pre>
 </body>
 </html>
--- a/dom/presentation/tests/mochitest/test_presentation_sender_startWithDevice.html
+++ b/dom/presentation/tests/mochitest/test_presentation_sender_startWithDevice.html
@@ -1,17 +1,17 @@
 <!DOCTYPE HTML>
 <html>
 <!-- Any copyright is dedicated to the Public Domain.
    - http://creativecommons.org/publicdomain/zero/1.0/ -->
 <head>
   <meta charset="utf-8">
   <title>Test startWithDevice for B2G Presentation API at sender side</title>
-  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
+  <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
+  <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
 </head>
 <body>
 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1239242">Test startWithDevice for B2G Presentation API at sender side</a>
 <script type="application/javascript;version=1.8">
 
 'use strict';
 
 var gScript = SpecialPowers.loadChromeScript(SimpleTest.getTestFileURL('PresentationSessionChromeScript.js'));
@@ -155,22 +155,17 @@ function runTests() {
 
   testSetup().
   then(testStartConnectionWithDevice).
   then(testStartConnectionWithDeviceNotFoundError).
   then(teardown);
 }
 
 SimpleTest.waitForExplicitFinish();
-SpecialPowers.pushPermissions([
-  {type: 'presentation-device-manage', allow: true, context: document},
-  {type: 'presentation', allow: true, context: document},
-], function() {
-  SpecialPowers.pushPrefEnv({ 'set': [["dom.presentation.enabled", true],
-                                      ["dom.presentation.session_transport.data_channel.enable", false],
-                                      ["dom.presentation.test.enabled", true],
-                                      ["dom.presentation.test.stage", 0]]},
-                            runTests);
-});
+SpecialPowers.pushPrefEnv({ 'set': [["dom.presentation.enabled", true],
+                                    ["dom.presentation.session_transport.data_channel.enable", false],
+                                    ["dom.presentation.test.enabled", true],
+                                    ["dom.presentation.test.stage", 0]]},
+                          runTests);
 
 </script>
 </body>
 </html>
--- a/dom/presentation/tests/mochitest/test_presentation_tcp_sender.html
+++ b/dom/presentation/tests/mochitest/test_presentation_tcp_sender.html
@@ -1,17 +1,17 @@
 <!DOCTYPE HTML>
 <html>
 <!-- Any copyright is dedicated to the Public Domain.
    - http://creativecommons.org/publicdomain/zero/1.0/ -->
 <head>
   <meta charset="utf-8">
   <title>Test for B2G Presentation API at sender side</title>
-  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
+  <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
+  <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
 </head>
 <body>
 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1069230">Test for B2G Presentation API at sender side</a>
 <script type="application/javascript;version=1.8">
 
 'use strict';
 
 var gScript = SpecialPowers.loadChromeScript(SimpleTest.getTestFileURL('PresentationSessionChromeScript.js'));
@@ -185,20 +185,15 @@ function runTests() {
   then(testStartConnection).
   then(testSend).
   then(testIncomingMessage).
   then(testCloseConnection).
   then(teardown);
 }
 
 SimpleTest.waitForExplicitFinish();
-SpecialPowers.pushPermissions([
-  {type: 'presentation-device-manage', allow: false, context: document},
-  {type: 'presentation', allow: true, context: document},
-], function() {
-  SpecialPowers.pushPrefEnv({ 'set': [["dom.presentation.enabled", true],
-                                      ["dom.presentation.session_transport.data_channel.enable", false]]},
-                            runTests);
-});
+SpecialPowers.pushPrefEnv({ 'set': [["dom.presentation.enabled", true],
+                                    ["dom.presentation.session_transport.data_channel.enable", false]]},
+                          runTests);
 
 </script>
 </body>
 </html>
--- a/dom/presentation/tests/mochitest/test_presentation_tcp_sender_default_request.html
+++ b/dom/presentation/tests/mochitest/test_presentation_tcp_sender_default_request.html
@@ -1,17 +1,17 @@
 <!DOCTYPE HTML>
 <html>
 <!-- Any copyright is dedicated to the Public Domain.
    - http://creativecommons.org/publicdomain/zero/1.0/ -->
 <head>
   <meta charset="utf-8">
   <title>Test default request for B2G Presentation API at sender side</title>
-  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
+  <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
+  <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
 </head>
 <body>
 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1069230">Test default request for B2G Presentation API at sender side</a>
 <script type="application/javascript;version=1.8">
 
 'use strict';
 
 var gScript = SpecialPowers.loadChromeScript(SimpleTest.getTestFileURL('PresentationSessionChromeScript.js'));
@@ -134,20 +134,15 @@ function runTests() {
 
   testSetup().
   then(testStartConnection).
   then(testCloseConnection).
   then(teardown);
 }
 
 SimpleTest.waitForExplicitFinish();
-SpecialPowers.pushPermissions([
-  {type: 'presentation-device-manage', allow: false, context: document},
-  {type: 'presentation', allow: true, context: document},
-], function() {
-  SpecialPowers.pushPrefEnv({ 'set': [["dom.presentation.enabled", true],
-                                      ["dom.presentation.session_transport.data_channel.enable", false]]},
-                            runTests);
-});
+SpecialPowers.pushPrefEnv({ 'set': [["dom.presentation.enabled", true],
+                                    ["dom.presentation.session_transport.data_channel.enable", false]]},
+                          runTests);
 
 </script>
 </body>
 </html>