зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1332862 - remove useless test. r=baku
MozReview-Commit-ID: 8bul0OFLeU6 --HG-- extra : rebase_source : c086b32e8abae8a802cc4577a7dfe7adf29583e2
This commit is contained in:
Родитель
84f63b9d2f
Коммит
881ab25b5c
|
@ -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);
|
|
||||||
});
|
|
||||||
});
|
|
|
@ -5,7 +5,6 @@ support-files =
|
||||||
audio.ogg
|
audio.ogg
|
||||||
async.js
|
async.js
|
||||||
browserElementTestHelpers.js
|
browserElementTestHelpers.js
|
||||||
browserElement_AudioPlayback.js
|
|
||||||
browserElement_BackForward.js
|
browserElement_BackForward.js
|
||||||
browserElement_BadScreenshot.js
|
browserElement_BadScreenshot.js
|
||||||
browserElement_DocumentFirstPaint.js
|
browserElement_DocumentFirstPaint.js
|
||||||
|
@ -31,8 +30,6 @@ support-files =
|
||||||
file_web_manifest.json
|
file_web_manifest.json
|
||||||
file_illegal_web_manifest.html
|
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_BackForward.html]
|
||||||
[test_browserElement_inproc_BadScreenshot.html]
|
[test_browserElement_inproc_BadScreenshot.html]
|
||||||
[test_browserElement_inproc_DocumentFirstPaint.html]
|
[test_browserElement_inproc_DocumentFirstPaint.html]
|
||||||
|
|
|
@ -52,8 +52,6 @@ disabled = Disabling some OOP tests for WebIDL scope changes (bug 1310706 for re
|
||||||
[test_browserElement_oop_Metachange.html]
|
[test_browserElement_oop_Metachange.html]
|
||||||
[test_browserElement_oop_NoAudioTrack.html]
|
[test_browserElement_oop_NoAudioTrack.html]
|
||||||
disabled = Disabling some OOP tests for WebIDL scope changes (bug 1310706 for re-enabling)
|
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]
|
[test_browserElement_oop_OpenMixedProcess.html]
|
||||||
disabled = disabled for bug 1266035 (bug 1310706 for re-enabling)
|
disabled = disabled for bug 1266035 (bug 1310706 for re-enabling)
|
||||||
[test_browserElement_oop_OpenNamed.html]
|
[test_browserElement_oop_OpenNamed.html]
|
||||||
|
|
|
@ -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>
|
|
|
@ -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>
|
|
Загрузка…
Ссылка в новой задаче