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

Unified Diff: third_party/WebKit/LayoutTests/webaudio/audiocontextoptions.html

Issue 2840553003: Move audiocontextoptions.html to AudioContext (Closed)
Patch Set: Created 3 years, 8 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
« no previous file with comments | « third_party/WebKit/LayoutTests/webaudio/AudioContext/audiocontextoptions.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/webaudio/audiocontextoptions.html
diff --git a/third_party/WebKit/LayoutTests/webaudio/audiocontextoptions.html b/third_party/WebKit/LayoutTests/webaudio/audiocontextoptions.html
deleted file mode 100644
index b7ce1ce98bf90b6fec1c459094ed7eda6d95b557..0000000000000000000000000000000000000000
--- a/third_party/WebKit/LayoutTests/webaudio/audiocontextoptions.html
+++ /dev/null
@@ -1,139 +0,0 @@
-<!doctype html>
-<html>
-<head>
- <title>Test AudioContextOptions</title>
- <script src="../resources/testharness.js"></script>
- <script src="../resources/testharnessreport.js"></script>
- <script src="resources/audit.js"></script>
-</head>
-
-<body>
- <script>
- let context;
- let defaultLatency;
- let interactiveLatency;
- let balancedLatency;
- let playbackLatency;
-
- let audit = Audit.createTaskRunner();
-
- audit.define(
- {
- label : "test-audiocontextoptions-latencyHint-basic",
- description : "Test creating contexts with basic latencyHint types."
- },
- function(task, should) {
- let closingPromises = [];
-
- // Verify that an AudioContext can be created with default options.
- should(function(){context = new AudioContext()},
- "context = new AudioContext()")
- .notThrow();
-
- defaultLatency = context.baseLatency;
- should(defaultLatency, "default baseLatency").beGreaterThan(0);
-
- // Verify that an AudioContext can be created with the expected
- // latency types.
- should(function(){context = new AudioContext(
- {'latencyHint' : 'interactive'})},
- "context = new AudioContext({'latencyHint': 'interactive'})")
- .notThrow();
-
- interactiveLatency = context.baseLatency;
- should(interactiveLatency, "interactive baseLatency")
- .beEqualTo(defaultLatency);
- closingPromises.push(context.close());
-
- should(function(){context =
- new AudioContext({'latencyHint' : 'balanced'})},
- "context = new AudioContext({'latencyHint': 'balanced'})")
- .notThrow();
-
- balancedLatency = context.baseLatency;
- should(balancedLatency, "balanced baseLatency")
- .beGreaterThanOrEqualTo(interactiveLatency);
- closingPromises.push(context.close());
-
- should(function(){context =
- new AudioContext({'latencyHint' : 'playback'})},
- "context = new AudioContext({'latencyHint': 'playback'})")
- .notThrow();
-
- playbackLatency = context.baseLatency;
- should(playbackLatency, "playback baseLatency")
- .beGreaterThanOrEqualTo(balancedLatency);
- closingPromises.push(context.close());
-
- Promise.all(closingPromises).then(function() { task.done(); });
- });
-
- audit.define(
- {
- label : "test-audiocontextoptions-latencyHint-double",
- description :
- "Test creating contexts with explicit latencyHint values."
- },
- function(task, should) {
- var closingPromises = [];
-
- // Verify too small exact latency clamped to 'interactive'
- should(function(){context = new AudioContext(
- {'latencyHint' : interactiveLatency / 2})},
- "context = new AudioContext({'latencyHint': " +
- "interactiveLatency/2})")
- .notThrow();
- should(context.baseLatency, "double-constructor baseLatency small")
- .beEqualTo(interactiveLatency);
- closingPromises.push(context.close());
-
- // Verify that exact latency in range works as expected
- var validLatency = (interactiveLatency + playbackLatency) / 2;
- should(function(){context = new AudioContext(
- {'latencyHint' : validLatency})},
- "context = new AudioContext({'latencyHint': validLatency})")
- .notThrow();
- should(context.baseLatency,
- "double-constructor baseLatency inrange 1")
- .beGreaterThanOrEqualTo(interactiveLatency);
- should(context.baseLatency,
- "double-constructor baseLatency inrange 2")
- .beLessThanOrEqualTo(playbackLatency);
- closingPromises.push(context.close());
-
- // Verify too big exact latency clamped to some value
- var context1;
- var context2;
- should(
- function() {
- context1 =
- new AudioContext({'latencyHint' : playbackLatency * 10});
- context2 =
- new AudioContext({'latencyHint' : playbackLatency * 20});
- },
- "creating two high latency contexts")
- .notThrow();
- should(context1.baseLatency, "high latency context baseLatency")
- .beEqualTo(context2.baseLatency);
- closingPromises.push(context1.close());
- closingPromises.push(context2.close());
-
- // Verify that invalid latencyHint values are rejected.
- should(
- function(){context = new AudioContext({'latencyHint' : 'foo'})},
- "context = new AudioContext({'latencyHint': 'foo'})")
- .throw("TypeError");
-
- // Verify that no extra options can be passed into the
- // AudioContextOptions.
- should(function(){context = new AudioContext('latencyHint')},
- "context = new AudioContext('latencyHint')")
- .throw("TypeError");
-
- Promise.all(closingPromises).then(function() { task.done(); });
- });
-
- audit.run();
- </script>
-</body>
-</html>
« no previous file with comments | « third_party/WebKit/LayoutTests/webaudio/AudioContext/audiocontextoptions.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698