Bug 1442313 part 4. Use getJSTestingFunctions() in test_worker_interfaces.js. r=luke
☠☠ backed out by accb1b3cf593 ☠ ☠
authorBoris Zbarsky <bzbarsky@mit.edu>
Thu, 01 Mar 2018 14:24:20 -0500
changeset 406080 bfef9139500f8f47e456f0190da6a8e372c01bd3
parent 406079 660332ce1bf08699ce4cbf9aa50a7921850a1cd0
child 406081 b89286a885886784f8fa728e2652bed07362935c
push id100362
push userbzbarsky@mozilla.com
push dateThu, 01 Mar 2018 20:29:12 +0000
treeherdermozilla-inbound@b89286a88588 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersluke
bugs1442313
milestone60.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1442313 part 4. Use getJSTestingFunctions() in test_worker_interfaces.js. r=luke MozReview-Commit-ID: IUQQX3ixkgl
dom/workers/test/test_worker_interfaces.js
--- a/dom/workers/test/test_worker_interfaces.js
+++ b/dom/workers/test/test_worker_interfaces.js
@@ -71,21 +71,17 @@ var ecmaGlobals =
     {name: "TypeError", insecureContext: true},
     {name: "Uint16Array", insecureContext: true},
     {name: "Uint32Array", insecureContext: true},
     {name: "Uint8Array", insecureContext: true},
     {name: "Uint8ClampedArray", insecureContext: true},
     {name: "URIError", insecureContext: true},
     {name: "WeakMap", insecureContext: true},
     {name: "WeakSet", insecureContext: true},
-    // WebAssembly is not supported on some hardware configurations,
-    // but we have no way to check that from here.  Just give up for
-    // now and don't check for it at all.  Do NOT add any other uses
-    // of "optional"!
-    {name: "WebAssembly", insecureContext: true, optional: true},
+    {name: "WebAssembly", insecureContext: true, disabled: !getJSTestingFunctions().wasmIsSupportedByHardware()},
   ];
 // IMPORTANT: Do not change the list above without review from
 //            a JavaScript Engine peer!
 
 // IMPORTANT: Do not change the list below without review from a DOM peer!
 var interfaceNamesInGlobalScope =
   [
 // IMPORTANT: Do not change this list without review from a DOM peer!
@@ -286,18 +282,16 @@ function createInterfaceMap(version, use
 	    // The insecureContext test is very purposefully converting
 	    // entry.insecureContext to boolean, so undefined will convert to
 	    // false.  That way entries without an insecureContext annotation
 	    // will get treated as "insecureContext: false", which means exposed
 	    // only in secure contexts.
             (isInsecureContext && !Boolean(entry.insecureContext)) ||
             entry.disabled) {
           interfaceMap[entry.name] = false;
-        } else if (entry.optional) {
-          interfaceMap[entry.name] = "optional";
         } else {
           interfaceMap[entry.name] = true;
         }
       }
     }
   }
 
   addInterfaces(ecmaGlobals);
@@ -308,31 +302,27 @@ function createInterfaceMap(version, use
 
 function runTest(version, userAgent) {
   var interfaceMap = createInterfaceMap(version, userAgent);
   for (var name of Object.getOwnPropertyNames(self)) {
     // An interface name should start with an upper case character.
     if (!/^[A-Z]/.test(name)) {
       continue;
     }
-    ok(interfaceMap[name] === "optional" || interfaceMap[name],
+    ok(interfaceMap[name],
        "If this is failing: DANGER, are you sure you want to expose the new interface " + name +
        " to all webpages as a property on the worker? Do not make a change to this file without a " +
        " review from a DOM peer for that specific change!!! (or a JS peer for changes to ecmaGlobals)");
     delete interfaceMap[name];
   }
   for (var name of Object.keys(interfaceMap)) {
-    if (interfaceMap[name] === "optional") {
+    ok(name in self === interfaceMap[name],
+       name + " should " + (interfaceMap[name] ? "" : " NOT") + " be defined on the global scope");
+    if (!interfaceMap[name]) {
       delete interfaceMap[name];
-    } else {
-      ok(name in self === interfaceMap[name],
-         name + " should " + (interfaceMap[name] ? "" : " NOT") + " be defined on the global scope");
-      if (!interfaceMap[name]) {
-        delete interfaceMap[name];
-      }
     }
   }
   is(Object.keys(interfaceMap).length, 0,
      "The following interface(s) are not enumerated: " + Object.keys(interfaceMap).join(", "));
 }
 
 workerTestGetVersion(function(version) {
   workerTestGetUserAgent(function(userAgent) {