Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(218)

Unified Diff: LayoutTests/webaudio/offlineaudiocontext-suspend-resume-eventhandler.html

Issue 1237383004: Revert of Implement suspend() and resume() for OfflineAudioContext (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: LayoutTests/webaudio/offlineaudiocontext-suspend-resume-eventhandler.html
diff --git a/LayoutTests/webaudio/offlineaudiocontext-suspend-resume-eventhandler.html b/LayoutTests/webaudio/offlineaudiocontext-suspend-resume-eventhandler.html
deleted file mode 100644
index 6040ba6c58ab103f25c8ff18728145d5398c9328..0000000000000000000000000000000000000000
--- a/LayoutTests/webaudio/offlineaudiocontext-suspend-resume-eventhandler.html
+++ /dev/null
@@ -1,67 +0,0 @@
-<!doctype html>
-<html>
- <head>
- <script src="../resources/js-test.js"></script>
- <script src="resources/compatibility.js"></script>
- <script src="resources/audio-testing.js"></script>
- </head>
-
- <body>
- <script>
- description('Test event handler callback from OfflineAudioContext.resume() and OfflineAudioContext.suspend().');
- window.jsTestIsAsync = true;
-
- var context;
- var renderQuantum = 128;
-
- // The sample rate is multiple of the rendering quantum, so suspension
- // times in the test fall in to the render quantum boundary. Although
- // this is not necessary, it is easier to understand the test.
- var sampleRate = renderQuantum * 100;
-
- var renderDuration = 2;
- var scheduledSuspendTime = 0;
-
- // With the sample rate setting above, this ensures suspension time fall
- // in to the render quantum boundary.
- var suspendInterval = 0.25;
-
- function runTest() {
- context = new OfflineAudioContext(1, sampleRate * renderDuration, sampleRate);
-
- context.onstatechange = function () {
- if (context.state === 'suspended') {
- Should('context.currentTime', context.currentTime)
- .beEqualTo(scheduledSuspendTime);
-
- scheduledSuspendTime = context.currentTime + suspendInterval;
-
- // Schedule the next suspension only when |scheduledSuspendTime| is
- // less than |renderDuration|. Although suspend() will catch
- // the out-of-bound error, it will reject the promise and this test
- // is for the event handler, not the promise.
- if (scheduledSuspendTime < renderDuration)
- context.suspend(scheduledSuspendTime);
-
- context.resume();
- }
- };
-
- // This test is for verifying all the event handlers on OAC and that is
- // why 'oncomplete' is used here.
- context.oncomplete = function () {
- Should('context.state', context.state).beEqualTo('closed');
- finishJSTest();
- };
-
- // Initiate the suspension loop.
- context.suspend(scheduledSuspendTime);
- context.startRendering();
- }
-
- runTest();
- successfullyParsed = true;
- </script>
-
- </body>
-</html>

Powered by Google App Engine
This is Rietveld 408576698