Bug 1525554 - Fix "MojoInterfaceInterceptor is not defined" error; r=annevk
authorEdgar Chen <echen@mozilla.com>
Wed, 22 May 2019 14:14:18 +0000
changeset 474972 67cd5b8663cadce188e15fa2146bd875c17b82bd
parent 474971 b70f5f87bd30732d05d1f663b7b8c933ed242eef
child 474973 6d0bd1cdd4beabe88d1040e537b129ce364ffeee
push id36052
push userbtara@mozilla.com
push dateThu, 23 May 2019 04:37:46 +0000
treeherdermozilla-central@d12917561f27 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersannevk
bugs1525554
milestone69.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 1525554 - Fix "MojoInterfaceInterceptor is not defined" error; r=annevk which causes the promise being rejected and testharness reports error given that there are unhandled rejected promises Differential Revision: https://phabricator.services.mozilla.com/D32071
testing/web-platform/tests/generic-sensor/generic-sensor-tests.js
testing/web-platform/tests/mediacapture-image/resources/imagecapture-helpers.js
testing/web-platform/tests/shape-detection/resources/shapedetection-helpers.js
testing/web-platform/tests/webxr/resources/webxr_util.js
--- a/testing/web-platform/tests/generic-sensor/generic-sensor-tests.js
+++ b/testing/web-platform/tests/generic-sensor/generic-sensor-tests.js
@@ -2,17 +2,17 @@
 // platform sensor backends.
 //
 // In Chromium-based browsers this implementation is provided by a polyfill
 // in order to reduce the amount of test-only code shipped to users. To enable
 // these tests the browser must be run with these options:
 //
 //   --enable-blink-features=MojoJS,MojoJSTest
 let loadChromiumResources = Promise.resolve().then(() => {
-  if (!MojoInterfaceInterceptor) {
+  if (!('MojoInterfaceInterceptor' in self)) {
     // Do nothing on non-Chromium-based browsers or when the Mojo bindings are
     // not present in the global namespace.
     return;
   }
 
   let chain = Promise.resolve();
   [
     '/resources/chromium/mojo_bindings.js',
--- a/testing/web-platform/tests/mediacapture-image/resources/imagecapture-helpers.js
+++ b/testing/web-platform/tests/mediacapture-image/resources/imagecapture-helpers.js
@@ -5,17 +5,17 @@
 //
 // In Chromium-based browsers this implementation is provided by a polyfill
 // in order to reduce the amount of test-only code shipped to users. To enable
 // these tests the browser must be run with these options:
 //
 //   --enable-blink-features=MojoJS,MojoJSTest
 
 let loadChromiumResources = Promise.resolve().then(() => {
-  if (!MojoInterfaceInterceptor) {
+  if (!('MojoInterfaceInterceptor' in self)) {
     // Do nothing on non-Chromium-based browsers or when the Mojo bindings are
     // not present in the global namespace.
     return;
   }
 
   let chain = Promise.resolve();
   [
     '/resources/chromium/mojo_bindings.js',
--- a/testing/web-platform/tests/shape-detection/resources/shapedetection-helpers.js
+++ b/testing/web-platform/tests/shape-detection/resources/shapedetection-helpers.js
@@ -5,17 +5,17 @@
 //
 // In Chromium-based browsers this implementation is provided by a polyfill
 // in order to reduce the amount of test-only code shipped to users. To enable
 // these tests the browser must be run with these options:
 //
 //   --enable-blink-features=MojoJS,MojoJSTest
 
 let loadChromiumResources = Promise.resolve().then(() => {
-  if (!MojoInterfaceInterceptor) {
+  if (!('MojoInterfaceInterceptor' in self)) {
     // Do nothing on non-Chromium-based browsers or when the Mojo bindings are
     // not present in the global namespace.
     return;
   }
 
   const prefix = '/gen/services/shape_detection/public/mojom';
   let chain = Promise.resolve();
   [
--- a/testing/web-platform/tests/webxr/resources/webxr_util.js
+++ b/testing/web-platform/tests/webxr/resources/webxr_util.js
@@ -110,17 +110,17 @@ function forEachWebxrObject(callback) {
   callback(window.XRFrameOfReference, 'XRFrameOfReference');
   callback(window.XRStageBounds, 'XRStageBounds');
   callback(window.XRSessionEvent, 'XRSessionEvent');
   callback(window.XRCoordinateSystemEvent, 'XRCoordinateSystemEvent');
 }
 
 // Code for loading test api in chromium.
 let loadChromiumResources = Promise.resolve().then(() => {
-  if (!MojoInterfaceInterceptor) {
+  if (!('MojoInterfaceInterceptor' in self)) {
     // Do nothing on non-Chromium-based browsers or when the Mojo bindings are
     // not present in the global namespace.
     return;
   }
 
   let chain = Promise.resolve();
   ['/gen/layout_test_data/mojo/public/js/mojo_bindings.js',
    '/gen/mojo/public/mojom/base/time.mojom.js',