mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 23:31:56 +00:00
Bug 1545851, part 1 - Change test_process_directives.js to use nsIProperty. r=froydnj
This will let us make nsISupportsString builtinclass. Differential Revision: https://phabricator.services.mozilla.com/D28286 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
bcdbd607cf
commit
19c1077e83
@ -7,15 +7,12 @@ function TestProcessDirective() {}
|
||||
TestProcessDirective.prototype = {
|
||||
|
||||
/* Boilerplate */
|
||||
QueryInterface: ChromeUtils.generateQI([Ci.nsISupportsString]),
|
||||
QueryInterface: ChromeUtils.generateQI([Ci.nsIProperty]),
|
||||
contractID: "@mozilla.org/xpcom/tests/ChildProcessDirectiveTest;1",
|
||||
classID: Components.ID("{4bd1ba60-45c4-11e4-916c-0800200c9a66}"),
|
||||
|
||||
type: Ci.nsISupportsString.TYPE_STRING,
|
||||
data: "child process",
|
||||
toString() {
|
||||
return this.data;
|
||||
},
|
||||
name: "child process",
|
||||
value: "some value",
|
||||
};
|
||||
|
||||
this.NSGetFactory = XPCOMUtils.generateNSGetFactory([TestProcessDirective]);
|
||||
|
@ -7,15 +7,12 @@ function TestProcessDirective() {}
|
||||
TestProcessDirective.prototype = {
|
||||
|
||||
/* Boilerplate */
|
||||
QueryInterface: ChromeUtils.generateQI([Ci.nsISupportsString]),
|
||||
QueryInterface: ChromeUtils.generateQI([Ci.nsIProperty]),
|
||||
contractID: "@mozilla.org/xpcom/tests/MainProcessDirectiveTest;1",
|
||||
classID: Components.ID("{9b6f4160-45be-11e4-916c-0800200c9a66}"),
|
||||
|
||||
type: Ci.nsISupportsString.TYPE_STRING,
|
||||
data: "main process",
|
||||
toString() {
|
||||
return this.data;
|
||||
},
|
||||
name: "main process",
|
||||
value: "some value",
|
||||
};
|
||||
|
||||
this.NSGetFactory = XPCOMUtils.generateNSGetFactory([TestProcessDirective]);
|
||||
|
@ -8,14 +8,14 @@ function run_test() {
|
||||
if (isChild) {
|
||||
Assert.equal(false, "@mozilla.org/xpcom/tests/MainProcessDirectiveTest;1" in Cc);
|
||||
} else {
|
||||
let svc = Cc["@mozilla.org/xpcom/tests/MainProcessDirectiveTest;1"].createInstance(Ci.nsISupportsString);
|
||||
Assert.equal(svc.data, "main process");
|
||||
let svc = Cc["@mozilla.org/xpcom/tests/MainProcessDirectiveTest;1"].createInstance(Ci.nsIProperty);
|
||||
Assert.equal(svc.name, "main process");
|
||||
}
|
||||
|
||||
if (!isChild) {
|
||||
Assert.equal(false, "@mozilla.org/xpcom/tests/ChildProcessDirectiveTest;1" in Cc);
|
||||
} else {
|
||||
let svc = Cc["@mozilla.org/xpcom/tests/ChildProcessDirectiveTest;1"].createInstance(Ci.nsISupportsString);
|
||||
Assert.equal(svc.data, "child process");
|
||||
let svc = Cc["@mozilla.org/xpcom/tests/ChildProcessDirectiveTest;1"].createInstance(Ci.nsIProperty);
|
||||
Assert.equal(svc.name, "child process");
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user