Bug 1518969: Restore TextEncoder import in talos's api.js file. r=Standard8
authorDaniel Holbert <dholbert@cs.stanford.edu>
Fri, 11 Jan 2019 11:40:36 +0000
changeset 453522 24b9c0eb34c0
parent 453516 b5b1f341206d
child 453523 025feea5945b
push id35360
push usernbeleuzu@mozilla.com
push dateSat, 12 Jan 2019 09:39:47 +0000
treeherdermozilla-central@cb35977ae7a4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersStandard8
bugs1518969, 1415483
milestone66.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 1518969: Restore TextEncoder import in talos's api.js file. r=Standard8 This line was removed by mistake in Bug 1415483. I'm restoring it along with a eslint-rule-disabling comment that we now need (as of that same bug). Differential Revision: https://phabricator.services.mozilla.com/D16235
testing/talos/talos/talos-powers/api.js
--- a/testing/talos/talos/talos-powers/api.js
+++ b/testing/talos/talos/talos-powers/api.js
@@ -11,16 +11,24 @@ XPCOMUtils.defineLazyModuleGetters(this,
   Services: "resource://gre/modules/Services.jsm",
   PerTestCoverageUtils: "resource://testing-common/PerTestCoverageUtils.jsm",
 });
 
 XPCOMUtils.defineLazyServiceGetter(this, "resProto",
                                    "@mozilla.org/network/protocol;1?name=resource",
                                    "nsISubstitutingProtocolHandler");
 
+// To support the 'new TextEncoder()' call inside of 'profilerFinish()' here,
+// we have to import TextEncoder.  It's not automagically defined for us,
+// because we are in a child process, because we are an extension. See second
+// category in https://bugzilla.mozilla.org/show_bug.cgi?id=1501127#c2
+//
+// eslint-disable-next-line mozilla/reject-importGlobalProperties
+Cu.importGlobalProperties(["TextEncoder"]);
+
 const Cm = Components.manager.QueryInterface(Ci.nsIComponentRegistrar);
 
 let frameScriptURL;
 
 function TalosPowersService() {
   this.wrappedJSObject = this;
 
   this.init();