Bug 1332862 - remove useless test. draft
authorAlastor Wu <alwu@mozilla.com>
Tue, 18 Jul 2017 14:45:57 +0800
changeset 610310 594dc6b0baf1797b2ea4cea74bd4b08f631e9780
parent 603204 6f8f10f48ace5692256efd91f011bd23054ee2ec
child 637822 199f97c7422618c8cdcc7ba3ff2f69508c1941a3
push id68851
push useralwu@mozilla.com
push dateTue, 18 Jul 2017 06:46:25 +0000
bugs1332862
milestone56.0a1
Bug 1332862 - remove useless test. MozReview-Commit-ID: 8bul0OFLeU6
dom/browser-element/mochitest/browserElement_AudioPlayback.js
dom/browser-element/mochitest/chrome.ini
dom/browser-element/mochitest/mochitest-oop.ini
dom/browser-element/mochitest/test_browserElement_inproc_AudioPlayback.html
dom/browser-element/mochitest/test_browserElement_oop_AudioPlayback.html
deleted file mode 100644
--- a/dom/browser-element/mochitest/browserElement_AudioPlayback.js
+++ /dev/null
@@ -1,75 +0,0 @@
-/* Any copyright is dedicated to the public domain.
-   http://creativecommons.org/publicdomain/zero/1.0/ */
-
-// Test the mozbrowseraudioplaybackchange event is fired correctly.
-'use strict';
-
-const { Services } = SpecialPowers.Cu.import('resource://gre/modules/Services.jsm');
-
-SimpleTest.waitForExplicitFinish();
-browserElementTestHelpers.setEnabledPref(true);
-
-/**
- * Content script passed to the child iframe
- */
-function playAudioScript() {
-  var audio = new content.Audio();
-  content.document.body.appendChild(audio);
-  audio.oncanplay = function() {
-    audio.play();
-  };
-  audio.src = 'audio.ogg';
-}
-
-/**
- * Creates a simple mozbrowser frame
- */
-function createFrame() {
-  let iframe = document.createElement('iframe');
-  iframe.setAttribute('mozbrowser', 'true');
-  document.body.appendChild(iframe);
-  return iframe;
-}
-
-function runTest() {
-  SimpleTest.waitForExplicitFinish();
-
-  let iframe = createFrame();
-  let iframe2 = createFrame();
-
-  // When the first iframe is finished loading inject a script to create
-  // an audio element and play it.
-  iframe.addEventListener('mozbrowserloadend', () => {
-    let mm = SpecialPowers.getBrowserFrameMessageManager(iframe);
-    mm.loadFrameScript('data:,(' + playAudioScript.toString() + ')();', false);
-  });
-
-  // Two events should come in, when the audio starts, and stops playing.
-  // The first one should have a detail of 'active' and the second one
-  // should have a detail of 'inactive-pause'.
-  let expectedNextData = 'active';
-  iframe.addEventListener('mozbrowseraudioplaybackchange', (e) => {
-    is(e.detail, expectedNextData, 'Audio detail should be correct')
-    is(e.target, iframe, 'event target should be the first iframe')
-    if (e.detail === 'inactive-pause') {
-      SimpleTest.finish();
-    }
-    expectedNextData = 'inactive-pause';
-  });
-
-  // Make sure an event only goes to the first iframe.
-  iframe2.addEventListener('mozbrowseraudioplaybackchange', (e) => {
-    ok(false,
-       'mozbrowseraudioplaybackchange should dispatch to the correct browser');
-  });
-
-  // Load a simple page to get the process started.
-  iframe.src = browserElementTestHelpers.fileEmptyPage1;
-}
-
-addEventListener('testready', function() {
-  SpecialPowers.pushPrefEnv({'set': [["b2g.system_startup_url", window.location.href]]},
-                            function() {
-    SimpleTest.executeSoon(runTest);
-  });
-});
--- a/dom/browser-element/mochitest/chrome.ini
+++ b/dom/browser-element/mochitest/chrome.ini
@@ -1,16 +1,15 @@
 [DEFAULT]
 skip-if = e10s
 
 support-files =
   audio.ogg
   async.js
   browserElementTestHelpers.js
