Backout bug 1180539 for test failures

This commit is contained in:
Ehsan Akhgari 2015-07-06 10:49:28 -04:00
parent c0e3046caf
commit 9371189fe4
8 changed files with 1 additions and 230 deletions

View File

@ -1,34 +0,0 @@
<!DOCTYPE html>
<script>
var ac = new AudioContext();
fetch("audio.ogg").then(response => {
return response.arrayBuffer();
}).then(ab => {
return ac.decodeAudioData(ab);
}).then(ab => {
var src = ac.createBufferSource();
src.buffer = ab;
src.loop = true;
src.start();
src.connect(ac.destination);
parent.runTest();
});
var suspendPromise;
function suspendAC() {
suspendPromise = ac.suspend();
}
var resumePromise;
function resumeAC() {
suspendPromise.then(() => {
resumePromise = ac.resume();
});
}
function closeAC() {
resumePromise.then(() => {
ac.close();
});
}
</script>

View File

@ -1,15 +0,0 @@
<!DOCTYPE html>
<script>
var ac = new AudioContext();
fetch("audio.ogg").then(response => {
return response.arrayBuffer();
}).then(ab => {
return ac.decodeAudioData(ab);
}).then(ab => {
var src = ac.createBufferSource();
src.buffer = ab;
src.loop = true;
src.start();
src.connect(ac.destination);
});
</script>

View File

@ -237,8 +237,6 @@ support-files =
referrerHelper.js
test_performance_user_timing.js
img_referrer_testserver.sjs
file_webaudioLoop.html
file_webaudioLoop2.html
[test_anonymousContent_api.html]
[test_anonymousContent_append_after_reflow.html]
@ -307,10 +305,6 @@ skip-if = e10s || buildapp == 'b2g'
[test_urlSearchParams.html]
[test_urlSearchParams_utf8.html]
[test_urlutils_stringify.html]
[test_webaudioNotification.html]
skip-if = buildapp == 'mulet'
[test_webaudioNotificationStopOnNavigation.html]
skip-if = buildapp == 'mulet'
[test_window_constructor.html]
[test_window_cross_origin_props.html]
[test_window_define_symbol.html]

View File

@ -1,84 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Test for audio controller in windows</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
</head>
<body>
<pre id="test">
</pre>
<iframe></iframe>
<script type="application/javascript">
SimpleTest.waitForExplicitFinish();
var expectedNotification = null;
var iframe = null;
var observer = {
observe: function(subject, topic, data) {
is(topic, "media-playback", "media-playback received");
is(data, expectedNotification, "This is the right notification");
SimpleTest.executeSoon(runTest);
}
};
var observerService = SpecialPowers.Cc["@mozilla.org/observer-service;1"]
.getService(SpecialPowers.Ci.nsIObserverService);
var tests = [
function() {
iframe = document.querySelector("iframe");
SpecialPowers.pushPrefEnv({"set": [["media.useAudioChannelService", true]]}, runTest);
},
function() {
iframe.src = "file_webaudioLoop.html";
},
function() {
observerService.addObserver(observer, "media-playback", false);
ok(true, "Observer set");
runTest();
},
function() {
expectedNotification = 'inactive';
iframe.contentWindow.suspendAC();
},
function() {
expectedNotification = 'active';
iframe.contentWindow.resumeAC();
},
function() {
expectedNotification = 'inactive';
iframe.contentWindow.closeAC();
},
function() {
observerService.removeObserver(observer, "media-playback");
ok(true, "Observer removed");
runTest();
}
];
function runTest() {
if (!tests.length) {
SimpleTest.finish();
return;
}
var test = tests.shift();
test();
}
onload = runTest;
</script>
</body>
</html>

View File

@ -1,75 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Test for audio controller in windows</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
</head>
<body>
<pre id="test">
</pre>
<iframe></iframe>
<script type="application/javascript">
SimpleTest.waitForExplicitFinish();
var expectedNotification = null;
var iframe = null;
var observer = {
observe: function(subject, topic, data) {
is(topic, "media-playback", "media-playback received");
is(data, expectedNotification, "This is the right notification");
runTest();
}
};
var observerService = SpecialPowers.Cc["@mozilla.org/observer-service;1"]
.getService(SpecialPowers.Ci.nsIObserverService);
var tests = [
function() {
iframe = document.querySelector("iframe");
SpecialPowers.pushPrefEnv({"set": [["media.useAudioChannelService", true]]}, runTest);
},
function() {
observerService.addObserver(observer, "media-playback", false);
ok(true, "Observer set");
runTest();
},
function() {
expectedNotification = 'active';
iframe.src = "file_webaudioLoop2.html";
},
function() {
expectedNotification = 'inactive';
iframe.src = "data:text/html,page without audio";
},
function() {
observerService.removeObserver(observer, "media-playback");
ok(true, "Observer removed");
runTest();
}
];
function runTest() {
if (!tests.length) {
SimpleTest.finish();
return;
}
var test = tests.shift();
test();
}
onload = runTest;
</script>
</body>
</html>

View File

@ -851,8 +851,6 @@ AudioContext::Suspend(ErrorResult& aRv)
return promise.forget();
}
Destination()->DestroyAudioChannelAgent();
MediaStream* ds = DestinationStream();
if (ds) {
ds->BlockStreamIfNeeded();
@ -891,8 +889,6 @@ AudioContext::Resume(ErrorResult& aRv)
return promise.forget();
}
Destination()->CreateAudioChannelAgent();
MediaStream* ds = DestinationStream();
if (ds) {
ds->UnblockStreamIfNeeded();
@ -927,10 +923,6 @@ AudioContext::Close(ErrorResult& aRv)
mCloseCalled = true;
if (Destination()) {
Destination()->DestroyAudioChannelAgent();
}
mPromiseGripArray.AppendElement(promise);
// This can be called when freeing a document, and the streams are dead at

View File

@ -403,7 +403,7 @@ AudioDestinationNode::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const
}
void
AudioDestinationNode::DestroyAudioChannelAgent()
AudioDestinationNode::DestroyMediaStream()
{
if (mAudioChannelAgent && !Context()->IsOffline()) {
mAudioChannelAgent->StopPlaying();
@ -416,12 +416,6 @@ AudioDestinationNode::DestroyAudioChannelAgent()
mEventProxyHelper,
/* useCapture = */ true);
}
}
void
AudioDestinationNode::DestroyMediaStream()
{
DestroyAudioChannelAgent();
if (!mStream)
return;

View File

@ -78,7 +78,6 @@ public:
void SetIsOnlyNodeForContext(bool aIsOnlyNode);
void CreateAudioChannelAgent();
void DestroyAudioChannelAgent();
virtual const char* NodeType() const override
{