Bug 1398601 - Fix devtools browser_gcli_async test draft
authorTed Campbell <tcampbell@mozilla.com>
Wed, 13 Sep 2017 14:20:28 -0400
changeset 664081 cebdd9b2872b4b7d65caa4b5e82cc9077ff27a35
parent 662645 e8618ba6a5d03b85d386773addd99665ba03fc4b
child 664082 ae66d061f6358df228a7bcfabb9f193acb303492
push id79624
push userbmo:tcampbell@mozilla.com
push dateWed, 13 Sep 2017 18:23:23 +0000
bugs1398601
milestone57.0a1
Bug 1398601 - Fix devtools browser_gcli_async test This test has encoding issues that accidently worked before. The mockCommands.js file was loaded under two different encodings, but previously the cache would always return the first encoding. MozReview-Commit-ID: GE9BFy2RkqL
devtools/client/commandline/test/browser_gcli_async.js
devtools/client/commandline/test/head.js
--- a/devtools/client/commandline/test/browser_gcli_async.js
+++ b/devtools/client/commandline/test/browser_gcli_async.js
@@ -47,17 +47,17 @@ exports.testBasic = function (options) {
       check: {
         input:  "tsslow ",
         hints:         "Shalom",
         markup: "VVVVVVV",
         cursor: 7,
         current: "hello",
         status: "ERROR",
         predictions: [
-          "Shalom", "Namasté", "Hallo", "Dydd-da", "Chào", "Hej",
+          "Shalom", "Namast\u{00E9}", "Hallo", "Dydd-da", "Ch\u{00E0}o", "Hej",
           "Saluton", "Sawubona"
         ],
         unassigned: [ ],
         args: {
           command: { name: "tsslow" },
           hello: {
             arg: "",
             status: "INCOMPLETE"
@@ -69,17 +69,17 @@ exports.testBasic = function (options) {
       setup:    "tsslow S",
       check: {
         input:  "tsslow S",
         hints:          "halom",
         markup: "VVVVVVVI",
         cursor: 8,
         current: "hello",
         status: "ERROR",
-        predictions: [ "Shalom", "Saluton", "Sawubona", "Namasté" ],
+        predictions: [ "Shalom", "Saluton", "Sawubona", "Namast\u{00E9}" ],
         unassigned: [ ],
         args: {
           command: { name: "tsslow" },
           hello: {
             arg: " S",
             status: "INCOMPLETE"
           },
         }
--- a/devtools/client/commandline/test/head.js
+++ b/devtools/client/commandline/test/head.js
@@ -12,17 +12,17 @@ const TEST_BASE_HTTPS = "https://example
 
 var { require } = Cu.import("resource://devtools/shared/Loader.jsm", {});
 var { console } = require("resource://gre/modules/Console.jsm");
 var flags = require("devtools/shared/flags");
 
 // Import the GCLI test helper
 var testDir = gTestPath.substr(0, gTestPath.lastIndexOf("/"));
 Services.scriptloader.loadSubScript(testDir + "/helpers.js", this);
-Services.scriptloader.loadSubScript(testDir + "/mockCommands.js", this);
+Services.scriptloader.loadSubScript(testDir + "/mockCommands.js", this, "UTF-8");
 
 flags.testing = true;
 SimpleTest.registerCleanupFunction(() => {
   flags.testing = false;
 });
 
 function whenDelayedStartupFinished(aWindow, aCallback) {
   Services.obs.addObserver(function observer(aSubject, aTopic) {