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
--- 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) {