Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(212)

Unified Diff: third_party/WebKit/LayoutTests/webaudio/audioworklet/audioworklet-testing.js

Issue 2711593004: Convert window-audioworklet.html with new Audit (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/webaudio/audioworklet/window-audioworklet.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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?
}
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/webaudio/audioworklet/window-audioworklet.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698