Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/webaudio/audioworklet/audioworklet-testing.js |
| diff --git a/third_party/WebKit/LayoutTests/webaudio/audioworklet/audioworklet-testing.js b/third_party/WebKit/LayoutTests/webaudio/audioworklet/audioworklet-testing.js |
| index 4553fa30ba02995cb1000d433af2651e02b024a0..f239ff34d24f653ec781be08b34c619ec52f5af4 100644 |
| --- a/third_party/WebKit/LayoutTests/webaudio/audioworklet/audioworklet-testing.js |
| +++ b/third_party/WebKit/LayoutTests/webaudio/audioworklet/audioworklet-testing.js |
| @@ -1,27 +1,19 @@ |
| -/* @global internals, Should */ |
| - |
| -// Check if |internals| and its |runtimeFlags.AudioWorklet| are available. |
| -// |
| -// The content_shell driven by run-webkit-tests.py is supposed to enable |
| -// all the experimental web platform features. The flags are exposed via |
| -// |internals.runtimeFlag|. |
| -// |
| -// See: https://www.chromium.org/blink/runtime-enabled-features |
| -function checkInternalsAndAudioWorkletRuntimeFlag(taskDone) { |
| - |
| - var isInternals = Should('window.internals', window.internals).exist(); |
| - |
| - if (!isInternals) { |
| - taskDone(); |
| - return false; |
| - } |
| - |
| - var isFlag = Should('window.internals.runtimeFlags.audioWorkletEnabled', |
| - window.internals.runtimeFlags.audioWorkletEnabled).beEqualTo(true); |
| - |
| - if (!isFlag) { |
| - taskDone(); |
| - } |
| - |
| - return isFlag; |
| +/** |
| + * Check if |window.internals| and |window.internals.runtimeFlags.AudioWorklet| |
| + * are available. |
| + * |
| + * The content_shell driven by run-webkit-tests.py is supposed to enable all the |
| + * experimental web platform features. The flags are exposed via |
| + * |internals.runtimeFlag|. |
| + * |
| + * See: https://www.chromium.org/blink/runtime-enabled-features |
| + * |
| + * @return {Boolean} |
| + */ |
| +function isAudioWorkletEnabled() { |
| + return { |
| + onContentShell: Boolean(window.internals) && |
| + Boolean(window.internals.runtimeFlags.audioWorkletEnabled), |
| + onBrowser: Boolean(window.Worklet) && Boolean(window.audioWorklet) |
| + }; |
|
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?
|
| } |