Bug 1545819 - nsI-ify some XPCOM test interfaces in NotXPCOMTest.idl. r=froydnj

Differential Revision: https://phabricator.services.mozilla.com/D28237

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Andrew McCreight 2019-04-19 19:19:27 +00:00
parent af20a470c6
commit 3b1ec85b01
2 changed files with 14 additions and 14 deletions

View File

@ -5,19 +5,19 @@
#include "nsISupports.idl"
[scriptable, uuid(93142a4f-e4cf-424a-b833-e638f87d2607)]
interface ScriptableOK : nsISupports
interface nsIScriptableOK : nsISupports
{
void method1();
};
[scriptable, uuid(237d01a3-771e-4c6e-adf9-c97f9aab2950)]
interface ScriptableWithNotXPCOM : nsISupports
interface nsIScriptableWithNotXPCOM : nsISupports
{
[notxpcom] void method2();
};
[scriptable, uuid(4f06ec60-3bb3-4712-ab18-b2b595285558)]
interface ScriptableWithNotXPCOMBase : ScriptableWithNotXPCOM
interface nsIScriptableWithNotXPCOMBase : nsIScriptableWithNotXPCOM
{
void method3();
};

View File

@ -9,14 +9,14 @@ const kContract = "@testing/notxpcomtest";
function run_test() {
let registrar = Components.manager.QueryInterface(Ci.nsIComponentRegistrar);
ok(Ci.ScriptableWithNotXPCOM);
ok(Ci.nsIScriptableWithNotXPCOM);
let method1Called = false;
let testObject = {
QueryInterface: ChromeUtils.generateQI([Ci.ScriptableOK,
Ci.ScriptableWithNotXPCOM,
Ci.ScriptableWithNotXPCOMBase]),
QueryInterface: ChromeUtils.generateQI([Ci.nsIScriptableOK,
Ci.nsIScriptableWithNotXPCOM,
Ci.nsIScriptableWithNotXPCOMBase]),
method1() {
method1Called = true;
@ -50,24 +50,24 @@ function run_test() {
ok(xpcomObject);
strictEqual(xpcomObject.jsonly, undefined);
xpcomObject.QueryInterface(Ci.ScriptableOK);
xpcomObject.QueryInterface(Ci.nsIScriptableOK);
xpcomObject.method1();
ok(method1Called);
try {
xpcomObject.QueryInterface(Ci.ScriptableWithNotXPCOM);
ok(false, "Should not have implemented ScriptableWithNotXPCOM");
xpcomObject.QueryInterface(Ci.nsIScriptableWithNotXPCOM);
ok(false, "Should not have implemented nsIScriptableWithNotXPCOM");
} catch (e) {
ok(true, "Should not have implemented ScriptableWithNotXPCOM. Correctly threw error: " + e);
ok(true, "Should not have implemented nsIScriptableWithNotXPCOM. Correctly threw error: " + e);
}
strictEqual(xpcomObject.method2, undefined);
try {
xpcomObject.QueryInterface(Ci.ScriptableWithNotXPCOMBase);
ok(false, "Should not have implemented ScriptableWithNotXPCOMBase");
xpcomObject.QueryInterface(Ci.nsIScriptableWithNotXPCOMBase);
ok(false, "Should not have implemented nsIScriptableWithNotXPCOMBase");
} catch (e) {
ok(true, "Should not have implemented ScriptableWithNotXPCOMBase. Correctly threw error: " + e);
ok(true, "Should not have implemented nsIScriptableWithNotXPCOMBase. Correctly threw error: " + e);
}
strictEqual(xpcomObject.method3, undefined);
}