| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 | 2 |
| 3 <html> | 3 <html> |
| 4 <head> | 4 <head> |
| 5 <script src="../../resources/testharness.js"></script> | 5 <script src="../../resources/testharness.js"></script> |
| 6 <script src="../../resources/testharnessreport.js"></script> | 6 <script src="../../resources/testharnessreport.js"></script> |
| 7 <script src="../resources/audit-util.js"></script> | 7 <script src="../resources/audit-util.js"></script> |
| 8 <script src="../resources/audit.js"></script> | 8 <script src="../resources/audit.js"></script> |
| 9 </head> | 9 </head> |
| 10 | 10 |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 | 43 |
| 44 // Create an AudioNode from the stream. | 44 // Create an AudioNode from the stream. |
| 45 let mediaStreamSource = context.createMediaStreamSource(stream); | 45 let mediaStreamSource = context.createMediaStreamSource(stream); |
| 46 | 46 |
| 47 // Check number of inputs and outputs. | 47 // Check number of inputs and outputs. |
| 48 should(mediaStreamSource.numberOfInputs, 'mediaStreamSource.numberOfInputs') | 48 should(mediaStreamSource.numberOfInputs, 'mediaStreamSource.numberOfInputs') |
| 49 .beEqualTo(0); | 49 .beEqualTo(0); |
| 50 should(mediaStreamSource.numberOfOutputs, 'mediaStreamSource.numberOfOutputs') | 50 should(mediaStreamSource.numberOfOutputs, 'mediaStreamSource.numberOfOutputs') |
| 51 .beEqualTo(1); | 51 .beEqualTo(1); |
| 52 | 52 |
| 53 // Verify the same object is returned |
| 54 let element = mediaStreamSource.mediaStream; |
| 55 should(element instanceof MediaStream, |
| 56 'mediaStreamSource.mediaStream instanceof MediaStream') |
| 57 .beTrue(); |
| 58 should(mediaStreamSource.mediaStream === element, |
| 59 'mediaStreamSource.mediaStream is same object') |
| 60 .beTrue(); |
| 61 |
| 53 // Try calling connect() method with illegal values. | 62 // Try calling connect() method with illegal values. |
| 54 should( | 63 should( |
| 55 () => mediaStreamSource.connect(0, 0, 0), | 64 () => mediaStreamSource.connect(0, 0, 0), |
| 56 'mediaStreamSource.connect(0, 0, 0)') | 65 'mediaStreamSource.connect(0, 0, 0)') |
| 57 .throw(); | 66 .throw(); |
| 58 should( | 67 should( |
| 59 () => mediaStreamSource.connect(context.destination, 5, 0), | 68 () => mediaStreamSource.connect(context.destination, 5, 0), |
| 60 'mediaStreamSource.connect(context.destination, 5, 0)') | 69 'mediaStreamSource.connect(context.destination, 5, 0)') |
| 61 .throw(); | 70 .throw(); |
| 62 should( | 71 should( |
| 63 () => mediaStreamSource.connect(context.destination, 0, 5), | 72 () => mediaStreamSource.connect(context.destination, 0, 5), |
| 64 'mediaStreamSource.connect(context.destination, 0, 5)') | 73 'mediaStreamSource.connect(context.destination, 0, 5)') |
| 65 .throw(); | 74 .throw(); |
| 66 | 75 |
| 67 // Try calling connect() with proper values. | 76 // Try calling connect() with proper values. |
| 68 should( | 77 should( |
| 69 () => mediaStreamSource.connect(context.destination, 0, 0), | 78 () => mediaStreamSource.connect(context.destination, 0, 0), |
| 70 'mediaStreamSource.connect(context.destination, 0, 0)') | 79 'mediaStreamSource.connect(context.destination, 0, 0)') |
| 71 .notThrow(); | 80 .notThrow(); |
| 72 } | 81 } |
| 73 | 82 |
| 74 | 83 |
| 75 </script> | 84 </script> |
| 76 | 85 |
| 77 </body> | 86 </body> |
| 78 </html> | 87 </html> |
| OLD | NEW |