Backed out changeset e96398029a1c (bug 1181073) for failing the test it added CLOSED TREE

This commit is contained in:
Wes Kocher 2016-05-19 10:17:55 -07:00
Родитель a90e9d792e
Коммит 9f7d2279d9
6 изменённых файлов: 0 добавлений и 88 удалений

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

@ -306,16 +306,6 @@ static int32_t gMinBackgroundTimeoutValue;
inline int32_t
nsGlobalWindow::DOMMinTimeoutValue() const {
bool isBackground = !mOuterWindow || mOuterWindow->IsBackground();
if (isBackground) {
// Don't use the background timeout value when there are audio contexts with
// active nodes, so that background audio can keep running smoothly.
for (const AudioContext* ctx : mAudioContexts) {
if (ctx->ActiveNodeCount() > 0) {
isBackground = false;
break;
}
}
}
return
std::max(isBackground ? gMinBackgroundTimeoutValue : gMinTimeoutValue, 0);
}

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

@ -659,12 +659,6 @@ AudioContext::MaxChannelCount() const
return mIsOffline ? mNumberOfChannels : CubebUtils::MaxNumberOfChannels();
}
uint32_t
AudioContext::ActiveNodeCount() const
{
return mActiveNodes.Count();
}
MediaStreamGraph*
AudioContext::Graph() const
{

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

@ -294,8 +294,6 @@ public:
uint32_t MaxChannelCount() const;
uint32_t ActiveNodeCount() const;
void Mute() const;
void Unmute() const;

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

@ -15,10 +15,6 @@ MOCHITEST_MANIFESTS += [
'test/mochitest.ini',
]
BROWSER_CHROME_MANIFESTS += [
'test/browser.ini',
]
TEST_HARNESS_FILES.testing.mochitest.tests.dom.media.webaudio.test.blink += [
'test/blink/audio-testing.js',
'test/blink/convolution-testing.js',

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

@ -1 +0,0 @@
[browser_bug1181073.js]

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

@ -1,65 +0,0 @@
add_task(function*() {
// Make the min_background_timeout_value very high to avoid problems on slow machines
yield new Promise(resolve => SpecialPowers.pushPrefEnv({
'set': [['dom.min_background_timeout_value', 3000]]
}, resolve));
let tab = yield BrowserTestUtils.openNewForegroundTab(gBrowser, "https://example.com");
let browser = gBrowser.selectedBrowser;
// Make the tab a background tab, so that setInterval will be throttled.
yield BrowserTestUtils.openNewForegroundTab(gBrowser);
let time = yield ContentTask.spawn(browser, null, function () {
return new Promise(resolve => {
let start = content.performance.now();
let id = content.window.setInterval(function() {
let end = content.performance.now();
content.window.clearInterval(id);
resolve(end - start);
}, 0);
});
});
ok(time > 2000, "Interval is throttled with no webaudio (" + time + " ms)");
time = yield ContentTask.spawn(browser, null, function () {
return new Promise(resolve => {
// Start playing audio, save it on the window so it doesn't get GCed
let audioCtx = content.window.audioCtx = new content.window.AudioContext();
let oscillator = audioCtx.createOscillator();
oscillator.type = 'square';
oscillator.frequency.value = 3000;
oscillator.start();
let start = content.performance.now();
let id = content.window.setInterval(function() {
let end = content.performance.now();
content.window.clearInterval(id);
oscillator.stop();
resolve(end - start);
}, 0);
});
});
ok(time < 1000, "Interval is not throttled with audio playing (" + time + " ms)");
// Destroy the oscillator, but not the audio context
Cu.forceGC();
time = yield ContentTask.spawn(browser, null, function () {
return new Promise(resolve => {
let start = content.performance.now();
let id = content.window.setInterval(function() {
let end = content.performance.now();
content.window.clearInterval(id);
resolve(end - start);
}, 0);
});
});
ok(time > 2000, "Interval is throttled with audio stopped (" + time + " ms)");
while (gBrowser.tabs.length > 1)
gBrowser.removeCurrentTab();
});