| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <title>Checking window.audioWorklet</title> | 4 <title>Checking window.audioWorklet</title> |
| 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.js"></script> |
| 8 <script src="../resources/audio-testing.js"></script> | |
| 9 <script src="audioworklet-testing.js"></script> | 8 <script src="audioworklet-testing.js"></script> |
| 10 </head> | 9 </head> |
| 11 <body> | 10 <body> |
| 12 <script> | 11 <script> |
| 13 var audit = Audit.createTaskRunner(); | 12 // This test requires AudioWorklet. |
| 13 let audioWorkletStatus = isAudioWorkletEnabled(); |
| 14 | 14 |
| 15 audit.defineTask('window-audioworklet', function (taskDone) { | 15 let audit = Audit.createTaskRunner(); |
| 16 | 16 |
| 17 // TODO: remove this check if AudioWorklet ships to the stable. | 17 // Test if AudioWorklet exists. |
| 18 if (!checkInternalsAndAudioWorkletRuntimeFlag(taskDone)) | 18 audit.define({ |
| 19 return; | 19 label: 'window-audioworklet', |
| 20 description: 'Test if AudioWorklet exists.', |
| 21 }, (task, should) => { |
| 22 // TODO(hongchan): remove this assertion when AudioWorklet is shipped. |
| 23 should(audioWorkletStatus.onContentShell || |
| 24 audioWorkletStatus.onBrowser, |
| 25 'AudioWorklet is available on ContentShell or Browser') |
| 26 .beTrue(); |
| 20 | 27 |
| 21 Should('window.audioWorklet is an instance of Worklet', | 28 should(window.audioWorklet instanceof Worklet, |
| 22 window.audioWorklet instanceof Worklet).beEqualTo(true); | 29 'window.audioWorklet is an instance of Worklet') |
| 30 .beTrue(); |
| 23 | 31 |
| 24 taskDone(); | 32 task.done(); |
| 25 }); | 33 }); |
| 26 | 34 |
| 27 | 35 audit.run(); |
| 28 audit.runTasks(); | |
| 29 </script> | 36 </script> |
| 30 </body> | 37 </body> |
| 31 </html> | 38 </html> |
| OLD | NEW |