-  browserElement_AudioPlayback.js
   browserElement_BackForward.js
   browserElement_BadScreenshot.js
   browserElement_DocumentFirstPaint.js
   browserElement_DOMRequestError.js
   browserElement_ExecuteScript.js
   browserElement_Find.js
   browserElement_GetContentDimensions.js
   browserElement_GetScreenshot.js
@@ -26,18 +25,16 @@ support-files =
   file_browserElement_SendEvent.html
   file_bug709759.sjs
   file_empty.html
   file_post_request.html
   file_web_manifest.html
   file_web_manifest.json
   file_illegal_web_manifest.html
 
-[test_browserElement_inproc_AudioPlayback.html]
-skip-if = true # bug 1332850, bug 1332862
 [test_browserElement_inproc_BackForward.html]
 [test_browserElement_inproc_BadScreenshot.html]
 [test_browserElement_inproc_DocumentFirstPaint.html]
 [test_browserElement_inproc_DOMRequestError.html]
 [test_browserElement_inproc_ExecuteScript.html]
 [test_browserElement_inproc_Find.html]
 [test_browserElement_inproc_GetContentDimensions.html]
 [test_browserElement_inproc_GetScreenshot.html]
--- a/dom/browser-element/mochitest/mochitest-oop.ini
+++ b/dom/browser-element/mochitest/mochitest-oop.ini
@@ -47,18 +47,16 @@ disabled = Disabling some OOP tests for 
 [test_browserElement_oop_GetScreenshotDppx.html]
 disabled = Disabling some OOP tests for WebIDL scope changes (bug 1310706 for re-enabling)
 [test_browserElement_oop_Iconchange.html]
 [test_browserElement_oop_LoadEvents.html]
 [test_browserElement_oop_Manifestchange.html]
 [test_browserElement_oop_Metachange.html]
 [test_browserElement_oop_NoAudioTrack.html]
 disabled = Disabling some OOP tests for WebIDL scope changes (bug 1310706 for re-enabling)
-[test_browserElement_oop_AudioPlayback.html]
-disabled = Disabling some OOP tests for WebIDL scope changes (bug 1310706 for re-enabling)
 [test_browserElement_oop_OpenMixedProcess.html]
 disabled = disabled for bug 1266035 (bug 1310706 for re-enabling)
 [test_browserElement_oop_OpenNamed.html]
 [test_browserElement_oop_OpenWindow.html]
 [test_browserElement_oop_OpenWindowDifferentOrigin.html]
 [test_browserElement_oop_OpenWindowInFrame.html]
 [test_browserElement_oop_OpenWindowRejected.html]
 [test_browserElement_oop_Opensearch.html]
deleted file mode 100644
--- a/dom/browser-element/mochitest/test_browserElement_inproc_AudioPlayback.html
+++ /dev/null
@@ -1,18 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=1180824
--->
-<head>
-  <title>Test for Bug 1180824</title>
-  <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
-  <script type="application/javascript" src="browserElementTestHelpers.js"></script>
-  <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
-</head>
-<body>
-<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1180824">Mozilla Bug 1180824</a>
-
-<script type="application/javascript" src="browserElement_AudioPlayback.js">
-</script>
-</body>
-</html>
deleted file mode 100644
--- a/dom/browser-element/mochitest/test_browserElement_oop_AudioPlayback.html
+++ /dev/null
@@ -1,18 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=1180824
--->
-<head>
-  <title>Test for Bug 1180824</title>
-  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
-  <script type="application/javascript" src="browserElementTestHelpers.js"></script>
-  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-</head>
-<body>
-<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1180824">Mozilla Bug 1180824</a>
-
-<script type="application/javascript" src="browserElement_AudioPlayback.js">
-</script>
-</body>
-</html>