Index: third_party/WebKit/LayoutTests/webaudio/MediaStreamAudioSource/mediastreamaudiosourcenode.html |
diff --git a/third_party/WebKit/LayoutTests/webaudio/MediaStreamAudioSource/mediastreamaudiosourcenode.html b/third_party/WebKit/LayoutTests/webaudio/MediaStreamAudioSource/mediastreamaudiosourcenode.html |
index 998492dc0890353e64b4b97d8cdc72100ff81f47..177d21ae474023aea0c63cc7524de0e2a06d3cfb 100644 |
--- a/third_party/WebKit/LayoutTests/webaudio/MediaStreamAudioSource/mediastreamaudiosourcenode.html |
+++ b/third_party/WebKit/LayoutTests/webaudio/MediaStreamAudioSource/mediastreamaudiosourcenode.html |
@@ -1,87 +1,91 @@ |
<!DOCTYPE html> |
- |
<html> |
-<head> |
-<script src="../../resources/testharness.js"></script> |
-<script src="../../resources/testharnessreport.js"></script> |
-<script src="../resources/audit-util.js"></script> |
-<script src="../resources/audit.js"></script> |
-</head> |
- |
-<body> |
-<script> |
-let audit = Audit.createTaskRunner(); |
- |
-audit.define( |
- { |
- label: 'test', |
- description: 'Basic tests for MediaStreamAudioSourceNode API' |
- }, |
- (task, should) => { |
- should( |
- () => {navigator.webkitGetUserMedia( |
- {audio: true}, |
- (stream) => { |
- gotStream(stream, should); |
- task.done(); |
- }, |
- () => { |
- should(false, 'Stream generation') |
- .message('succeeded', 'failed'); |
- task.done(); |
- })}, |
- 'getUserMedia()') |
- .notThrow(); |
- }); |
- |
-audit.run(); |
- |
-function gotStream(stream, should) { |
- should(true, '{audio:true} generated stream').message('correctly', ''); |
+ <head> |
+ <title> |
+ mediastreamaudiosourcenode.html |
+ </title> |
+ <script src="../../resources/testharness.js"></script> |
+ <script src="../../resources/testharnessreport.js"></script> |
+ <script src="../resources/audit-util.js"></script> |
+ <script src="../resources/audit.js"></script> |
+ </head> |
+ <body> |
+ <script id="layout-test-code"> |
+ let audit = Audit.createTaskRunner(); |
- let context = new AudioContext(); |
+ audit.define( |
+ { |
+ label: 'test', |
+ description: 'Basic tests for MediaStreamAudioSourceNode API' |
+ }, |
+ (task, should) => { |
+ should( |
+ () => {navigator.webkitGetUserMedia( |
+ {audio: true}, |
+ (stream) => { |
+ gotStream(stream, should); |
+ task.done(); |
+ }, |
+ () => { |
+ should(false, 'Stream generation') |
+ .message('succeeded', 'failed'); |
+ task.done(); |
+ })}, |
+ 'getUserMedia()') |
+ .notThrow(); |
+ }); |
- // Create an AudioNode from the stream. |
- let mediaStreamSource = context.createMediaStreamSource(stream); |
+ audit.run(); |
- // Check number of inputs and outputs. |
- should(mediaStreamSource.numberOfInputs, 'mediaStreamSource.numberOfInputs') |
- .beEqualTo(0); |
- should(mediaStreamSource.numberOfOutputs, 'mediaStreamSource.numberOfOutputs') |
- .beEqualTo(1); |
+ function gotStream(stream, should) { |
+ should(true, '{audio:true} generated stream').message('correctly', ''); |
- // Verify the same object is returned |
- let element = mediaStreamSource.mediaStream; |
- should(element instanceof MediaStream, |
- 'mediaStreamSource.mediaStream instanceof MediaStream') |
- .beTrue(); |
- should(mediaStreamSource.mediaStream === element, |
- 'mediaStreamSource.mediaStream is same object') |
- .beTrue(); |
+ let context = new AudioContext(); |
- // Try calling connect() method with illegal values. |
- should( |
- () => mediaStreamSource.connect(0, 0, 0), |
- 'mediaStreamSource.connect(0, 0, 0)') |
- .throw(); |
- should( |
- () => mediaStreamSource.connect(context.destination, 5, 0), |
- 'mediaStreamSource.connect(context.destination, 5, 0)') |
- .throw(); |
- should( |
- () => mediaStreamSource.connect(context.destination, 0, 5), |
- 'mediaStreamSource.connect(context.destination, 0, 5)') |
- .throw(); |
+ // Create an AudioNode from the stream. |
+ let mediaStreamSource = context.createMediaStreamSource(stream); |
- // Try calling connect() with proper values. |
- should( |
- () => mediaStreamSource.connect(context.destination, 0, 0), |
- 'mediaStreamSource.connect(context.destination, 0, 0)') |
- .notThrow(); |
-} |
+ // Check number of inputs and outputs. |
+ should( |
+ mediaStreamSource.numberOfInputs, |
+ 'mediaStreamSource.numberOfInputs') |
+ .beEqualTo(0); |
+ should( |
+ mediaStreamSource.numberOfOutputs, |
+ 'mediaStreamSource.numberOfOutputs') |
+ .beEqualTo(1); |
+ // Verify the same object is returned |
+ let element = mediaStreamSource.mediaStream; |
+ should( |
+ element instanceof MediaStream, |
+ 'mediaStreamSource.mediaStream instanceof MediaStream') |
+ .beTrue(); |
+ should( |
+ mediaStreamSource.mediaStream === element, |
+ 'mediaStreamSource.mediaStream is same object') |
+ .beTrue(); |
-</script> |
+ // Try calling connect() method with illegal values. |
+ should( |
+ () => mediaStreamSource.connect(0, 0, 0), |
+ 'mediaStreamSource.connect(0, 0, 0)') |
+ .throw(); |
+ should( |
+ () => mediaStreamSource.connect(context.destination, 5, 0), |
+ 'mediaStreamSource.connect(context.destination, 5, 0)') |
+ .throw(); |
+ should( |
+ () => mediaStreamSource.connect(context.destination, 0, 5), |
+ 'mediaStreamSource.connect(context.destination, 0, 5)') |
+ .throw(); |
-</body> |
+ // Try calling connect() with proper values. |
+ should( |
+ () => mediaStreamSource.connect(context.destination, 0, 0), |
+ 'mediaStreamSource.connect(context.destination, 0, 0)') |
+ .notThrow(); |
+ } |
+ </script> |
+ </body> |
</html> |