Backout bug 1180539 for test failures

This commit is contained in:
Ehsan Akhgari 2015-07-06 10:49:28 -04:00
Родитель c0e3046caf
Коммит 9371189fe4
8 изменённых файлов: 1 добавлений и 230 удалений

Просмотреть файл

@ -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>

Просмотреть файл

@ -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>

Просмотреть файл

@ -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]

Просмотреть файл

@ -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>

Просмотреть файл

@ -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>

Просмотреть файл

@ -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

Просмотреть файл

@ -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;

Просмотреть файл

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