Bug 1568579. Remove test-only uses of QueryInterface on Window objects. r=bholley

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Boris Zbarsky 2019-07-24 19:46:46 +00:00
Родитель 1b9a759258
Коммит a41e846699
2 изменённых файлов: 10 добавлений и 4 удалений

Просмотреть файл

@ -75,7 +75,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=500931
// Test QI on new dom bindings.
try {
var QIed = win.QueryInterface(Ci.nsIClassInfo);
var QIed = win.document.documentElement.QueryInterface(Ci.nsIClassInfo);
ok(false, "Should throw for new binding objects not having classinfo");
} catch(e) {
is(e.name, "NS_NOINTERFACE", "Threw while QI-ing on wrapper");

Просмотреть файл

@ -82,9 +82,15 @@ async function starttest(){
// QueryInterface and getPrivilegedProps tests
is(SpecialPowers.can_QI(SpecialPowers), false);
ok(SpecialPowers.can_QI(window));
ok(SpecialPowers.do_QueryInterface(window, "nsIDOMWindow"));
is(SpecialPowers.getPrivilegedProps(SpecialPowers.do_QueryInterface(window, "nsIDOMWindow"), "document.nodeName"), "#document");
let doc = SpecialPowers.wrap(document);
is(SpecialPowers.getPrivilegedProps(doc, "baseURIObject.fileName"), null,
"Should not have a fileName property yet");
let uri = SpecialPowers.getPrivilegedProps(doc, "baseURIObject");
ok(SpecialPowers.can_QI(uri));
ok(SpecialPowers.do_QueryInterface(uri, "nsIURL"));
is(SpecialPowers.getPrivilegedProps(doc, "baseURIObject.fileName"),
"test_SpecialPowersExtension.html",
"Should have a fileName property now");
//try to run garbage collection
SpecialPowers.gc();