| 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
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..f6c1b80167e00ab4212f07f491e324653024e6f8
|
| --- /dev/null
|
| +++ b/third_party/WebKit/LayoutTests/webaudio/audiocontextoptions.html
|
| @@ -0,0 +1,50 @@
|
| +<!doctype html>
|
| +<html>
|
| +<head>
|
| + <title>Test AudioContextOptions</title>
|
| + <script src="../resources/testharness.js"></script>
|
| + <script src="../resources/testharnessreport.js"></script>
|
| + <script src="resources/audio-testing.js"></script>
|
| +</head>
|
| +
|
| +<body>
|
| + <script>
|
| + var context;
|
| + var audit = Audit.createTaskRunner();
|
| +
|
| + // Task: test AudioContextOptions (1).
|
| + audit.defineTask('test-audiocontextoptions-1', function (done) {
|
| +
|
| + // Verify that an AudioContext can be created with default options.
|
| + Should("context = new AudioContext()", function () {
|
| + context = new AudioContext();
|
| + }).notThrow();
|
| +
|
| + // Verify that an AudioContext can be created with the expected latency types.
|
| + Should("context = new AudioContext({'latencyHint': 'interactive'})", function () {
|
| + context = new AudioContext({'latencyHint': 'interactive'});
|
| + }).notThrow();
|
| + Should("context = new AudioContext({'latencyHint': 'balanced'})", function () {
|
| + context = new AudioContext({'latencyHint': 'balanced'});
|
| + }).notThrow();
|
| + Should("context = new AudioContext({'latencyHint': 'playback'})", function () {
|
| + context = new AudioContext({'latencyHint': 'playback'});
|
| + }).notThrow();
|
| +
|
| + // Verify that invalid latencyHint values are rejected.
|
| + Should("context = new AudioContext({'latencyHint': 'foo'})", function () {
|
| + context = new AudioContext({'latencyHint': 'foo'});
|
| + }).throw();
|
| +
|
| + // Verify that no extra options can be passed into the AudioContextOptions.
|
| + Should("context = new AudioContext('latencyHint')", function () {
|
| + context = new AudioContext('latencyHint');
|
| + }).throw();
|
| +
|
| + done();
|
| + });
|
| +
|
| + audit.runTasks();
|
| + </script>
|
| +</body>
|
| +</html>
|
|
|