Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* @global internals, Should */ | 1 /** |
| 2 | 2 * Check if |window.internals| and |window.internals.runtimeFlags.AudioWorklet| |
| 3 // Check if |internals| and its |runtimeFlags.AudioWorklet| are available. | 3 * are available. |
| 4 // | 4 * |
| 5 // The content_shell driven by run-webkit-tests.py is supposed to enable | 5 * The content_shell driven by run-webkit-tests.py is supposed to enable all the |
| 6 // all the experimental web platform features. The flags are exposed via | 6 * experimental web platform features. The flags are exposed via |
| 7 // |internals.runtimeFlag|. | 7 * |internals.runtimeFlag|. |
| 8 // | 8 * |
| 9 // See: https://www.chromium.org/blink/runtime-enabled-features | 9 * See: https://www.chromium.org/blink/runtime-enabled-features |
| 10 function checkInternalsAndAudioWorkletRuntimeFlag(taskDone) { | 10 * |
| 11 | 11 * @return {Boolean} |
| 12 var isInternals = Should('window.internals', window.internals).exist(); | 12 */ |
| 13 | 13 function isAudioWorkletEnabled() { |
| 14 if (!isInternals) { | 14 return { |
| 15 taskDone(); | 15 onContentShell: Boolean(window.internals) && |
| 16 return false; | 16 Boolean(window.internals.runtimeFlags.audioWorkletEnabled), |
| 17 } | 17 onBrowser: Boolean(window.Worklet) && Boolean(window.audioWorklet) |
| 18 | 18 }; |
|
Raymond Toy
2017/02/22 19:16:22
Do we care if we're running with content shell or
hongchan
2017/02/22 19:23:38
When a test relies on some experimental features,
Raymond Toy
2017/02/22 19:31:29
YAGNI?
| |
| 19 var isFlag = Should('window.internals.runtimeFlags.audioWorkletEnabled', | |
| 20 window.internals.runtimeFlags.audioWorkletEnabled).beEqualTo(true); | |
| 21 | |
| 22 if (!isFlag) { | |
| 23 taskDone(); | |
| 24 } | |
| 25 | |
| 26 return isFlag; | |
| 27 } | 19 } |
| OLD | NEW |