зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1274708 Use Context.jsonStringify() in connectNative r=kmag
MozReview-Commit-ID: J7q49nLg4F3 --HG-- extra : rebase_source : 9bdddffa43811fdff10fa75ea77bc0641012c9a3
This commit is contained in:
Родитель
8bf4c1d66e
Коммит
cedc1d8eaf
|
@ -267,7 +267,7 @@ this.NativeApp = class extends EventEmitter {
|
|||
|
||||
let json;
|
||||
try {
|
||||
json = JSON.stringify(msg);
|
||||
json = this.context.jsonStringify(msg);
|
||||
} catch (err) {
|
||||
throw new this.context.cloneScope.Error(err.message);
|
||||
}
|
||||
|
|
|
@ -248,15 +248,14 @@ add_task(function* test_happy_path() {
|
|||
what: "object with several properties",
|
||||
},
|
||||
|
||||
// enable with bug 1274708
|
||||
//{
|
||||
// data: {
|
||||
// ignoreme: true,
|
||||
// _json: {data: "i have a tojson method"},
|
||||
// },
|
||||
// expected: {data: "i have a tojson method"},
|
||||
// what: "object with toJSON() method",
|
||||
//},
|
||||
{
|
||||
data: {
|
||||
ignoreme: true,
|
||||
_json: {data: "i have a tojson method"},
|
||||
},
|
||||
expected: {data: "i have a tojson method"},
|
||||
what: "object with toJSON() method",
|
||||
},
|
||||
];
|
||||
for (let test of tests) {
|
||||
extension.sendMessage("send", test.data);
|
||||
|
|
|
@ -70,9 +70,13 @@ add_task(function* setup() {
|
|||
notEqual(PYTHON, null, "Found a suitable python interpreter");
|
||||
});
|
||||
|
||||
let global = this;
|
||||
|
||||
// Test of HostManifestManager.lookupApplication() begin here...
|
||||
let context = {
|
||||
url: null,
|
||||
jsonStringify(...args) { return JSON.stringify(...args); },
|
||||
cloneScope: global,
|
||||
logError() {},
|
||||
preprocessors: {},
|
||||
callOnClose: () => {},
|
||||
|
|
Загрузка…
Ссылка в новой задаче