Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 | 2 |
| 3 <html> | 3 <html> |
| 4 <head> | 4 <head> |
| 5 <script src="../../resources/js-test.js"></script> | 5 <script src="../../resources/testharness.js"></script> |
| 6 <script src="../../resources/testharnessreport.js"></script> | |
| 6 <script src="../resources/audit-util.js"></script> | 7 <script src="../resources/audit-util.js"></script> |
| 7 <script src="../resources/audio-testing.js"></script> | 8 <script src="../resources/audit.js"></script> |
| 8 </head> | 9 </head> |
| 9 | 10 |
| 10 <body> | 11 <body> |
| 11 <div id="description"></div> | 12 <script> |
| 12 <div id="console"></div> | 13 let audit = Audit.createTaskRunner(); |
| 13 | 14 |
| 14 <script> | 15 // See commit f9ee75e05745abb299dd8a336d8aa28afd2f5c26 for an explanation of |
| 15 description("Tests garbage collection of MediaElementAudioSourceNode."); | 16 // what this is testing. |
| 17 audit.define( | |
| 18 { | |
| 19 label: 'test', | |
| 20 description: 'Garbage collection of MediaElementAudioSourceNode' | |
| 21 }, | |
| 22 (task, should) => { | |
| 16 | 23 |
| 17 function runTest() { | 24 audioElement = document.createElement('audio'); |
| 18 if (window.testRunner) { | 25 context = new OfflineAudioContext(1, 1000, 44100); |
| 19 testRunner.dumpAsText(); | 26 source = context.createMediaElementSource(audioElement); |
| 20 } | 27 audioElement = null; |
| 28 context = null; | |
| 29 source = null; | |
| 30 gc(); | |
|
hongchan
2017/02/24 23:32:26
It will cause 'undefined' if this test runs on the
Raymond Toy
2017/02/24 23:36:58
The original did the same, so I didn't change that
hongchan
2017/02/24 23:45:21
Clarifying somehow the test is not designed for th
| |
| 21 | 31 |
| 22 audioElement = document.createElement("audio"); | 32 should(true, 'MediaElementAudioSourceNode garbage collected') |
| 23 context = new OfflineAudioContext(1, 1000, 44100); | 33 .message('with no ASSERTS', ''); |
| 24 source = context.createMediaElementSource(audioElement); | |
| 25 audioElement = null; | |
| 26 context = null; | |
| 27 source = null; | |
| 28 gc(); | |
| 29 | 34 |
| 30 testPassed("MediaElementAudioSourceNode survived garbage collection."); | 35 task.done(); |
| 36 }); | |
| 31 | 37 |
| 32 finishJSTest(); | 38 audit.run(); |
| 33 } | |
| 34 | |
| 35 runTest(); | |
| 36 | |
| 37 </script> | 39 </script> |
| 38 | 40 |
| 39 </body> | 41 </body> |
| 40 </html> | 42 </html> |
| OLD | NEW |