mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 792036 - Automated fixups. r=mccr8
find /files/mozilla/build/d/_tests/testing/mochitest/tests/ | egrep "\.(xhtml|html|xml|js)$" | grep -v SimpleTest | grep -vi mochikit | grep -v simpleThread | grep -v test_ipc_messagemanager_blob.html | grep -v "indexedDB/test" | xargs grep -l Components | xargs grep -L enablePrivilege | perl -pe 's#.*mochitest/tests/##' | xargs perl -p -i.bakkk -e 's/Components\.interfaces(\s|;|\.|\[)/SpecialPowers\.Ci$1/g, s/SpecialPowers\.wrap\(Components\)\.(.)(lasses|tils|nterfaces|esults)/SpecialPowers.C$1/g, s/(?<![\.a-zA-Z])Components/SpecialPowers\.Components/g, s/window\.Components/window\.SpecialPowers\.Components/g'
This commit is contained in:
parent
c64d31c5e0
commit
5af5a73d3d
@ -18,10 +18,10 @@ Browser context menu tests.
|
||||
|
||||
/** Test for Login Manager: multiple login autocomplete. **/
|
||||
|
||||
SpecialPowers.wrap(Components).utils.import("resource://gre/modules/InlineSpellChecker.jsm", window);
|
||||
SpecialPowers.Cu.import("resource://gre/modules/InlineSpellChecker.jsm", window);
|
||||
|
||||
const Cc = Components.classes;
|
||||
const Ci = Components.interfaces;
|
||||
const Cc = SpecialPowers.Components.classes;
|
||||
const Ci = SpecialPowers.Ci;
|
||||
|
||||
function openContextMenuFor(element, shiftkey, shouldWaitForFocus) {
|
||||
// Context menu should be closed before we open it again.
|
||||
|
@ -26,7 +26,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=462856
|
||||
<script class="testbody" type="text/javascript">
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
const Cc = SpecialPowers.wrap(Components).classes;
|
||||
const Cc = SpecialPowers.Cc;
|
||||
|
||||
var numFinished = 0;
|
||||
|
||||
@ -36,17 +36,17 @@ window.addEventListener("message", function(event) {
|
||||
if (++numFinished == 3) {
|
||||
// Clean up after ourself
|
||||
var pm = Cc["@mozilla.org/permissionmanager;1"].
|
||||
getService(Components.interfaces.nsIPermissionManager);
|
||||
getService(SpecialPowers.Ci.nsIPermissionManager);
|
||||
var ioService = Cc["@mozilla.org/network/io-service;1"]
|
||||
.getService(Components.interfaces.nsIIOService);
|
||||
.getService(SpecialPowers.Ci.nsIIOService);
|
||||
var uri1 = ioService.newURI(frames.testFrame.location, null, null);
|
||||
var uri2 = ioService.newURI(frames.testFrame3.location, null, null);
|
||||
|
||||
var principal1 = Cc["@mozilla.org/scriptsecuritymanager;1"]
|
||||
.getService(Components.interfaces.nsIScriptSecurityManager)
|
||||
.getService(SpecialPowers.Ci.nsIScriptSecurityManager)
|
||||
.getNoAppCodebasePrincipal(uri1);
|
||||
var principal2 = Cc["@mozilla.org/scriptsecuritymanager;1"]
|
||||
.getService(Components.interfaces.nsIScriptSecurityManager)
|
||||
.getService(SpecialPowers.Ci.nsIScriptSecurityManager)
|
||||
.getNoAppCodebasePrincipal(uri2);
|
||||
|
||||
pm.removeFromPrincipal(principal1, "offline-app");
|
||||
@ -108,8 +108,8 @@ function loaded() {
|
||||
// Click the notification bar's "Allow" button. This should kick
|
||||
// off updates, which will eventually lead to getting messages from
|
||||
// the children.
|
||||
var wm = SpecialPowers.wrap(Components).classes["@mozilla.org/appshell/window-mediator;1"].
|
||||
getService(Components.interfaces.nsIWindowMediator);
|
||||
var wm = SpecialPowers.Cc["@mozilla.org/appshell/window-mediator;1"].
|
||||
getService(SpecialPowers.Ci.nsIWindowMediator);
|
||||
var win = wm.getMostRecentWindow("navigator:browser");
|
||||
var notificationBox = win.gBrowser.getNotificationBox();
|
||||
|
||||
|
@ -32,14 +32,14 @@ SimpleTest.waitForExplicitFinish();
|
||||
|
||||
function finishTest() {
|
||||
// Clean up after ourselves.
|
||||
var Cc = SpecialPowers.wrap(Components).classes;
|
||||
var Cc = SpecialPowers.Cc;
|
||||
var pm = Cc["@mozilla.org/permissionmanager;1"].
|
||||
getService(Components.interfaces.nsIPermissionManager);
|
||||
getService(SpecialPowers.Ci.nsIPermissionManager);
|
||||
|
||||
var uri = Cc["@mozilla.org/network/io-service;1"].getService(Components.interfaces.nsIIOService)
|
||||
var uri = Cc["@mozilla.org/network/io-service;1"].getService(SpecialPowers.Ci.nsIIOService)
|
||||
.newURI(window.frames[0].location, null, null);
|
||||
var principal = Cc["@mozilla.org/scriptsecuritymanager;1"]
|
||||
.getService(Components.interfaces.nsIScriptSecurityManager)
|
||||
.getService(SpecialPowers.Ci.nsIScriptSecurityManager)
|
||||
.getNoAppCodebasePrincipal(uri);
|
||||
|
||||
pm.removeFromPrincipal(principal, "offline-app");
|
||||
@ -99,8 +99,8 @@ function loaded() {
|
||||
// Click the notification bar's "Allow" button. This should kick
|
||||
// off updates, which will eventually lead to getting messages from
|
||||
// the iframe.
|
||||
var wm = SpecialPowers.wrap(Components).classes["@mozilla.org/appshell/window-mediator;1"].
|
||||
getService(Components.interfaces.nsIWindowMediator);
|
||||
var wm = SpecialPowers.Cc["@mozilla.org/appshell/window-mediator;1"].
|
||||
getService(SpecialPowers.Ci.nsIWindowMediator);
|
||||
var win = wm.getMostRecentWindow("navigator:browser");
|
||||
var notificationBox = win.gBrowser.getNotificationBox();
|
||||
|
||||
|
@ -50,14 +50,14 @@ function tryChromeLoad()
|
||||
|
||||
function tryComponentsClasses()
|
||||
{
|
||||
return Components.classes["@mozilla.org/dummy;1"];
|
||||
return SpecialPowers.Components.classes["@mozilla.org/dummy;1"];
|
||||
}
|
||||
|
||||
|
||||
is(inciteCaps(tryChromeLoad), "denied-stack",
|
||||
"should get stack for content-loading-chrome rejection");
|
||||
is(inciteCaps(tryComponentsClasses), "denied-stack",
|
||||
"should get stack for Components.classes rejection");
|
||||
"should get stack for SpecialPowers.Components.classes rejection");
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
|
@ -21,10 +21,10 @@ function runTests() {
|
||||
let tearDown = (function setUp() {
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
const {classes: Cc, interfaces: Ci} = SpecialPowers.wrap(Components);
|
||||
const {classes: Cc, interfaces: Ci} = SpecialPowers.wrap(SpecialPowers.Components);
|
||||
|
||||
let authMgr = Cc["@mozilla.org/network/http-auth-manager;1"]
|
||||
.getService(Components.interfaces.nsIHttpAuthManager)
|
||||
.getService(SpecialPowers.Ci.nsIHttpAuthManager)
|
||||
authMgr.setAuthIdentity("http", "example.com", 80, "basic", "testrealm",
|
||||
"", "example.com", "user1", "password1");
|
||||
|
||||
|
@ -16,7 +16,7 @@
|
||||
<script class="testbody" type="application/javascript;version=1.8">
|
||||
|
||||
function runTests() {
|
||||
var comp = SpecialPowers.wrap(Components);
|
||||
var comp = SpecialPowers.wrap(SpecialPowers.Components);
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
SpecialPowers.addPermission("systemXHR", true, document);
|
||||
|
||||
|
@ -21,19 +21,19 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=166235
|
||||
<script type="application/javascript">
|
||||
|
||||
/** Test for Bug 166235 **/
|
||||
var Cc = SpecialPowers.wrap(Components).classes;
|
||||
var Ci = SpecialPowers.wrap(Components).interfaces;
|
||||
var Cc = SpecialPowers.Cc;
|
||||
var Ci = SpecialPowers.Ci;
|
||||
|
||||
var webnav = SpecialPowers.wrap(window).QueryInterface(Components.interfaces.nsIInterfaceRequestor)
|
||||
.getInterface(Components.interfaces.nsIWebNavigation)
|
||||
var webnav = SpecialPowers.wrap(window).QueryInterface(SpecialPowers.Ci.nsIInterfaceRequestor)
|
||||
.getInterface(SpecialPowers.Ci.nsIWebNavigation)
|
||||
|
||||
var docShell = webnav.QueryInterface(Components.interfaces.nsIDocShell);
|
||||
var docShell = webnav.QueryInterface(SpecialPowers.Ci.nsIDocShell);
|
||||
|
||||
var documentViewer = docShell.contentViewer
|
||||
.QueryInterface(Components.interfaces.nsIContentViewerEdit);
|
||||
.QueryInterface(SpecialPowers.Ci.nsIContentViewerEdit);
|
||||
|
||||
var clipboard = Cc["@mozilla.org/widget/clipboard;1"]
|
||||
.getService(Components.interfaces.nsIClipboard);
|
||||
.getService(SpecialPowers.Ci.nsIClipboard);
|
||||
|
||||
var textarea = SpecialPowers.wrap(document).getElementById('input');
|
||||
|
||||
@ -54,7 +54,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=166235
|
||||
}
|
||||
function getClipboardData(mime) {
|
||||
var transferable = Cc['@mozilla.org/widget/transferable;1']
|
||||
.createInstance(Components.interfaces.nsITransferable);
|
||||
.createInstance(SpecialPowers.Ci.nsITransferable);
|
||||
transferable.init(getLoadContext());
|
||||
transferable.addDataFlavor(mime);
|
||||
clipboard.getData(transferable, 1);
|
||||
@ -65,7 +65,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=166235
|
||||
function testClipboardValue(mime, expected, test) {
|
||||
var data = getClipboardData(mime);
|
||||
is (data.value == null ? data.value :
|
||||
data.value.QueryInterface(Components.interfaces.nsISupportsString).data,
|
||||
data.value.QueryInterface(SpecialPowers.Ci.nsISupportsString).data,
|
||||
expected,
|
||||
mime + " value in the clipboard");
|
||||
return data.value;
|
||||
@ -73,7 +73,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=166235
|
||||
function testPasteText(expected, test) {
|
||||
textarea.value="";
|
||||
textarea.focus();
|
||||
textarea.QueryInterface(Components.interfaces.nsIDOMNSEditableElement)
|
||||
textarea.QueryInterface(SpecialPowers.Ci.nsIDOMNSEditableElement)
|
||||
.editor.paste(1);
|
||||
is(textarea.value, expected, test + ": textarea paste");
|
||||
}
|
||||
|
@ -32,11 +32,11 @@ function afterLoad() {
|
||||
iframeDoc.getElementById("password").value = "123456";
|
||||
iframeDoc.getElementById("hidden").value = "gecko";
|
||||
|
||||
var file = SpecialPowers.wrap(Components).classes["@mozilla.org/file/directory_service;1"]
|
||||
.getService(Components.interfaces.nsIProperties)
|
||||
.get("TmpD", Components.interfaces.nsILocalFile);
|
||||
var file = SpecialPowers.Cc["@mozilla.org/file/directory_service;1"]
|
||||
.getService(SpecialPowers.Ci.nsIProperties)
|
||||
.get("TmpD", SpecialPowers.Ci.nsILocalFile);
|
||||
file.append("345339_test.file");
|
||||
file.createUnique(Components.interfaces.nsIFile.NORMAL_FILE_TYPE, 0666);
|
||||
file.createUnique(SpecialPowers.Ci.nsIFile.NORMAL_FILE_TYPE, 0666);
|
||||
filePath = file.path;
|
||||
|
||||
SpecialPowers.wrap(iframeDoc).getElementById("file").value = filePath;
|
||||
|
@ -29,7 +29,7 @@ function checkTypes(aNode, aNodeType, aTypeArray)
|
||||
function checkInterfaces(aNode, aNodeType, aInterfaceArray)
|
||||
{
|
||||
for (var i = 0; i < aInterfaceArray.length; ++i) {
|
||||
ok(aNode instanceof Components.interfaces[aInterfaceArray[i]],
|
||||
ok(aNode instanceof SpecialPowers.Ci[aInterfaceArray[i]],
|
||||
aNodeType + " interface test " + i,
|
||||
aNodeType + " should be a " + aInterfaceArray[i]);
|
||||
}
|
||||
|
@ -53,7 +53,7 @@ function checkTypes(aNode, aNodeType, aTypeArray)
|
||||
function checkInterfaces(aNode, aNodeType, aInterfaceArray)
|
||||
{
|
||||
for (var i = 0; i < aInterfaceArray.length; ++i) {
|
||||
ok(aNode instanceof Components.interfaces[aInterfaceArray[i]],
|
||||
ok(aNode instanceof SpecialPowers.Ci[aInterfaceArray[i]],
|
||||
aNodeType + " interface test " + i,
|
||||
aNodeType + " should be a " + aInterfaceArray[i]);
|
||||
}
|
||||
|
@ -21,11 +21,11 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=375314
|
||||
|
||||
var lastContentType = -1;
|
||||
const testURL = window.location.href + "/this/is/the/test/url";
|
||||
const Cc = SpecialPowers.wrap(Components).classes;
|
||||
const Ci = Components.interfaces;
|
||||
const Cc = SpecialPowers.Cc;
|
||||
const Ci = SpecialPowers.Ci;
|
||||
|
||||
// Content policy / factory implementation for the test
|
||||
var policyID = SpecialPowers.wrap(Components).ID("{b80e19d0-878f-d41b-2654-194714a4115c}");
|
||||
var policyID = SpecialPowers.wrap(SpecialPowers.Components).ID("{b80e19d0-878f-d41b-2654-194714a4115c}");
|
||||
var policyName = "@mozilla.org/testpolicy;1";
|
||||
var policy = {
|
||||
// nsISupports implementation
|
||||
@ -37,7 +37,7 @@ var policy = {
|
||||
iid.equals(Ci.nsIContentPolicy))
|
||||
return this;
|
||||
|
||||
throw SpecialPowers.wrap(Components).results.NS_ERROR_NO_INTERFACE;
|
||||
throw SpecialPowers.Cr.NS_ERROR_NO_INTERFACE;
|
||||
},
|
||||
|
||||
// nsIFactory implementation
|
||||
@ -64,7 +64,7 @@ var policy = {
|
||||
}
|
||||
|
||||
// Register content policy
|
||||
var componentManager = SpecialPowers.wrap(Components).manager
|
||||
var componentManager = SpecialPowers.wrap(SpecialPowers.Components).manager
|
||||
.QueryInterface(Ci.nsIComponentRegistrar);
|
||||
|
||||
componentManager.registerFactory(policyID, "Test content policy", policyName, policy);
|
||||
|
@ -24,7 +24,7 @@ req.setRequestHeader("Content-Type", "text/plain; charset=us-ascii; boundary=012
|
||||
req.send("Some text");
|
||||
|
||||
is(SpecialPowers.wrap(req).channel
|
||||
.QueryInterface(Components.interfaces.nsIHttpChannel)
|
||||
.QueryInterface(SpecialPowers.Ci.nsIHttpChannel)
|
||||
.getRequestHeader("Content-Type"),
|
||||
"text/plain; charset=UTF-8; boundary=01234567890",
|
||||
"Headers should match");
|
||||
|
@ -25,7 +25,7 @@ req.setRequestHeader("Content-Type", "text/plain; charset='uTf-8'");
|
||||
req.send("Some text");
|
||||
|
||||
is(SpecialPowers.wrap(req).channel
|
||||
.QueryInterface(Components.interfaces.nsIHttpChannel)
|
||||
.QueryInterface(SpecialPowers.Ci.nsIHttpChannel)
|
||||
.getRequestHeader("Content-Type"),
|
||||
"text/plain; charset='uTf-8'",
|
||||
"Headers should match");
|
||||
|
@ -24,7 +24,7 @@ req.setRequestHeader("Content-Type", "text/plain; boundary=01234567890");
|
||||
req.send("Some text");
|
||||
|
||||
is(SpecialPowers.wrap(req).channel
|
||||
.QueryInterface(Components.interfaces.nsIHttpChannel)
|
||||
.QueryInterface(SpecialPowers.Ci.nsIHttpChannel)
|
||||
.getRequestHeader("Content-Type"),
|
||||
"text/plain; charset=UTF-8; boundary=01234567890",
|
||||
"Charset should come before boundary");
|
||||
|
@ -23,17 +23,17 @@ function loadFileContent(aFile, aCharset) {
|
||||
if(aCharset == undefined)
|
||||
aCharset = 'UTF-8';
|
||||
|
||||
var baseUri = SpecialPowers.wrap(Components).classes['@mozilla.org/network/standard-url;1']
|
||||
.createInstance(Components.interfaces.nsIURI);
|
||||
var baseUri = SpecialPowers.Cc['@mozilla.org/network/standard-url;1']
|
||||
.createInstance(SpecialPowers.Ci.nsIURI);
|
||||
baseUri.spec = window.location.href;
|
||||
|
||||
var ios = SpecialPowers.wrap(Components).classes['@mozilla.org/network/io-service;1']
|
||||
.getService(Components.interfaces.nsIIOService);
|
||||
var ios = SpecialPowers.Cc['@mozilla.org/network/io-service;1']
|
||||
.getService(SpecialPowers.Ci.nsIIOService);
|
||||
var chann = ios.newChannel(aFile, aCharset, baseUri);
|
||||
|
||||
var cis = Components.interfaces.nsIConverterInputStream;
|
||||
var cis = SpecialPowers.Ci.nsIConverterInputStream;
|
||||
|
||||
var inputStream = SpecialPowers.wrap(Components).classes["@mozilla.org/intl/converter-input-stream;1"]
|
||||
var inputStream = SpecialPowers.Cc["@mozilla.org/intl/converter-input-stream;1"]
|
||||
.createInstance(cis);
|
||||
inputStream.init(chann.open(), aCharset, 1024, cis.DEFAULT_REPLACEMENT_CHARACTER);
|
||||
var str = {}, content = '';
|
||||
@ -45,9 +45,9 @@ function loadFileContent(aFile, aCharset) {
|
||||
|
||||
|
||||
function testHtmlSerializer_1 () {
|
||||
const de = Components.interfaces.nsIDocumentEncoder
|
||||
var encoder = SpecialPowers.wrap(Components).classes["@mozilla.org/layout/documentEncoder;1?type=application/xhtml+xml"]
|
||||
.createInstance(Components.interfaces.nsIDocumentEncoder);
|
||||
const de = SpecialPowers.Ci.nsIDocumentEncoder
|
||||
var encoder = SpecialPowers.Cc["@mozilla.org/layout/documentEncoder;1?type=application/xhtml+xml"]
|
||||
.createInstance(SpecialPowers.Ci.nsIDocumentEncoder);
|
||||
|
||||
var doc = SpecialPowers.wrap($("testframe")).contentDocument;
|
||||
var out, expected;
|
||||
|
@ -19,8 +19,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=422537
|
||||
<script class="testbody" type="text/javascript">
|
||||
|
||||
/** Test for Bug 422537 **/
|
||||
var isupports_string = SpecialPowers.wrap(Components).classes["@mozilla.org/supports-string;1"]
|
||||
.createInstance(Components.interfaces.nsISupportsString);
|
||||
var isupports_string = SpecialPowers.Cc["@mozilla.org/supports-string;1"]
|
||||
.createInstance(SpecialPowers.Ci.nsISupportsString);
|
||||
isupports_string.data = "foo";
|
||||
|
||||
const url = "http://mochi.test:8888";
|
||||
@ -38,13 +38,13 @@ for each (var i in body) {
|
||||
else
|
||||
xhr.send(i);
|
||||
var chan = SpecialPowers.wrap(xhr).channel;
|
||||
if (!SpecialPowers.call_Instanceof(chan, Components.interfaces.nsIUploadChannel))
|
||||
if (!SpecialPowers.call_Instanceof(chan, SpecialPowers.Ci.nsIUploadChannel))
|
||||
throw "Must be an upload channel";
|
||||
var stream = chan.uploadStream;
|
||||
if (!stream || !SpecialPowers.call_Instanceof(stream, Components.interfaces.nsISeekableStream))
|
||||
if (!stream || !SpecialPowers.call_Instanceof(stream, SpecialPowers.Ci.nsISeekableStream))
|
||||
throw "Stream must be seekable";
|
||||
// the following is a no-op, but should not throw an exception
|
||||
stream.seek(Components.interfaces.nsISeekableStream.NS_SEEK_CUR, 0);
|
||||
stream.seek(SpecialPowers.Ci.nsISeekableStream.NS_SEEK_CUR, 0);
|
||||
}
|
||||
|
||||
ok(true, "xhr is seekable");
|
||||
|
@ -98,7 +98,7 @@ addLoadEvent(function() {
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.open("POST", document.location.href);
|
||||
xhr.send(createDoc());
|
||||
is(SpecialPowers.wrap(xhr).channel.QueryInterface(Components.interfaces.nsIHttpChannel)
|
||||
is(SpecialPowers.wrap(xhr).channel.QueryInterface(SpecialPowers.Ci.nsIHttpChannel)
|
||||
.getRequestHeader("Content-Type"),
|
||||
"application/xml; charset=UTF-8", "Testing correct type on the wire");
|
||||
xhr.abort();
|
||||
|
@ -32,9 +32,9 @@ function testHTMLDocuments(ids, isXHTML) {
|
||||
is(docType1.ownerDocument, doc1, "docType should have ownerDocument!");
|
||||
ok(!doc1.documentElement, "Document shouldn't have document element!");
|
||||
is(doc1.body, null, "Shouldn't have .body!");
|
||||
ok(doc1 instanceof Components.interfaces.nsIDOMHTMLDocument,
|
||||
ok(doc1 instanceof SpecialPowers.Ci.nsIDOMHTMLDocument,
|
||||
"Document should be an HTML document!");
|
||||
ok(!(doc1 instanceof Components.interfaces.nsIDOMSVGDocument),
|
||||
ok(!(doc1 instanceof SpecialPowers.Ci.nsIDOMSVGDocument),
|
||||
"Document shouldn't be an SVG document!");
|
||||
|
||||
var docType2 =
|
||||
@ -68,9 +68,9 @@ function testSVGDocument() {
|
||||
var doc1 = document.implementation.createDocument(null, null, docType1);
|
||||
is(docType1.ownerDocument, doc1, "docType should have ownerDocument!");
|
||||
ok(!doc1.documentElement, "Document shouldn't have document element!");
|
||||
ok(!(doc1 instanceof Components.interfaces.nsIDOMHTMLDocument),
|
||||
ok(!(doc1 instanceof SpecialPowers.Ci.nsIDOMHTMLDocument),
|
||||
"Document shouldn't be an HTML document!");
|
||||
ok(doc1 instanceof Components.interfaces.nsIDOMSVGDocument,
|
||||
ok(doc1 instanceof SpecialPowers.Ci.nsIDOMSVGDocument,
|
||||
"Document should be an SVG document!");
|
||||
|
||||
// SVG documents have .rootElement.
|
||||
@ -95,9 +95,9 @@ function testFooBarDocument() {
|
||||
var doc1 = document.implementation.createDocument(null, null, docType1);
|
||||
is(docType1.ownerDocument, doc1, "docType should have ownerDocument!");
|
||||
ok(!doc1.documentElement, "Document shouldn't have document element!");
|
||||
ok(!(doc1 instanceof Components.interfaces.nsIDOMHTMLDocument),
|
||||
ok(!(doc1 instanceof SpecialPowers.Ci.nsIDOMHTMLDocument),
|
||||
"Document shouldn't be an HTML document!");
|
||||
ok(!(doc1 instanceof Components.interfaces.nsIDOMSVGDocument),
|
||||
ok(!(doc1 instanceof SpecialPowers.Ci.nsIDOMSVGDocument),
|
||||
"Document shouldn't be an SVG document!");
|
||||
|
||||
var docType2 =
|
||||
@ -112,9 +112,9 @@ function testFooBarDocument() {
|
||||
function testNullDocTypeDocument() {
|
||||
var doc1 = document.implementation.createDocument(null, null, null);
|
||||
ok(!doc1.documentElement, "Document shouldn't have document element!");
|
||||
ok(!(doc1 instanceof Components.interfaces.nsIDOMHTMLDocument),
|
||||
ok(!(doc1 instanceof SpecialPowers.Ci.nsIDOMHTMLDocument),
|
||||
"Document shouldn't be an HTML document!");
|
||||
ok(!(doc1 instanceof Components.interfaces.nsIDOMSVGDocument),
|
||||
ok(!(doc1 instanceof SpecialPowers.Ci.nsIDOMSVGDocument),
|
||||
"Document shouldn't be an SVG document!");
|
||||
|
||||
var doc2 = document.implementation.createDocument("FooBarNS",
|
||||
|
@ -17,7 +17,7 @@ var path = "http://mochi.test:8888/tests/content/base/test/";
|
||||
|
||||
function fromCache(xhr)
|
||||
{
|
||||
var ch = SpecialPowers.wrap(xhr).channel.QueryInterface(Components.interfaces.nsICachingChannel);
|
||||
var ch = SpecialPowers.wrap(xhr).channel.QueryInterface(SpecialPowers.Ci.nsICachingChannel);
|
||||
return ch.isFromCache();
|
||||
}
|
||||
|
||||
|
@ -11,9 +11,9 @@
|
||||
var url = "bug482935.sjs";
|
||||
|
||||
function clearCache() {
|
||||
SpecialPowers.wrap(Components).classes["@mozilla.org/network/cache-service;1"].
|
||||
getService(Components.interfaces.nsICacheService).
|
||||
evictEntries(Components.interfaces.nsICache.STORE_ANYWHERE);
|
||||
SpecialPowers.Cc["@mozilla.org/network/cache-service;1"].
|
||||
getService(SpecialPowers.Ci.nsICacheService).
|
||||
evictEntries(SpecialPowers.Ci.nsICache.STORE_ANYWHERE);
|
||||
}
|
||||
|
||||
// Tests that the response is cached if the request is cancelled
|
||||
|
@ -19,7 +19,7 @@ function setPass(aNode) {
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
window.addEventListener("load", function() {
|
||||
const nsIDOMNodeFilter = Components.interfaces.nsIDOMNodeFilter;
|
||||
const nsIDOMNodeFilter = SpecialPowers.Ci.nsIDOMNodeFilter;
|
||||
var walker = document.createTreeWalker(
|
||||
document,
|
||||
nsIDOMNodeFilter.SHOW_TEXT | nsIDOMNodeFilter.SHOW_DOCUMENT,
|
||||
|
@ -6,14 +6,14 @@
|
||||
<script>
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
const Cc = SpecialPowers.wrap(Components).classes;
|
||||
const Cr = SpecialPowers.wrap(Components).results;
|
||||
const Cc = SpecialPowers.Cc;
|
||||
const Cr = SpecialPowers.Cr;
|
||||
|
||||
function IsD2DEnabled() {
|
||||
var enabled = false;
|
||||
|
||||
try {
|
||||
enabled = Cc["@mozilla.org/gfx/info;1"].getService(Components.interfaces.nsIGfxInfo).D2DEnabled;
|
||||
enabled = Cc["@mozilla.org/gfx/info;1"].getService(SpecialPowers.Ci.nsIGfxInfo).D2DEnabled;
|
||||
} catch(e) {}
|
||||
|
||||
return enabled;
|
||||
@ -29,7 +29,7 @@ function IsMacOSX10_5orOlder() {
|
||||
|
||||
if (navigator.platform.indexOf("Mac") == 0) {
|
||||
var version = Cc["@mozilla.org/system-info;1"]
|
||||
.getService(Components.interfaces.nsIPropertyBag2)
|
||||
.getService(SpecialPowers.Ci.nsIPropertyBag2)
|
||||
.getProperty("version");
|
||||
// the next line is correct: Mac OS 10.6 corresponds to Darwin version 10 !
|
||||
// Mac OS 10.5 would be Darwin version 9. the |version| string we've got here
|
||||
@ -44,7 +44,7 @@ function IsAzureEnabled() {
|
||||
var enabled = false;
|
||||
|
||||
try {
|
||||
var backend = Cc["@mozilla.org/gfx/info;1"].getService(Components.interfaces.nsIGfxInfo).getInfo().AzureCanvasBackend;
|
||||
var backend = Cc["@mozilla.org/gfx/info;1"].getService(SpecialPowers.Ci.nsIGfxInfo).getInfo().AzureCanvasBackend;
|
||||
enabled = (backend != "none");
|
||||
} catch (e) { }
|
||||
|
||||
@ -55,7 +55,7 @@ function IsAzureSkia() {
|
||||
var enabled = false;
|
||||
|
||||
try {
|
||||
var backend = Cc["@mozilla.org/gfx/info;1"].getService(Components.interfaces.nsIGfxInfo).getInfo().AzureCanvasBackend;
|
||||
var backend = Cc["@mozilla.org/gfx/info;1"].getService(SpecialPowers.Ci.nsIGfxInfo).getInfo().AzureCanvasBackend;
|
||||
enabled = (backend == "skia");
|
||||
} catch (e) { }
|
||||
|
||||
@ -66,7 +66,7 @@ function IsAzureCairo() {
|
||||
var enabled = false;
|
||||
|
||||
try {
|
||||
var backend = Cc["@mozilla.org/gfx/info;1"].getService(Components.interfaces.nsIGfxInfo).getInfo().AzureCanvasBackend;
|
||||
var backend = Cc["@mozilla.org/gfx/info;1"].getService(SpecialPowers.Ci.nsIGfxInfo).getInfo().AzureCanvasBackend;
|
||||
enabled = (backend == "cairo");
|
||||
} catch (e) { }
|
||||
|
||||
|
@ -23,12 +23,12 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=448602
|
||||
function runTests() {
|
||||
/*
|
||||
Disabled due to lack of present support for JSD in JM
|
||||
var jsdIDebuggerService = Components.interfaces.jsdIDebuggerService;
|
||||
var jsd = Components.classes['@mozilla.org/js/jsd/debugger-service;1']
|
||||
var jsdIDebuggerService = SpecialPowers.Ci.jsdIDebuggerService;
|
||||
var jsd = SpecialPowers.Components.classes['@mozilla.org/js/jsd/debugger-service;1']
|
||||
.getService(jsdIDebuggerService);
|
||||
*/
|
||||
var els = SpecialPowers.wrap(Components).classes["@mozilla.org/eventlistenerservice;1"]
|
||||
.getService(Components.interfaces.nsIEventListenerService);
|
||||
var els = SpecialPowers.Cc["@mozilla.org/eventlistenerservice;1"]
|
||||
.getService(SpecialPowers.Ci.nsIEventListenerService);
|
||||
|
||||
// Event listener info tests
|
||||
var root = document.getElementById("testroot");
|
||||
@ -53,7 +53,7 @@ function runTests() {
|
||||
jsd.on();
|
||||
ok(jsd.isOn, "JSD should be running.");
|
||||
}
|
||||
var jsdvalue = infos[0].getDebugObject().QueryInterface(Components.interfaces.jsdIValue);
|
||||
var jsdvalue = infos[0].getDebugObject().QueryInterface(SpecialPowers.Ci.jsdIValue);
|
||||
is(jsdvalue.jsType, 3, "Event listener should be a function! (1)");
|
||||
*/
|
||||
|
||||
@ -72,7 +72,7 @@ function runTests() {
|
||||
is(infos[0].capturing, true, "Wrong phase (2)");
|
||||
is(infos[0].allowsUntrusted, true, "Should allow untrusted events (2)");
|
||||
/*
|
||||
jsdvalue = infos[0].getDebugObject().QueryInterface(Components.interfaces.jsdIValue);
|
||||
jsdvalue = infos[0].getDebugObject().QueryInterface(SpecialPowers.Ci.jsdIValue);
|
||||
is(jsdvalue.jsType, 3, "Event listener should be a function!(2)");
|
||||
is(jsdvalue.getWrappedValue(), l, "Wrong JS value! (1)");
|
||||
*/
|
||||
@ -84,7 +84,7 @@ function runTests() {
|
||||
is(infos[1].allowsUntrusted, false, "Shouldn't allow untrusted events (1)");
|
||||
|
||||
/*
|
||||
jsdvalue2 = infos[1].getDebugObject().QueryInterface(Components.interfaces.jsdIValue);
|
||||
jsdvalue2 = infos[1].getDebugObject().QueryInterface(SpecialPowers.Ci.jsdIValue);
|
||||
is(jsdvalue2.jsType, 3, "Event listener should be a function! (3)");
|
||||
is(jsdvalue2.getWrappedValue(), l, "Wrong JS value! (2)");
|
||||
*/
|
||||
|
@ -40,7 +40,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=493251
|
||||
var utils = SpecialPowers.getDOMWindowUtils(win);
|
||||
ok(true, "Dipatching key event: type=" + type);
|
||||
utils.sendKeyEvent(type,
|
||||
Components.interfaces.nsIDOMKeyEvent.DOM_VK_A,
|
||||
SpecialPowers.Ci.nsIDOMKeyEvent.DOM_VK_A,
|
||||
0, 0);
|
||||
}
|
||||
|
||||
@ -82,8 +82,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=493251
|
||||
}
|
||||
ok(true, aEvent.type + " event is handled: " + detail);
|
||||
|
||||
var fm = SpecialPowers.wrap(Components).classes["@mozilla.org/focus-manager;1"].
|
||||
getService(Components.interfaces.nsIFocusManager);
|
||||
var fm = SpecialPowers.Cc["@mozilla.org/focus-manager;1"].
|
||||
getService(SpecialPowers.Ci.nsIFocusManager);
|
||||
ok(true, "focused element is \"" + fm.focusedElement +
|
||||
"\" and focused window is \"" + fm.focusedWindow +
|
||||
"\" (the testing window is \"" + win + "\"");
|
||||
|
@ -36,7 +36,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=545268
|
||||
function dispatchKeyEvent(type) {
|
||||
var utils = SpecialPowers.getDOMWindowUtils(subwin);
|
||||
utils.sendKeyEvent(type,
|
||||
Components.interfaces.nsIDOMKeyEvent.DOM_VK_A,
|
||||
SpecialPowers.Ci.nsIDOMKeyEvent.DOM_VK_A,
|
||||
0, 0);
|
||||
}
|
||||
|
||||
|
@ -26,8 +26,8 @@ function prepareListener(eventName, expectedValue) {
|
||||
};
|
||||
}
|
||||
|
||||
const INPUT_SOURCE_UNKNOWN = Components.interfaces.nsIDOMMouseEvent.MOZ_SOURCE_UNKNOWN;
|
||||
const INPUT_SOURCE_KEYBOARD = Components.interfaces.nsIDOMMouseEvent.MOZ_SOURCE_KEYBOARD;
|
||||
const INPUT_SOURCE_UNKNOWN = SpecialPowers.Ci.nsIDOMMouseEvent.MOZ_SOURCE_UNKNOWN;
|
||||
const INPUT_SOURCE_KEYBOARD = SpecialPowers.Ci.nsIDOMMouseEvent.MOZ_SOURCE_KEYBOARD;
|
||||
|
||||
function doTest() {
|
||||
var eventNames = [
|
||||
|
@ -29,13 +29,13 @@ function check(event) {
|
||||
function doTest() {
|
||||
setup();
|
||||
|
||||
expectedInputSource = Components.interfaces.nsIDOMMouseEvent.MOZ_SOURCE_KEYBOARD;
|
||||
expectedInputSource = SpecialPowers.Ci.nsIDOMMouseEvent.MOZ_SOURCE_KEYBOARD;
|
||||
testKeyboard();
|
||||
|
||||
expectedInputSource = Components.interfaces.nsIDOMMouseEvent.MOZ_SOURCE_MOUSE;
|
||||
expectedInputSource = SpecialPowers.Ci.nsIDOMMouseEvent.MOZ_SOURCE_MOUSE;
|
||||
testMouse();
|
||||
|
||||
expectedInputSource = Components.interfaces.nsIDOMMouseEvent.MOZ_SOURCE_UNKNOWN;
|
||||
expectedInputSource = SpecialPowers.Ci.nsIDOMMouseEvent.MOZ_SOURCE_UNKNOWN;
|
||||
testScriptedClicks();
|
||||
|
||||
cleanup();
|
||||
|
@ -18,8 +18,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=402089
|
||||
|
||||
function getListenerCount() {
|
||||
|
||||
var Cc = SpecialPowers.wrap(Components).classes;
|
||||
var Ci = SpecialPowers.wrap(Components).interfaces;
|
||||
var Cc = SpecialPowers.Cc;
|
||||
var Ci = SpecialPowers.Ci;
|
||||
var dss = Cc["@mozilla.org/devicesensors;1"].getService(Ci.nsIDeviceSensors);
|
||||
|
||||
return dss.listenerCount(Ci.nsIDeviceSensorData.TYPE_ORIENTATION);
|
||||
|
@ -34,7 +34,7 @@ var escKeyReceived = false;
|
||||
var escKeySent = false;
|
||||
|
||||
function keyHandler(event) {
|
||||
if (escKeyReceived == Components.interfaces.nsIDOMKeyEvent.DOM_VK_ESC) {
|
||||
if (escKeyReceived == SpecialPowers.Ci.nsIDOMKeyEvent.DOM_VK_ESC) {
|
||||
escKeyReceived = true;
|
||||
}
|
||||
}
|
||||
|
@ -26,9 +26,9 @@ var fullPath;
|
||||
|
||||
|
||||
function initVals() {
|
||||
var dirSvc = SpecialPowers.wrap(Components).classes["@mozilla.org/file/directory_service;1"]
|
||||
.getService(Components.interfaces.nsIProperties);
|
||||
var file = dirSvc.get("XpcomLib", Components.interfaces.nsILocalFile);
|
||||
var dirSvc = SpecialPowers.Cc["@mozilla.org/file/directory_service;1"]
|
||||
.getService(SpecialPowers.Ci.nsIProperties);
|
||||
var file = dirSvc.get("XpcomLib", SpecialPowers.Ci.nsILocalFile);
|
||||
isnot(file, null, "Must have file here");
|
||||
|
||||
leafName = file.leafName;
|
||||
|
@ -44,12 +44,12 @@ function setFileInputs () {
|
||||
}
|
||||
|
||||
function createFileWithData(fileName, fileData) {
|
||||
var dirSvc = SpecialPowers.wrap(Components).classes["@mozilla.org/file/directory_service;1"]
|
||||
.getService(Components.interfaces.nsIProperties);
|
||||
var testFile = dirSvc.get("ProfD", Components.interfaces.nsIFile);
|
||||
var dirSvc = SpecialPowers.Cc["@mozilla.org/file/directory_service;1"]
|
||||
.getService(SpecialPowers.Ci.nsIProperties);
|
||||
var testFile = dirSvc.get("ProfD", SpecialPowers.Ci.nsIFile);
|
||||
testFile.append(fileName);
|
||||
var outStream = SpecialPowers.wrap(Components).classes["@mozilla.org/network/file-output-stream;1"].
|
||||
createInstance(Components.interfaces.nsIFileOutputStream);
|
||||
var outStream = SpecialPowers.Cc["@mozilla.org/network/file-output-stream;1"].
|
||||
createInstance(SpecialPowers.Ci.nsIFileOutputStream);
|
||||
outStream.init(testFile, 0x02 | 0x08 | 0x20, // write, create, truncate
|
||||
0666, 0);
|
||||
outStream.write(fileData, fileData.length);
|
||||
|
@ -26,11 +26,11 @@ SimpleTest.waitForExplicitFinish();
|
||||
addLoadEvent(function() {
|
||||
var viewer =
|
||||
SpecialPowers.wrap(frame.contentWindow
|
||||
.QueryInterface(Components.interfaces.nsIInterfaceRequestor))
|
||||
.getInterface(Components.interfaces.nsIWebNavigation)
|
||||
.QueryInterface(Components.interfaces.nsIDocShell)
|
||||
.QueryInterface(SpecialPowers.Ci.nsIInterfaceRequestor))
|
||||
.getInterface(SpecialPowers.Ci.nsIWebNavigation)
|
||||
.QueryInterface(SpecialPowers.Ci.nsIDocShell)
|
||||
.contentViewer
|
||||
.QueryInterface(Components.interfaces.nsIMarkupDocumentViewer);
|
||||
.QueryInterface(SpecialPowers.Ci.nsIMarkupDocumentViewer);
|
||||
|
||||
viewer.fullZoom = 1.5;
|
||||
|
||||
|
@ -175,9 +175,9 @@ function fileUriToSrc(path, mustExist) {
|
||||
if (navigator.appVersion.indexOf("Android") != -1)
|
||||
return path;
|
||||
|
||||
const Ci = Components.interfaces;
|
||||
const Cc = SpecialPowers.wrap(Components).classes;
|
||||
const Cr = SpecialPowers.wrap(Components).results;
|
||||
const Ci = SpecialPowers.Ci;
|
||||
const Cc = SpecialPowers.Cc;
|
||||
const Cr = SpecialPowers.Cr;
|
||||
var dirSvc = Cc["@mozilla.org/file/directory_service;1"].
|
||||
getService(Ci.nsIProperties);
|
||||
var f = dirSvc.get("CurWorkD", Ci.nsILocalFile);
|
||||
@ -540,9 +540,9 @@ function mediaTestCleanup() {
|
||||
|
||||
(function() {
|
||||
// Ensure that preload preferences are comsistent
|
||||
var prefService = SpecialPowers.wrap(Components)
|
||||
var prefService = SpecialPowers.wrap(SpecialPowers.Components)
|
||||
.classes["@mozilla.org/preferences-service;1"]
|
||||
.getService(Components.interfaces.nsIPrefService);
|
||||
.getService(SpecialPowers.Ci.nsIPrefService);
|
||||
var branch = prefService.getBranch("media.");
|
||||
var oldDefault = 2;
|
||||
var oldAuto = 3;
|
||||
|
@ -36,7 +36,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=319374
|
||||
var result = xp.evaluate("*",
|
||||
document.getElementById('content'),
|
||||
null,
|
||||
Components.interfaces.nsIDOMXPathResult.
|
||||
SpecialPowers.Ci.nsIDOMXPathResult.
|
||||
UNORDERED_NODE_ITERATOR_TYPE,
|
||||
null);
|
||||
var res = null;
|
||||
@ -66,7 +66,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=319374
|
||||
var xp2 = xp.evaluate(".",
|
||||
anonAttr1,
|
||||
null,
|
||||
Components.interfaces.nsIDOMXPathResult.
|
||||
SpecialPowers.Ci.nsIDOMXPathResult.
|
||||
UNORDERED_NODE_ITERATOR_TYPE,
|
||||
null);
|
||||
// Attribute changing in a different anonymous tree.
|
||||
@ -84,7 +84,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=319374
|
||||
var xp3 = xp.evaluate(".",
|
||||
anonAttr1,
|
||||
null,
|
||||
Components.interfaces.nsIDOMXPathResult.
|
||||
SpecialPowers.Ci.nsIDOMXPathResult.
|
||||
UNORDERED_NODE_ITERATOR_TYPE,
|
||||
null);
|
||||
// Attribute changing in the same anonymous tree.
|
||||
|
@ -99,8 +99,8 @@ function isInaccessible(wnd, message) {
|
||||
|
||||
function xpcEnumerateContentWindows(callback) {
|
||||
|
||||
var Ci = Components.interfaces;
|
||||
var ww = SpecialPowers.wrap(Components)
|
||||
var Ci = SpecialPowers.Ci;
|
||||
var ww = SpecialPowers.wrap(SpecialPowers.Components)
|
||||
.classes["@mozilla.org/embedcomp/window-watcher;1"]
|
||||
.getService(Ci.nsIWindowWatcher);
|
||||
var enumerator = ww.getWindowEnumerator();
|
||||
|
@ -26,7 +26,7 @@ SimpleTest.waitForExplicitFinish();
|
||||
// checking the results.
|
||||
const gLoadEventLoopCount = 100;
|
||||
|
||||
var Ci = Components.interfaces;
|
||||
var Ci = SpecialPowers.Ci;
|
||||
|
||||
var gCurrentTest;
|
||||
var gTargetWindow;
|
||||
@ -186,8 +186,8 @@ var gNextTest = 0;
|
||||
|
||||
function runNextTest()
|
||||
{
|
||||
var prefs = SpecialPowers.wrap(Components).classes["@mozilla.org/preferences-service;1"]
|
||||
.getService(Components.interfaces.nsIPrefBranch);
|
||||
var prefs = SpecialPowers.Cc["@mozilla.org/preferences-service;1"]
|
||||
.getService(SpecialPowers.Ci.nsIPrefBranch);
|
||||
|
||||
if (gNextTest < gTests.length) {
|
||||
gCurrentTest = gTests[gNextTest++];
|
||||
@ -213,8 +213,8 @@ function runNextTest()
|
||||
|
||||
function finishTest()
|
||||
{
|
||||
var prefs = SpecialPowers.wrap(Components).classes["@mozilla.org/preferences-service;1"]
|
||||
.getService(Components.interfaces.nsIPrefBranch);
|
||||
var prefs = SpecialPowers.Cc["@mozilla.org/preferences-service;1"]
|
||||
.getService(SpecialPowers.Ci.nsIPrefBranch);
|
||||
prefs.setBoolPref("network.jar.open-unsafe-types", false);
|
||||
|
||||
if (gNumPokes == 0) {
|
||||
@ -226,8 +226,8 @@ function finishTest()
|
||||
|
||||
function startTests()
|
||||
{
|
||||
var prefs = SpecialPowers.wrap(Components).classes["@mozilla.org/preferences-service;1"]
|
||||
.getService(Components.interfaces.nsIPrefBranch);
|
||||
var prefs = SpecialPowers.Cc["@mozilla.org/preferences-service;1"]
|
||||
.getService(SpecialPowers.Ci.nsIPrefBranch);
|
||||
gPrefValue = prefs.getBoolPref("network.jar.open-unsafe-types");
|
||||
}
|
||||
|
||||
|
@ -71,8 +71,8 @@ function runTest() {
|
||||
yield;
|
||||
|
||||
var sh = SpecialPowers.wrap(popup)
|
||||
.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
|
||||
.getInterface(Components.interfaces.nsIWebNavigation)
|
||||
.QueryInterface(SpecialPowers.Ci.nsIInterfaceRequestor)
|
||||
.getInterface(SpecialPowers.Ci.nsIWebNavigation)
|
||||
.sessionHistory;
|
||||
|
||||
// Get the title of the inner popup's current SHEntry
|
||||
|
@ -24,7 +24,7 @@ SpecialPowers.pushPrefEnv({"set": [["dom.mozAlarms.enabled", true]]}, function()
|
||||
} else {
|
||||
ok('mozAlarms' in navigator, "navigator.mozAlarms should exist");
|
||||
ok(navigator.mozAlarms, "navigator.mozAlarms should return an object");
|
||||
ok(navigator.mozAlarms instanceof Components.interfaces.nsIDOMMozAlarmsManager,
|
||||
ok(navigator.mozAlarms instanceof SpecialPowers.Ci.nsIDOMMozAlarmsManager,
|
||||
"navigator.mozAlarms should be an nsIDOMMozAlarmsManager object");
|
||||
}
|
||||
|
||||
|
@ -81,12 +81,12 @@ function testHttpAuth(e) {
|
||||
|
||||
function testFinish() {
|
||||
// Clear login information stored in password manager.
|
||||
var authMgr = SpecialPowers.wrap(Components).classes['@mozilla.org/network/http-auth-manager;1']
|
||||
.getService(Components.interfaces.nsIHttpAuthManager);
|
||||
var authMgr = SpecialPowers.Cc['@mozilla.org/network/http-auth-manager;1']
|
||||
.getService(SpecialPowers.Ci.nsIHttpAuthManager);
|
||||
authMgr.clearAll();
|
||||
|
||||
var pwmgr = SpecialPowers.wrap(Components).classes["@mozilla.org/login-manager;1"]
|
||||
.getService(Components.interfaces.nsILoginManager);
|
||||
var pwmgr = SpecialPowers.Cc["@mozilla.org/login-manager;1"]
|
||||
.getService(SpecialPowers.Ci.nsILoginManager);
|
||||
pwmgr.removeAllLogins();
|
||||
|
||||
SimpleTest.finish();
|
||||
|
@ -5,7 +5,7 @@
|
||||
// whitelisted key events.
|
||||
"use strict";
|
||||
|
||||
let Ci = Components.interfaces;
|
||||
let Ci = SpecialPowers.Ci;
|
||||
|
||||
let whitelistedEvents = [
|
||||
Ci.nsIDOMKeyEvent.DOM_VK_ESCAPE, // Back button.
|
||||
|
@ -13,7 +13,7 @@ document.getElementById('url').innerHTML = window.location;
|
||||
var alreadyBlocked = false;
|
||||
|
||||
addEventListener('keydown', function(e) {
|
||||
if (e.keyCode == Components.interfaces.nsIDOMKeyEvent.DOM_VK_ESCAPE &&
|
||||
if (e.keyCode == SpecialPowers.Ci.nsIDOMKeyEvent.DOM_VK_ESCAPE &&
|
||||
alreadyBlocked == false) {
|
||||
alreadyBlocked = true;
|
||||
e.preventDefault();
|
||||
|
@ -21,7 +21,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id={674720}
|
||||
|
||||
"use strict";
|
||||
|
||||
var comp = SpecialPowers.wrap(Components);
|
||||
var comp = SpecialPowers.wrap(SpecialPowers.Components);
|
||||
comp.utils.import("resource://gre/modules/ContactService.jsm");
|
||||
comp.utils.import("resource://gre/modules/PermissionPromptHelper.jsm");
|
||||
SpecialPowers.setBoolPref("dom.mozContacts.enabled", true);
|
||||
|
@ -21,7 +21,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id={674720}
|
||||
|
||||
"use strict";
|
||||
|
||||
var comp = SpecialPowers.wrap(Components);
|
||||
var comp = SpecialPowers.wrap(SpecialPowers.Components);
|
||||
comp.utils.import("resource://gre/modules/ContactService.jsm");
|
||||
comp.utils.import("resource://gre/modules/PermissionPromptHelper.jsm");
|
||||
SpecialPowers.setBoolPref("dom.mozContacts.enabled", true);
|
||||
@ -106,10 +106,10 @@ function onFailure() {
|
||||
function verifyBlob(blob1, blob2, isLast)
|
||||
{
|
||||
dump("islast? " + isLast + "\n");
|
||||
is(blob1 instanceof Components.interfaces.nsIDOMBlob, true,
|
||||
is(blob1 instanceof SpecialPowers.Ci.nsIDOMBlob, true,
|
||||
"Instance of nsIDOMBlob");
|
||||
is(blob1 instanceof Components.interfaces.nsIDOMFile,
|
||||
blob2 instanceof Components.interfaces.nsIDOMFile,
|
||||
is(blob1 instanceof SpecialPowers.Ci.nsIDOMFile,
|
||||
blob2 instanceof SpecialPowers.Ci.nsIDOMFile,
|
||||
"Instance of nsIDOMFile");
|
||||
is(blob1.size, blob2.size, "Correct size");
|
||||
is(blob1.type, blob2.type, "Correct type");
|
||||
|
@ -70,7 +70,7 @@
|
||||
}
|
||||
|
||||
function onTestComplete() {
|
||||
let comp = SpecialPowers.wrap(Components);
|
||||
let comp = SpecialPowers.wrap(SpecialPowers.Components);
|
||||
let mm = SpecialPowers.getBrowserFrameMessageManager(iframe);
|
||||
let spObserver = comp.classes["@mozilla.org/special-powers-observer;1"]
|
||||
.getService(comp.interfaces.nsIMessageListener);
|
||||
@ -109,7 +109,7 @@
|
||||
|
||||
let mm = SpecialPowers.getBrowserFrameMessageManager(iframe);
|
||||
|
||||
let comp = SpecialPowers.wrap(Components);
|
||||
let comp = SpecialPowers.wrap(SpecialPowers.Components);
|
||||
|
||||
let spObserver =
|
||||
comp.classes["@mozilla.org/special-powers-observer;1"]
|
||||
|
@ -16,8 +16,8 @@ function devicestorage_setup() {
|
||||
|
||||
// ensure that the directory we are writing into is empty
|
||||
try {
|
||||
const Cc = SpecialPowers.wrap(Components).classes;
|
||||
const Ci = Components.interfaces;
|
||||
const Cc = SpecialPowers.Cc;
|
||||
const Ci = SpecialPowers.Ci;
|
||||
var directoryService = Cc["@mozilla.org/file/directory_service;1"].getService(Ci.nsIProperties);
|
||||
var f = directoryService.get("TmpD", Ci.nsIFile);
|
||||
f.appendRelativePath("device-storage-testing");
|
||||
|
@ -51,8 +51,8 @@ function verifyAndDelete(prefix, files, e) {
|
||||
|
||||
function addFiles(prefix, files, date, callback) {
|
||||
|
||||
const Cc = SpecialPowers.wrap(Components).classes;
|
||||
const Ci = Components.interfaces;
|
||||
const Cc = SpecialPowers.Cc;
|
||||
const Ci = SpecialPowers.Ci;
|
||||
|
||||
var directoryService = Cc["@mozilla.org/file/directory_service;1"].getService(Ci.nsIProperties);
|
||||
|
||||
|
@ -11,8 +11,8 @@
|
||||
|
||||
<script type="text/javascript;version=1.7">
|
||||
function createZipFileWithData(fileData) {
|
||||
var Cc = SpecialPowers.wrap(Components).classes;
|
||||
var Ci = SpecialPowers.wrap(Components).interfaces;
|
||||
var Cc = SpecialPowers.Cc;
|
||||
var Ci = SpecialPowers.Ci;
|
||||
|
||||
var dirSvc = Cc["@mozilla.org/file/directory_service;1"].getService(Ci.nsIProperties);
|
||||
var testFile = dirSvc.get("ProfD", Ci.nsIFile);
|
||||
@ -30,8 +30,8 @@
|
||||
}
|
||||
|
||||
function createTextFileWithData(fileData) {
|
||||
var Cc = SpecialPowers.wrap(Components).classes;
|
||||
var Ci = SpecialPowers.wrap(Components).interfaces;
|
||||
var Cc = SpecialPowers.Cc;
|
||||
var Ci = SpecialPowers.Ci;
|
||||
|
||||
var dirSvc = Cc["@mozilla.org/file/directory_service;1"].getService(Ci.nsIProperties);
|
||||
var testFile = dirSvc.get("ProfD", Ci.nsIFile);
|
||||
|
@ -11,8 +11,8 @@
|
||||
|
||||
<script type="text/javascript;version=1.7">
|
||||
function createZipInZipData() {
|
||||
var Cc = SpecialPowers.wrap(Components).classes;
|
||||
var Ci = SpecialPowers.wrap(Components).interfaces;
|
||||
var Cc = SpecialPowers.Cc;
|
||||
var Ci = SpecialPowers.Ci;
|
||||
|
||||
var dirSvc = Cc["@mozilla.org/file/directory_service;1"].getService(Ci.nsIProperties);
|
||||
var testFile = dirSvc.get("ProfD", Ci.nsIFile);
|
||||
|
@ -25,7 +25,7 @@
|
||||
|
||||
let lockedFile2;
|
||||
|
||||
let comp = SpecialPowers.wrap(Components);
|
||||
let comp = SpecialPowers.wrap(SpecialPowers.Components);
|
||||
let thread = comp.classes["@mozilla.org/thread-manager;1"]
|
||||
.getService(comp.interfaces.nsIThreadManager)
|
||||
.currentThread;
|
||||
@ -36,7 +36,7 @@
|
||||
eventHasRun = true;
|
||||
|
||||
lockedFile2 = fileHandle.open();
|
||||
}, Components.interfaces.nsIThread.DISPATCH_NORMAL);
|
||||
}, SpecialPowers.Ci.nsIThread.DISPATCH_NORMAL);
|
||||
|
||||
while (!eventHasRun) {
|
||||
thread.processNextEvent(false);
|
||||
|
@ -44,7 +44,7 @@
|
||||
is(sawError, true, "Saw getMetadata() error");
|
||||
|
||||
// Make sure the success event isn't queued somehow.
|
||||
let comp = SpecialPowers.wrap(Components);
|
||||
let comp = SpecialPowers.wrap(SpecialPowers.Components);
|
||||
var thread = comp.classes["@mozilla.org/thread-manager;1"]
|
||||
.getService(comp.interfaces.nsIThreadManager)
|
||||
.currentThread;
|
||||
|
@ -3,8 +3,8 @@
|
||||
|
||||
"use strict";
|
||||
|
||||
const Ci = Components.interfaces;
|
||||
const Cu = SpecialPowers.wrap(Components).utils;
|
||||
const Ci = SpecialPowers.Ci;
|
||||
const Cu = SpecialPowers.Cu;
|
||||
|
||||
SpecialPowers.setBoolPref("toolkit.identity.debug", true);
|
||||
SpecialPowers.setBoolPref("dom.identity.enabled", true);
|
||||
|
@ -128,7 +128,7 @@
|
||||
|
||||
let mm = SpecialPowers.getBrowserFrameMessageManager(iframe);
|
||||
|
||||
let comp = SpecialPowers.wrap(Components);
|
||||
let comp = SpecialPowers.wrap(SpecialPowers.Components);
|
||||
|
||||
let spObserver =
|
||||
comp.classes["@mozilla.org/special-powers-observer;1"]
|
||||
|
@ -21,7 +21,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id={678695}
|
||||
|
||||
"use strict";
|
||||
|
||||
var comp = SpecialPowers.wrap(Components);
|
||||
var comp = SpecialPowers.wrap(SpecialPowers.Components);
|
||||
comp.utils.import("resource://gre/modules/SettingsChangeNotifier.jsm");
|
||||
SpecialPowers.setBoolPref("dom.mozSettings.enabled", true);
|
||||
SpecialPowers.addPermission("settings", true, document);
|
||||
|
@ -10,8 +10,8 @@
|
||||
|
||||
function manifestUpdated()
|
||||
{
|
||||
var appCacheService = Components.classes["@mozilla.org/network/application-cache-service;1"]
|
||||
.getService(Components.interfaces.nsIApplicationCacheService);
|
||||
var appCacheService = SpecialPowers.Components.classes["@mozilla.org/network/application-cache-service;1"]
|
||||
.getService(SpecialPowers.Ci.nsIApplicationCacheService);
|
||||
|
||||
var foreign2cache = appCacheService.chooseApplicationCache(
|
||||
"http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/foreign2.html");
|
||||
@ -30,8 +30,8 @@ function manifestUpdated()
|
||||
|
||||
function onLoaded()
|
||||
{
|
||||
var appCacheService = Components.classes["@mozilla.org/network/application-cache-service;1"]
|
||||
.getService(Components.interfaces.nsIApplicationCacheService);
|
||||
var appCacheService = SpecialPowers.Components.classes["@mozilla.org/network/application-cache-service;1"]
|
||||
.getService(SpecialPowers.Ci.nsIApplicationCacheService);
|
||||
|
||||
var foreign1cache = appCacheService.getActiveCache(
|
||||
"http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/foreign1.cacheManifest");
|
||||
@ -47,7 +47,7 @@ function onLoaded()
|
||||
|
||||
try
|
||||
{
|
||||
OfflineTest.ok(applicationCache.status == Components.interfaces.nsIDOMOfflineResourceList.UNCACHED,
|
||||
OfflineTest.ok(applicationCache.status == SpecialPowers.Ci.nsIDOMOfflineResourceList.UNCACHED,
|
||||
"there is no associated application cache");
|
||||
}
|
||||
catch (ex)
|
||||
|
@ -50,7 +50,7 @@ applicationCache.oncached = function() {
|
||||
var req = new XMLHttpRequest();
|
||||
req.open("GET", "http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/obsoletingManifest.sjs?state=");
|
||||
var channel = SpecialPowers.wrap(req).channel
|
||||
.QueryInterface(Components.interfaces.nsIApplicationCacheChannel);
|
||||
.QueryInterface(SpecialPowers.Ci.nsIApplicationCacheChannel);
|
||||
channel.chooseApplicationCache = false;
|
||||
channel.inheritApplicationCache = false;
|
||||
req.send("");
|
||||
|
@ -21,8 +21,8 @@
|
||||
|
||||
function manifestUpdated()
|
||||
{
|
||||
var appCacheService = Components.classes["@mozilla.org/network/application-cache-service;1"]
|
||||
.getService(Components.interfaces.nsIApplicationCacheService);
|
||||
var appCacheService = SpecialPowers.Components.classes["@mozilla.org/network/application-cache-service;1"]
|
||||
.getService(SpecialPowers.Ci.nsIApplicationCacheService);
|
||||
|
||||
foreign1cache = appCacheService.chooseApplicationCache(
|
||||
"http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/foreign2.html");
|
||||
|
@ -17,8 +17,8 @@
|
||||
* swaps cache for this document, reloads and checks document state.
|
||||
*/
|
||||
|
||||
const NAMESPACE_BYPASS = Components.interfaces.nsIApplicationCacheNamespace.NAMESPACE_BYPASS;
|
||||
const NAMESPACE_FALLBACK = Components.interfaces.nsIApplicationCacheNamespace.NAMESPACE_FALLBACK;
|
||||
const NAMESPACE_BYPASS = SpecialPowers.Ci.nsIApplicationCacheNamespace.NAMESPACE_BYPASS;
|
||||
const NAMESPACE_FALLBACK = SpecialPowers.Ci.nsIApplicationCacheNamespace.NAMESPACE_FALLBACK;
|
||||
|
||||
var gStep = 0;
|
||||
var gGotFrameVersion = 0;
|
||||
@ -153,7 +153,7 @@ function implicitCached()
|
||||
"http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/fallback.html", false);
|
||||
|
||||
// Cache object status
|
||||
OfflineTest.is(applicationCache.status, Components.interfaces.nsIDOMOfflineResourceList.IDLE,
|
||||
OfflineTest.is(applicationCache.status, SpecialPowers.Ci.nsIDOMOfflineResourceList.IDLE,
|
||||
"we have associated application cache (1)");
|
||||
|
||||
OfflineTest.is(gGotFrameVersion, 1, "IFrame version 1");
|
||||
@ -207,7 +207,7 @@ function manifestUpdated()
|
||||
"http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/fallback2.html", false);
|
||||
|
||||
// Cache object status
|
||||
OfflineTest.is(applicationCache.status, Components.interfaces.nsIDOMOfflineResourceList.UPDATEREADY,
|
||||
OfflineTest.is(applicationCache.status, SpecialPowers.Ci.nsIDOMOfflineResourceList.UPDATEREADY,
|
||||
"we have associated application cache and update is pending (2)");
|
||||
|
||||
var entries = [
|
||||
@ -256,7 +256,7 @@ function manifestUpdated()
|
||||
"http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/fallback2.html", false);
|
||||
|
||||
// Cache object status
|
||||
OfflineTest.is(applicationCache.status, Components.interfaces.nsIDOMOfflineResourceList.UPDATEREADY,
|
||||
OfflineTest.is(applicationCache.status, SpecialPowers.Ci.nsIDOMOfflineResourceList.UPDATEREADY,
|
||||
"we have associated application cache and update is pending (3)");
|
||||
|
||||
OfflineTest.is(gGotFrameVersion, 1, "IFrame version 1 because cache was not swapped");
|
||||
@ -299,10 +299,10 @@ function manifestNoUpdate()
|
||||
|
||||
OfflineTest.ok(gStep == 3);
|
||||
|
||||
OfflineTest.is(applicationCache.status, Components.interfaces.nsIDOMOfflineResourceList.UPDATEREADY,
|
||||
OfflineTest.is(applicationCache.status, SpecialPowers.Ci.nsIDOMOfflineResourceList.UPDATEREADY,
|
||||
"we have associated application cache and update is pending (4)");
|
||||
applicationCache.swapCache();
|
||||
OfflineTest.is(applicationCache.status, Components.interfaces.nsIDOMOfflineResourceList.IDLE,
|
||||
OfflineTest.is(applicationCache.status, SpecialPowers.Ci.nsIDOMOfflineResourceList.IDLE,
|
||||
"we have associated application cache (4)");
|
||||
|
||||
gGotFrameVersion = 0;
|
||||
|
@ -21,12 +21,12 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=317448
|
||||
var x = new XMLHttpRequest();
|
||||
x.open("GET", document.location.href);
|
||||
x.send("");
|
||||
is(x instanceof Components.interfaces.nsIInterfaceRequestor,
|
||||
is(x instanceof SpecialPowers.Ci.nsIInterfaceRequestor,
|
||||
true, "Must be interface requestor");
|
||||
|
||||
var count = {};
|
||||
var interfaces = SpecialPowers.wrap(x).
|
||||
QueryInterface(Components.interfaces.nsIClassInfo).
|
||||
QueryInterface(SpecialPowers.Ci.nsIClassInfo).
|
||||
getInterfaces(count).
|
||||
map(function(id) {
|
||||
id = SpecialPowers.wrap(id);
|
||||
|
@ -116,8 +116,8 @@ function test5()
|
||||
SimpleTest.executeSoon(function() {
|
||||
// We have to focus back the originating window but we can't do that with
|
||||
// .focus() or .blur() anymore.
|
||||
var fm = SpecialPowers.wrap(Components).classes["@mozilla.org/focus-manager;1"]
|
||||
.getService(Components.interfaces.nsIFocusManager);
|
||||
var fm = SpecialPowers.Cc["@mozilla.org/focus-manager;1"]
|
||||
.getService(SpecialPowers.Ci.nsIFocusManager);
|
||||
fm.focusedWindow = window;
|
||||
});
|
||||
}, w, true);
|
||||
@ -125,8 +125,8 @@ function test5()
|
||||
|
||||
function finished()
|
||||
{
|
||||
SpecialPowers.wrap(Components).classes["@mozilla.org/preferences-service;1"]
|
||||
.getService(Components.interfaces.nsIPrefBranch)
|
||||
SpecialPowers.Cc["@mozilla.org/preferences-service;1"]
|
||||
.getService(SpecialPowers.Ci.nsIPrefBranch)
|
||||
.setBoolPref("dom.disable_window_flip", gOldPrefValue);
|
||||
SimpleTest.finish();
|
||||
}
|
||||
@ -135,8 +135,8 @@ SimpleTest.waitForExplicitFinish();
|
||||
|
||||
|
||||
// dom.disable_window_flip has to be set to true for this test.
|
||||
var prefs = SpecialPowers.wrap(Components).classes["@mozilla.org/preferences-service;1"]
|
||||
.getService(Components.interfaces.nsIPrefBranch);
|
||||
var prefs = SpecialPowers.Cc["@mozilla.org/preferences-service;1"]
|
||||
.getService(SpecialPowers.Ci.nsIPrefBranch);
|
||||
gOldPrefValue = prefs.getBoolPref("dom.disable_window_flip");
|
||||
prefs.setBoolPref("dom.disable_window_flip", true);
|
||||
|
||||
|
@ -45,16 +45,16 @@ var outerWindowDestroyID;
|
||||
|
||||
function outerObserver(id) {
|
||||
outerWindowDestroyID =
|
||||
SpecialPowers.wrap(id).QueryInterface(Components.interfaces.nsISupportsPRUint64).data;
|
||||
SpecialPowers.wrap(id).QueryInterface(SpecialPowers.Ci.nsISupportsPRUint64).data;
|
||||
}
|
||||
function innerObserver(id) {
|
||||
innerWindowDestroyID =
|
||||
SpecialPowers.wrap(id).QueryInterface(Components.interfaces.nsISupportsPRUint64).data;
|
||||
SpecialPowers.wrap(id).QueryInterface(SpecialPowers.Ci.nsISupportsPRUint64).data;
|
||||
}
|
||||
|
||||
function removeFrame(iframe) {
|
||||
var obsSvc = SpecialPowers.wrap(Components).classes["@mozilla.org/observer-service;1"]
|
||||
.getService(Components.interfaces.nsIObserverService);
|
||||
var obsSvc = SpecialPowers.Cc["@mozilla.org/observer-service;1"]
|
||||
.getService(SpecialPowers.Ci.nsIObserverService);
|
||||
obsSvc.addObserver(outerObserver, "outer-window-destroyed", false);
|
||||
obsSvc.addObserver(innerObserver, "inner-window-destroyed", false);
|
||||
|
||||
@ -66,8 +66,8 @@ SimpleTest.waitForExplicitFinish();
|
||||
SimpleTest.executeSoon(function() {
|
||||
is(innerWindowDestroyID, i1inner, "inner window of frame 1 should be destroyed");
|
||||
is(outerWindowDestroyID, i1outer, "outer window of frame 1 should be destroyed");
|
||||
var obsSvc = SpecialPowers.wrap(Components).classes["@mozilla.org/observer-service;1"]
|
||||
.getService(Components.interfaces.nsIObserverService);
|
||||
var obsSvc = SpecialPowers.Cc["@mozilla.org/observer-service;1"]
|
||||
.getService(SpecialPowers.Ci.nsIObserverService);
|
||||
obsSvc.removeObserver(outerObserver, "outer-window-destroyed");
|
||||
obsSvc.removeObserver(innerObserver, "inner-window-destroyed");
|
||||
SimpleTest.finish();
|
||||
|
@ -52,12 +52,12 @@ function alter_file(uri, file) {
|
||||
|
||||
(function() {
|
||||
|
||||
var prefService = SpecialPowers.wrap(Components).classes["@mozilla.org/preferences-service;1"]
|
||||
.getService(Components.interfaces.nsIPrefService),
|
||||
pm = SpecialPowers.wrap(Components).classes["@mozilla.org/permissionmanager;1"]
|
||||
.getService(Components.interfaces.nsIPermissionManager),
|
||||
ioService = SpecialPowers.wrap(Components).classes["@mozilla.org/network/io-service;1"]
|
||||
.getService(Components.interfaces.nsIIOService);
|
||||
var prefService = SpecialPowers.Cc["@mozilla.org/preferences-service;1"]
|
||||
.getService(SpecialPowers.Ci.nsIPrefService),
|
||||
pm = SpecialPowers.Cc["@mozilla.org/permissionmanager;1"]
|
||||
.getService(SpecialPowers.Ci.nsIPermissionManager),
|
||||
ioService = SpecialPowers.Cc["@mozilla.org/network/io-service;1"]
|
||||
.getService(SpecialPowers.Ci.nsIIOService);
|
||||
|
||||
ALLOW_ACTION = pm.ALLOW_ACTION;
|
||||
DENY_ACTION = pm.DENY_ACTION;
|
||||
@ -98,8 +98,8 @@ function alter_file(uri, file) {
|
||||
|
||||
makePopupPrivAccessor = function(uri) {
|
||||
uri = ioService.newURI(uri, null, null);
|
||||
var principal = SpecialPowers.wrap(Components).classes["@mozilla.org/scriptsecuritymanager;1"]
|
||||
.getService(Components.interfaces.nsIScriptSecurityManager)
|
||||
var principal = SpecialPowers.Cc["@mozilla.org/scriptsecuritymanager;1"]
|
||||
.getService(SpecialPowers.Ci.nsIScriptSecurityManager)
|
||||
.getNoAppCodebasePrincipal(uri);
|
||||
|
||||
return function(permission) {
|
||||
|
@ -537,7 +537,7 @@ var interfaceNamesInGlobalScope =
|
||||
"PermissionSettings"
|
||||
]
|
||||
|
||||
for (var i in Components.interfaces) {
|
||||
for (var i in SpecialPowers.Components.interfaces) {
|
||||
var s = i.toString();
|
||||
var name = null;
|
||||
if (s.indexOf("nsIDOM") == 0) {
|
||||
|
@ -37,7 +37,7 @@ resume_geolocationProvider();
|
||||
force_prompt(true);
|
||||
|
||||
|
||||
var comp = SpecialPowers.wrap(Components);
|
||||
var comp = SpecialPowers.wrap(SpecialPowers.Components);
|
||||
SpecialPowers.setBoolPref("dom.mozSettings.enabled", true);
|
||||
SpecialPowers.addPermission("settings", true, document);
|
||||
comp.utils.import("resource://gre/modules/SettingsChangeNotifier.jsm");
|
||||
|
@ -37,7 +37,7 @@ resume_geolocationProvider();
|
||||
force_prompt(true);
|
||||
|
||||
|
||||
var comp = SpecialPowers.wrap(Components);
|
||||
var comp = SpecialPowers.wrap(SpecialPowers.Components);
|
||||
SpecialPowers.setBoolPref("dom.mozSettings.enabled", true);
|
||||
SpecialPowers.addPermission("settings", true, document);
|
||||
comp.utils.import("resource://gre/modules/SettingsChangeNotifier.jsm");
|
||||
|
@ -6,7 +6,7 @@
|
||||
<script type="text/javascript">
|
||||
|
||||
const DOM_QUOTA_REACHED = 2152924150;
|
||||
const Cc = SpecialPowers.wrap(Components).classes;
|
||||
const Cc = SpecialPowers.Cc;
|
||||
|
||||
function checkException(func, exc)
|
||||
{
|
||||
@ -24,12 +24,12 @@ function checkException(func, exc)
|
||||
function doStep()
|
||||
{
|
||||
var io = Cc["@mozilla.org/network/io-service;1"]
|
||||
.getService(Components.interfaces.nsIIOService);
|
||||
.getService(SpecialPowers.Ci.nsIIOService);
|
||||
var uri = io.newURI(window.location, "", null);
|
||||
var cp = Cc["@mozilla.org/cookie/permission;1"]
|
||||
.getService(Components.interfaces.nsICookiePermission);
|
||||
.getService(SpecialPowers.Ci.nsICookiePermission);
|
||||
|
||||
cp.setAccess(uri, Components.interfaces.nsICookiePermission.ACCESS_SESSION);
|
||||
cp.setAccess(uri, SpecialPowers.Ci.nsICookiePermission.ACCESS_SESSION);
|
||||
|
||||
var query = location.search.substring(1);
|
||||
var queries = query.split("&");
|
||||
@ -95,7 +95,7 @@ function doStep()
|
||||
{
|
||||
case "clear":
|
||||
localStorage.clear();
|
||||
cp.setAccess(uri, Components.interfaces.nsICookiePermission.ACCESS_DEFAULT);
|
||||
cp.setAccess(uri, SpecialPowers.Ci.nsICookiePermission.ACCESS_DEFAULT);
|
||||
|
||||
break;
|
||||
}
|
||||
|
@ -6,8 +6,8 @@ function get_PBSvc()
|
||||
return _PBSvc;
|
||||
|
||||
try {
|
||||
_PBSvc = Components.classes["@mozilla.org/privatebrowsing;1"].
|
||||
getService(Components.interfaces.nsIPrivateBrowsingService);
|
||||
_PBSvc = SpecialPowers.Components.classes["@mozilla.org/privatebrowsing;1"].
|
||||
getService(SpecialPowers.Ci.nsIPrivateBrowsingService);
|
||||
return _PBSvc;
|
||||
}
|
||||
catch (ex) {
|
||||
@ -19,8 +19,8 @@ function get_PBSvc()
|
||||
function enterPrivateBrowsing()
|
||||
{
|
||||
if (get_PBSvc()) {
|
||||
var prefBranch = Components.classes["@mozilla.org/preferences-service;1"].
|
||||
getService(Components.interfaces.nsIPrefBranch);
|
||||
var prefBranch = SpecialPowers.Components.classes["@mozilla.org/preferences-service;1"].
|
||||
getService(SpecialPowers.Ci.nsIPrefBranch);
|
||||
prefBranch.setBoolPref("browser.privatebrowsing.keep_current_session", true);
|
||||
|
||||
get_PBSvc().privateBrowsingEnabled = true;
|
||||
@ -32,8 +32,8 @@ function leavePrivateBrowsing()
|
||||
if (get_PBSvc()) {
|
||||
get_PBSvc().privateBrowsingEnabled = false;
|
||||
|
||||
var prefBranch = Components.classes["@mozilla.org/preferences-service;1"].
|
||||
getService(Components.interfaces.nsIPrefBranch);
|
||||
var prefBranch = SpecialPowers.Components.classes["@mozilla.org/preferences-service;1"].
|
||||
getService(SpecialPowers.Ci.nsIPrefBranch);
|
||||
if (prefBranch.prefHasUserValue("browser.privatebrowsing.keep_current_session"))
|
||||
prefBranch.clearUserPref("browser.privatebrowsing.keep_current_session");
|
||||
}
|
||||
|
@ -9,13 +9,13 @@
|
||||
|
||||
function startTest()
|
||||
{
|
||||
var io = SpecialPowers.wrap(Components).classes["@mozilla.org/network/io-service;1"]
|
||||
.getService(Components.interfaces.nsIIOService);
|
||||
var io = SpecialPowers.Cc["@mozilla.org/network/io-service;1"]
|
||||
.getService(SpecialPowers.Ci.nsIIOService);
|
||||
var uri = io.newURI(window.location, "", null);
|
||||
var cp = SpecialPowers.wrap(Components).classes["@mozilla.org/cookie/permission;1"]
|
||||
.getService(Components.interfaces.nsICookiePermission);
|
||||
var cp = SpecialPowers.Cc["@mozilla.org/cookie/permission;1"]
|
||||
.getService(SpecialPowers.Ci.nsICookiePermission);
|
||||
|
||||
cp.setAccess(uri, Components.interfaces.nsICookiePermission.ACCESS_DENY);
|
||||
cp.setAccess(uri, SpecialPowers.Ci.nsICookiePermission.ACCESS_DENY);
|
||||
|
||||
try {
|
||||
localStorage.setItem("blocked", "blockedvalue");
|
||||
@ -33,7 +33,7 @@ function startTest()
|
||||
ok(true, "Exception for localStorage.getItem, ACCESS_DENY");
|
||||
}
|
||||
|
||||
cp.setAccess(uri, Components.interfaces.nsICookiePermission.ACCESS_DEFAULT);
|
||||
cp.setAccess(uri, SpecialPowers.Ci.nsICookiePermission.ACCESS_DEFAULT);
|
||||
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
@ -19,12 +19,12 @@ function startTest()
|
||||
localStorage.setItem("persistent1", "persistent value 1");
|
||||
localStorage.setItem("persistent2", "persistent value 2");
|
||||
|
||||
var io = SpecialPowers.wrap(Components).classes["@mozilla.org/network/io-service;1"]
|
||||
.getService(Components.interfaces.nsIIOService);
|
||||
var io = SpecialPowers.Cc["@mozilla.org/network/io-service;1"]
|
||||
.getService(SpecialPowers.Ci.nsIIOService);
|
||||
var uri = io.newURI(window.location, "", null);
|
||||
var cp = SpecialPowers.wrap(Components).classes["@mozilla.org/cookie/permission;1"]
|
||||
.getService(Components.interfaces.nsICookiePermission);
|
||||
cp.setAccess(uri, Components.interfaces.nsICookiePermission.ACCESS_SESSION);
|
||||
var cp = SpecialPowers.Cc["@mozilla.org/cookie/permission;1"]
|
||||
.getService(SpecialPowers.Ci.nsICookiePermission);
|
||||
cp.setAccess(uri, SpecialPowers.Ci.nsICookiePermission.ACCESS_SESSION);
|
||||
|
||||
localStorage.setItem("session only", "session value");
|
||||
is(localStorage.getItem("session only"), "session value");
|
||||
|
@ -9,11 +9,11 @@
|
||||
|
||||
function startTest()
|
||||
{
|
||||
var io = SpecialPowers.wrap(Components).classes["@mozilla.org/network/io-service;1"]
|
||||
.getService(Components.interfaces.nsIIOService);
|
||||
var io = SpecialPowers.Cc["@mozilla.org/network/io-service;1"]
|
||||
.getService(SpecialPowers.Ci.nsIIOService);
|
||||
var uri = io.newURI(window.location, "", null);
|
||||
var cp = SpecialPowers.wrap(Components).classes["@mozilla.org/cookie/permission;1"]
|
||||
.getService(Components.interfaces.nsICookiePermission);
|
||||
var cp = SpecialPowers.Cc["@mozilla.org/cookie/permission;1"]
|
||||
.getService(SpecialPowers.Ci.nsICookiePermission);
|
||||
|
||||
is(localStorage.getItem("session only"), "session value", "Value present when cookies in session-only mode");
|
||||
is(localStorage.getItem("persistent1"), "persistent value 1", "Persistent value present");
|
||||
@ -35,21 +35,21 @@ function startTest()
|
||||
|
||||
localStorage.setItem("session only 2", "must be deleted on drop of session-only cookies permissions");
|
||||
|
||||
cp.setAccess(uri, Components.interfaces.nsICookiePermission.ACCESS_DEFAULT);
|
||||
cp.setAccess(uri, SpecialPowers.Ci.nsICookiePermission.ACCESS_DEFAULT);
|
||||
|
||||
is(localStorage.getItem("session only"), null, "No value when cookies are in default mode");
|
||||
is(localStorage.getItem("session only 2"), null, "No value when cookies are in default mode");
|
||||
is(localStorage.getItem("persistent1"), "persistent value 1", "Persistent value present");
|
||||
is(localStorage.getItem("persistent2"), "persistent value 2", "Persistent value present");
|
||||
|
||||
cp.setAccess(uri, Components.interfaces.nsICookiePermission.ACCESS_SESSION);
|
||||
cp.setAccess(uri, SpecialPowers.Ci.nsICookiePermission.ACCESS_SESSION);
|
||||
|
||||
is(localStorage.getItem("session only"), null, "Value not present when cookies in session-only mode after delete");
|
||||
is(localStorage.getItem("session only 2"), null, "Value not present when cookies in session-only mode after delete");
|
||||
is(localStorage.getItem("persistent1"), "persistent value 1", "Persistent value present again");
|
||||
is(localStorage.getItem("persistent2"), "persistent value 2", "Persistent value present again");
|
||||
|
||||
cp.setAccess(uri, Components.interfaces.nsICookiePermission.ACCESS_DEFAULT);
|
||||
cp.setAccess(uri, SpecialPowers.Ci.nsICookiePermission.ACCESS_DEFAULT);
|
||||
|
||||
localStorage.clear();
|
||||
|
||||
@ -57,14 +57,14 @@ function startTest()
|
||||
is(localStorage.getItem("persistent1"), null, "Persistent value not present after delete");
|
||||
is(localStorage.getItem("persistent2"), null, "Persistent value not present after delete");
|
||||
|
||||
cp.setAccess(uri, Components.interfaces.nsICookiePermission.ACCESS_SESSION);
|
||||
cp.setAccess(uri, SpecialPowers.Ci.nsICookiePermission.ACCESS_SESSION);
|
||||
|
||||
is(localStorage.getItem("session only"), null, "Value not present when cookies in session-only mode after delete");
|
||||
is(localStorage.getItem("session only 2"), null, "No value when cookies are in default mode");
|
||||
is(localStorage.getItem("persistent1"), null, "Persistent value not present in session only after delete");
|
||||
is(localStorage.getItem("persistent2"), null, "Persistent value not present in session only after delete");
|
||||
|
||||
cp.setAccess(uri, Components.interfaces.nsICookiePermission.ACCESS_DEFAULT);
|
||||
cp.setAccess(uri, SpecialPowers.Ci.nsICookiePermission.ACCESS_DEFAULT);
|
||||
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
@ -8,16 +8,16 @@
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
const Cc = SpecialPowers.wrap(Components).classes;
|
||||
const Cc = SpecialPowers.Cc;
|
||||
|
||||
var currentTest = 1;
|
||||
var prefs = Cc["@mozilla.org/preferences-service;1"]
|
||||
.getService(Components.interfaces.nsIPrefBranch);
|
||||
.getService(SpecialPowers.Ci.nsIPrefBranch);
|
||||
var io = Cc["@mozilla.org/network/io-service;1"]
|
||||
.getService(Components.interfaces.nsIIOService);
|
||||
.getService(SpecialPowers.Ci.nsIIOService);
|
||||
var uri = io.newURI(window.location, "", null);
|
||||
var cp = Cc["@mozilla.org/cookie/permission;1"]
|
||||
.getService(Components.interfaces.nsICookiePermission);
|
||||
.getService(SpecialPowers.Ci.nsICookiePermission);
|
||||
|
||||
var quota;
|
||||
|
||||
@ -45,7 +45,7 @@ function doNextTest()
|
||||
// In subdomain now set another key with length 500 bytes, i.e.
|
||||
// allocate 501 bytes
|
||||
case 2:
|
||||
cp.setAccess(uri, Components.interfaces.nsICookiePermission.ACCESS_SESSION);
|
||||
cp.setAccess(uri, SpecialPowers.Ci.nsICookiePermission.ACCESS_SESSION);
|
||||
slaveOrigin = "http://example.com";
|
||||
slave.location = slaveOrigin + slavePath + "frameQuotaSessionOnly.html?add&B&success";
|
||||
break;
|
||||
@ -88,12 +88,12 @@ function doNextTest()
|
||||
// Do a clean up...
|
||||
slaveOrigin = "http://example.com";
|
||||
slave.location = slaveOrigin + slavePath + "frameQuotaSessionOnly.html?clear";
|
||||
cp.setAccess(uri, Components.interfaces.nsICookiePermission.ACCESS_DEFAULT);
|
||||
cp.setAccess(uri, SpecialPowers.Ci.nsICookiePermission.ACCESS_DEFAULT);
|
||||
break;
|
||||
|
||||
default:
|
||||
prefs.setIntPref("dom.storage.default_quota", quota);
|
||||
cp.setAccess(uri, Components.interfaces.nsICookiePermission.ACCESS_DEFAULT);
|
||||
cp.setAccess(uri, SpecialPowers.Ci.nsICookiePermission.ACCESS_DEFAULT);
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
|
@ -154,14 +154,14 @@ function popstateExpected(msg) {
|
||||
|
||||
function getColor(elem) {
|
||||
var utils = SpecialPowers.wrap(document).defaultView.
|
||||
QueryInterface(Components.interfaces.nsIInterfaceRequestor).
|
||||
getInterface(Components.interfaces.nsIDOMWindowUtils);
|
||||
QueryInterface(SpecialPowers.Ci.nsIInterfaceRequestor).
|
||||
getInterface(SpecialPowers.Ci.nsIDOMWindowUtils);
|
||||
return utils.getVisitedDependentComputedStyle(elem, "", "color");
|
||||
}
|
||||
|
||||
function getSHistory(theWindow)
|
||||
{
|
||||
const Ci = Components.interfaces;
|
||||
const Ci = SpecialPowers.Ci;
|
||||
var sh = SpecialPowers.wrap(theWindow.QueryInterface(Ci.nsIInterfaceRequestor))
|
||||
.getInterface(Ci.nsIWebNavigation)
|
||||
.sessionHistory;
|
||||
|
@ -22,9 +22,9 @@ var iframe = document.getElementById("load-frame");
|
||||
function enableJS() allowJS(true, iframe);
|
||||
function disableJS() allowJS(false, iframe);
|
||||
function allowJS(allow, frame) {
|
||||
SpecialPowers.wrap(frame.contentWindow.QueryInterface(Components.interfaces.nsIInterfaceRequestor))
|
||||
.getInterface(Components.interfaces.nsIWebNavigation)
|
||||
.QueryInterface(Components.interfaces.nsIDocShell)
|
||||
SpecialPowers.wrap(frame.contentWindow.QueryInterface(SpecialPowers.Ci.nsIInterfaceRequestor))
|
||||
.getInterface(SpecialPowers.Ci.nsIWebNavigation)
|
||||
.QueryInterface(SpecialPowers.Ci.nsIDocShell)
|
||||
.allowJavascript = allow;
|
||||
}
|
||||
function expectJSAllowed(allowed, testCondition, callback) {
|
||||
|
@ -34,7 +34,7 @@ function editDoc() {
|
||||
}
|
||||
|
||||
function getSpellCheckSelection() {
|
||||
var Ci = Components.interfaces;
|
||||
var Ci = SpecialPowers.Ci;
|
||||
var win = editDoc().defaultView;
|
||||
var editingSession = SpecialPowers.wrap(win.QueryInterface(Ci.nsIInterfaceRequestor))
|
||||
.getInterface(Ci.nsIWebNavigation)
|
||||
|
@ -41,8 +41,8 @@ function checkStylesheets() {
|
||||
}
|
||||
|
||||
function runTest() {
|
||||
const Ci = Components.interfaces;
|
||||
const Cc = Components.classes;
|
||||
const Ci = SpecialPowers.Ci;
|
||||
const Cc = SpecialPowers.Components.classes;
|
||||
|
||||
/** Found while fixing bug 440614 **/
|
||||
var editframe = window.frames[0];
|
||||
|
@ -549,7 +549,7 @@ function doNextTest() {
|
||||
}
|
||||
|
||||
function getLoadContext() {
|
||||
const Ci = Components.interfaces;
|
||||
const Ci = SpecialPowers.Ci;
|
||||
return SpecialPowers.wrap(window)
|
||||
.QueryInterface(Ci.nsIInterfaceRequestor)
|
||||
.getInterface(Ci.nsIWebNavigation)
|
||||
@ -564,11 +564,11 @@ function runTest(test) {
|
||||
} else
|
||||
elem.focus();
|
||||
|
||||
var trans = SpecialPowers.wrap(Components).classes["@mozilla.org/widget/transferable;1"]
|
||||
.createInstance(Components.interfaces.nsITransferable);
|
||||
var trans = SpecialPowers.Cc["@mozilla.org/widget/transferable;1"]
|
||||
.createInstance(SpecialPowers.Ci.nsITransferable);
|
||||
trans.init(getLoadContext());
|
||||
var data = SpecialPowers.wrap(Components).classes["@mozilla.org/supports-string;1"]
|
||||
.createInstance(Components.interfaces.nsISupportsString);
|
||||
var data = SpecialPowers.Cc["@mozilla.org/supports-string;1"]
|
||||
.createInstance(SpecialPowers.Ci.nsISupportsString);
|
||||
data.data = test.payload;
|
||||
trans.addDataFlavor("text/html");
|
||||
trans.setTransferData("text/html", data, data.data.length * 2);
|
||||
@ -581,16 +581,16 @@ function runTest(test) {
|
||||
getSelection().collapse(elem, 0);
|
||||
win = window;
|
||||
}
|
||||
editor = SpecialPowers.wrap(win).QueryInterface(Components.interfaces.nsIInterfaceRequestor)
|
||||
.getInterface(Components.interfaces.nsIWebNavigation)
|
||||
.QueryInterface(Components.interfaces.nsIEditorDocShell)
|
||||
editor = SpecialPowers.wrap(win).QueryInterface(SpecialPowers.Ci.nsIInterfaceRequestor)
|
||||
.getInterface(SpecialPowers.Ci.nsIWebNavigation)
|
||||
.QueryInterface(SpecialPowers.Ci.nsIEditorDocShell)
|
||||
.editor;
|
||||
editor.pasteTransferable(trans);
|
||||
} else {
|
||||
var clipboard = SpecialPowers.wrap(Components).classes["@mozilla.org/widget/clipboard;1"]
|
||||
.getService(Components.interfaces.nsIClipboard);
|
||||
var clipboard = SpecialPowers.Cc["@mozilla.org/widget/clipboard;1"]
|
||||
.getService(SpecialPowers.Ci.nsIClipboard);
|
||||
|
||||
clipboard.setData(trans, null, Components.interfaces.nsIClipboard.kGlobalClipboard);
|
||||
clipboard.setData(trans, null, SpecialPowers.Ci.nsIClipboard.kGlobalClipboard);
|
||||
|
||||
synthesizeKey("V", {accelKey: true});
|
||||
}
|
||||
|
@ -8,9 +8,9 @@
|
||||
<script class="testbody" type="application/javascript">
|
||||
|
||||
var utils = SpecialPowers.wrap(window)
|
||||
.QueryInterface(Components.interfaces.nsIInterfaceRequestor).getInterface(Components.interfaces.nsIDOMWindowUtils);
|
||||
var Cc = SpecialPowers.wrap(Components).classes;
|
||||
var Ci = Components.interfaces;
|
||||
.QueryInterface(SpecialPowers.Ci.nsIInterfaceRequestor).getInterface(SpecialPowers.Ci.nsIDOMWindowUtils);
|
||||
var Cc = SpecialPowers.Cc;
|
||||
var Ci = SpecialPowers.Ci;
|
||||
|
||||
function getLoadContext() {
|
||||
return SpecialPowers.wrap(window)
|
||||
@ -87,7 +87,7 @@ function runTest() {
|
||||
}
|
||||
|
||||
// We cannot use plain strings, we have to use nsSupportsString.
|
||||
var supportsStringClass = Components.classes["@mozilla.org/supports-string;1"];
|
||||
var supportsStringClass = SpecialPowers.Components.classes["@mozilla.org/supports-string;1"];
|
||||
var ssData = supportsStringClass.createInstance(Ci.nsISupportsString);
|
||||
|
||||
// Create the transferable.
|
||||
|
@ -84,13 +84,13 @@ function onLoadIFrame()
|
||||
var frameDoc = gIFrame.contentWindow.document;
|
||||
|
||||
var selCon = SpecialPowers.wrap(gIFrame).contentWindow.
|
||||
QueryInterface(Components.interfaces.nsIInterfaceRequestor).
|
||||
getInterface(Components.interfaces.nsIWebNavigation).
|
||||
QueryInterface(Components.interfaces.nsIInterfaceRequestor).
|
||||
getInterface(Components.interfaces.nsISelectionDisplay).
|
||||
QueryInterface(Components.interfaces.nsISelectionController);
|
||||
QueryInterface(SpecialPowers.Ci.nsIInterfaceRequestor).
|
||||
getInterface(SpecialPowers.Ci.nsIWebNavigation).
|
||||
QueryInterface(SpecialPowers.Ci.nsIInterfaceRequestor).
|
||||
getInterface(SpecialPowers.Ci.nsISelectionDisplay).
|
||||
QueryInterface(SpecialPowers.Ci.nsISelectionController);
|
||||
var utils = SpecialPowers.getDOMWindowUtils(window);
|
||||
const nsIDOMNode = Components.interfaces.nsIDOMNode;
|
||||
const nsIDOMNode = SpecialPowers.Ci.nsIDOMNode;
|
||||
|
||||
// move focus to the HTML editor
|
||||
const kTest = kTests[gTestIndex];
|
||||
|
@ -21,7 +21,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=772288
|
||||
/** Test for Bug 772288 **/
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
const Cu = SpecialPowers.wrap(Components).utils;
|
||||
const Cu = SpecialPowers.Cu;
|
||||
|
||||
function doTest() {
|
||||
msg = "Services should be imported on window";
|
||||
|
@ -17,7 +17,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=774245
|
||||
<pre id="test">
|
||||
<script type="application/javascript">
|
||||
|
||||
/** Test for Components.lookupMethod in content scope. **/
|
||||
/** Test for SpecialPowers.Components.lookupMethod in content scope. **/
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
// We're testing things from an unprivileged perspective, so don't use
|
||||
|
@ -10,7 +10,7 @@
|
||||
var d = document.querySelector("input");
|
||||
d.value = "b";
|
||||
d.focus();
|
||||
var editor = SpecialPowers.wrap(d).QueryInterface(Components.interfaces.nsIDOMNSEditableElement).editor;
|
||||
var editor = SpecialPowers.wrap(d).QueryInterface(SpecialPowers.Ci.nsIDOMNSEditableElement).editor;
|
||||
var sel = editor.selection;
|
||||
var t = editor.rootElement.firstChild;
|
||||
sel.collapse(t, 1); // put the caret at the end of the textbox
|
||||
|
@ -15,7 +15,7 @@
|
||||
var d = document.querySelector("input");
|
||||
d.value = "a";
|
||||
d.focus();
|
||||
var editor = SpecialPowers.wrap(d).QueryInterface(Components.interfaces.nsIDOMNSEditableElement).editor;
|
||||
var editor = SpecialPowers.wrap(d).QueryInterface(SpecialPowers.Ci.nsIDOMNSEditableElement).editor;
|
||||
var sel = editor.selection;
|
||||
var t = editor.rootElement.firstChild;
|
||||
sel.collapse(t, 1); // put the caret at the end of the div
|
||||
|
@ -38,11 +38,11 @@ addLoadEvent(function() {
|
||||
|
||||
var viewer =
|
||||
SpecialPowers.wrap($("ourFrame")).contentWindow
|
||||
.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
|
||||
.getInterface(Components.interfaces.nsIWebNavigation)
|
||||
.QueryInterface(Components.interfaces.nsIDocShell)
|
||||
.QueryInterface(SpecialPowers.Ci.nsIInterfaceRequestor)
|
||||
.getInterface(SpecialPowers.Ci.nsIWebNavigation)
|
||||
.QueryInterface(SpecialPowers.Ci.nsIDocShell)
|
||||
.contentViewer
|
||||
.QueryInterface(Components.interfaces.nsIMarkupDocumentViewer);
|
||||
.QueryInterface(SpecialPowers.Ci.nsIMarkupDocumentViewer);
|
||||
viewer.fullZoom = 2;
|
||||
|
||||
s3 = snapshotWindow(window);
|
||||
|
@ -37,7 +37,7 @@ SimpleTest.waitForExplicitFinish()
|
||||
addLoadEvent(function test() {
|
||||
|
||||
var
|
||||
CI = Components.interfaces,
|
||||
CI = SpecialPowers.Components.interfaces,
|
||||
WinUtils = SpecialPowers.getDOMWindowUtils(window),
|
||||
sec = netscape.security,
|
||||
eSelect = $("eSelect"),
|
||||
|
@ -28,8 +28,8 @@ window.fileInputGotClick = false;
|
||||
// on a mac.
|
||||
function setOrRestoreTabFocus(newValue) {
|
||||
const prefSvcContractID = "@mozilla.org/preferences-service;1";
|
||||
const prefSvcIID = Components.interfaces.nsIPrefService;
|
||||
var prefs = SpecialPowers.wrap(Components).classes[prefSvcContractID].getService(prefSvcIID)
|
||||
const prefSvcIID = SpecialPowers.Ci.nsIPrefService;
|
||||
var prefs = SpecialPowers.Cc[prefSvcContractID].getService(prefSvcIID)
|
||||
.getBranch("accessibility.");
|
||||
if (!newValue) {
|
||||
prefs.clearUserPref("tabfocus");
|
||||
@ -41,7 +41,7 @@ function setOrRestoreTabFocus(newValue) {
|
||||
function tab() {
|
||||
var utils = SpecialPowers.DOMWindowUtils;
|
||||
// Send tab key events.
|
||||
var key = Components.interfaces.nsIDOMKeyEvent.DOM_VK_TAB;
|
||||
var key = SpecialPowers.Ci.nsIDOMKeyEvent.DOM_VK_TAB;
|
||||
utils.sendKeyEvent("keydown", key, 0, 0);
|
||||
utils.sendKeyEvent("keypress", key, 0, 0);
|
||||
utils.sendKeyEvent("keyup", key, 0, 0);
|
||||
|
@ -299,7 +299,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=348681
|
||||
selection.addRange(range8);
|
||||
intervalChecker.reset();
|
||||
intervalChecker.addExpected(testNode, 8, 10);
|
||||
var privSel = selection.QueryInterface(Components.interfaces.nsISelectionPrivate);
|
||||
var privSel = selection.QueryInterface(SpecialPowers.Ci.nsISelectionPrivate);
|
||||
ok(privSel, "Test 17 - QIed to instance of nsISelection2 interface");
|
||||
var numResults = {};
|
||||
var results = privSel.GetRangesForInterval(testNode, 8, testNode, 10,
|
||||
|
@ -1,6 +1,6 @@
|
||||
var Ci = Components.interfaces;
|
||||
var Ci = SpecialPowers.Ci;
|
||||
ok(Ci != null, "Access Ci");
|
||||
var Cc = SpecialPowers.wrap(Components).classes;
|
||||
var Cc = SpecialPowers.Cc;
|
||||
ok(Cc != null, "Access Cc");
|
||||
|
||||
var didDialog;
|
||||
@ -24,7 +24,7 @@ var observer = {
|
||||
Ci.nsISupports, Ci.nsISupportsWeakReference];
|
||||
|
||||
if (!interfaces.some( function(v) { return iid.equals(v) } ))
|
||||
throw Components.results.NS_ERROR_NO_INTERFACE;
|
||||
throw SpecialPowers.Components.results.NS_ERROR_NO_INTERFACE;
|
||||
return this;
|
||||
},
|
||||
|
||||
|
@ -10,7 +10,7 @@
|
||||
<script class="testbody" type="text/javascript">
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
var Cc = SpecialPowers.wrap(Components).classes;
|
||||
var Cc = SpecialPowers.Cc;
|
||||
|
||||
testNum = 1;
|
||||
|
||||
@ -82,7 +82,7 @@
|
||||
var gCurrentTest;
|
||||
function runNextTest() {
|
||||
is(gExpectedDialogs, 0, "received expected number of auth dialogs");
|
||||
Cc["@mozilla.org/network/http-auth-manager;1"].getService(Components.interfaces.nsIHttpAuthManager).clearAll();
|
||||
Cc["@mozilla.org/network/http-auth-manager;1"].getService(SpecialPowers.Ci.nsIHttpAuthManager).clearAll();
|
||||
if (pendingTests.length > 0) {
|
||||
({expectedDialogs: gExpectedDialogs,
|
||||
test: gCurrentTest}) = pendingTests.shift();
|
||||
|
@ -137,7 +137,7 @@ var storageObserver = {
|
||||
Ci.nsISupports, Ci.nsISupportsWeakReference];
|
||||
|
||||
if (!interfaces.some( function(v) { return iid.equals(v) } ))
|
||||
throw Components.results.NS_ERROR_NO_INTERFACE;
|
||||
throw SpecialPowers.Components.results.NS_ERROR_NO_INTERFACE;
|
||||
return this;
|
||||
},
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
// Class monitoring number of open dialog windows
|
||||
// It checks there is always open just a single dialog per application
|
||||
function dialogMonitor() {
|
||||
var observerService = SpecialPowers.wrap(Components).classes["@mozilla.org/observer-service;1"]
|
||||
var observerService = SpecialPowers.Cc["@mozilla.org/observer-service;1"]
|
||||
.getService(Ci.nsIObserverService);
|
||||
observerService.addObserver(this, "domwindowopened", false);
|
||||
observerService.addObserver(this, "domwindowclosed", false);
|
||||
@ -33,7 +33,7 @@
|
||||
const interfaces = [Ci.nsIObserver, Ci.nsISupports];
|
||||
|
||||
if (!interfaces.some( function(v) { return iid.equals(v) } ))
|
||||
throw Components.results.NS_ERROR_NO_INTERFACE;
|
||||
throw SpecialPowers.Components.results.NS_ERROR_NO_INTERFACE;
|
||||
return this;
|
||||
},
|
||||
|
||||
@ -51,7 +51,7 @@
|
||||
},
|
||||
|
||||
shutdown: function() {
|
||||
var observerService = SpecialPowers.wrap(Components).classes["@mozilla.org/observer-service;1"]
|
||||
var observerService = SpecialPowers.Cc["@mozilla.org/observer-service;1"]
|
||||
.getService(Ci.nsIObserverService);
|
||||
observerService.removeObserver(this, "domwindowopened");
|
||||
observerService.removeObserver(this, "domwindowclosed");
|
||||
@ -68,11 +68,11 @@
|
||||
var pwmgr, logins = [];
|
||||
|
||||
function initLogins() {
|
||||
pwmgr = SpecialPowers.wrap(Components).classes["@mozilla.org/login-manager;1"]
|
||||
pwmgr = SpecialPowers.Cc["@mozilla.org/login-manager;1"]
|
||||
.getService(Ci.nsILoginManager);
|
||||
|
||||
function addLogin(host, realm, user, pass) {
|
||||
var login = SpecialPowers.wrap(Components).classes["@mozilla.org/login-manager/loginInfo;1"]
|
||||
var login = SpecialPowers.Cc["@mozilla.org/login-manager/loginInfo;1"]
|
||||
.createInstance(Ci.nsILoginInfo);
|
||||
login.init(host, null, realm, user, pass, "", "");
|
||||
pwmgr.addLogin(login);
|
||||
@ -80,11 +80,11 @@
|
||||
}
|
||||
|
||||
//need to allow for arbitrary network servers defined in PAC instead of a hardcoded moz-proxy.
|
||||
var ios = SpecialPowers.wrap(Components)
|
||||
var ios = SpecialPowers.wrap(SpecialPowers.Components)
|
||||
.classes["@mozilla.org/network/io-service;1"]
|
||||
.getService(Components.interfaces.nsIIOService);
|
||||
.getService(SpecialPowers.Ci.nsIIOService);
|
||||
|
||||
var pps = SpecialPowers.wrap(Components)
|
||||
var pps = SpecialPowers.wrap(SpecialPowers.Components)
|
||||
.classes["@mozilla.org/network/protocol-proxy-service;1"]
|
||||
.getService();
|
||||
|
||||
@ -121,7 +121,7 @@
|
||||
for (i in logins)
|
||||
pwmgr.removeLogin(logins[i]);
|
||||
|
||||
var authMgr = SpecialPowers.wrap(Components).classes['@mozilla.org/network/http-auth-manager;1']
|
||||
var authMgr = SpecialPowers.Cc['@mozilla.org/network/http-auth-manager;1']
|
||||
.getService(Ci.nsIHttpAuthManager);
|
||||
authMgr.clearAll();
|
||||
|
||||
|
@ -22,12 +22,12 @@ Login Manager test: XML prompt
|
||||
var pwmgr, login1, login2;
|
||||
|
||||
function initLogins() {
|
||||
pwmgr = SpecialPowers.wrap(Components).classes["@mozilla.org/login-manager;1"]
|
||||
pwmgr = SpecialPowers.Cc["@mozilla.org/login-manager;1"]
|
||||
.getService(Ci.nsILoginManager);
|
||||
|
||||
login1 = SpecialPowers.wrap(Components).classes["@mozilla.org/login-manager/loginInfo;1"]
|
||||
login1 = SpecialPowers.Cc["@mozilla.org/login-manager/loginInfo;1"]
|
||||
.createInstance(Ci.nsILoginInfo);
|
||||
login2 = SpecialPowers.wrap(Components).classes["@mozilla.org/login-manager/loginInfo;1"]
|
||||
login2 = SpecialPowers.Cc["@mozilla.org/login-manager/loginInfo;1"]
|
||||
.createInstance(Ci.nsILoginInfo);
|
||||
|
||||
login1.init("http://mochi.test:8888", null, "xml",
|
||||
@ -164,8 +164,8 @@ initLogins();
|
||||
|
||||
// clear plain HTTP auth sessions before the test, to allow
|
||||
// running them more than once.
|
||||
var authMgr = SpecialPowers.wrap(Components).classes['@mozilla.org/network/http-auth-manager;1']
|
||||
.getService(Components.interfaces.nsIHttpAuthManager);
|
||||
var authMgr = SpecialPowers.Cc['@mozilla.org/network/http-auth-manager;1']
|
||||
.getService(SpecialPowers.Ci.nsIHttpAuthManager);
|
||||
authMgr.clearAll();
|
||||
|
||||
// start the tests
|
||||
|
@ -31,7 +31,7 @@ var utils = SpecialPowers.DOMWindowUtils;
|
||||
|
||||
function hasTabModalPrompts() {
|
||||
var prefName = "prompts.tab_modal.enabled";
|
||||
var Services = SpecialPowers.wrap(Components).utils
|
||||
var Services = SpecialPowers.Cu
|
||||
.import("resource://gre/modules/Services.jsm")
|
||||
.Services;
|
||||
return Services.prefs.getPrefType(prefName) == Services.prefs.PREF_BOOL &&
|
||||
|
@ -38,7 +38,7 @@ function $_(formNum, name) {
|
||||
// This basically sends an untargeted key event, to whatever's focused.
|
||||
function doKey(aKey, modifier) {
|
||||
var keyName = "DOM_VK_" + aKey.toUpperCase();
|
||||
var key = Components.interfaces.nsIDOMKeyEvent[keyName];
|
||||
var key = SpecialPowers.Ci.nsIDOMKeyEvent[keyName];
|
||||
|
||||
// undefined --> null
|
||||
if (!modifier)
|
||||
@ -54,7 +54,7 @@ function doKey(aKey, modifier) {
|
||||
|
||||
|
||||
function getAutocompletePopup() {
|
||||
var Ci = Components.interfaces;
|
||||
var Ci = SpecialPowers.Ci;
|
||||
chromeWin = SpecialPowers.wrap(window)
|
||||
.QueryInterface(Ci.nsIInterfaceRequestor)
|
||||
.getInterface(Ci.nsIWebNavigation)
|
||||
@ -71,8 +71,8 @@ function getAutocompletePopup() {
|
||||
|
||||
|
||||
function cleanUpFormHist() {
|
||||
var formhist = SpecialPowers.wrap(Components).classes["@mozilla.org/satchel/form-history;1"].
|
||||
getService(Components.interfaces.nsIFormHistory2);
|
||||
var formhist = SpecialPowers.Cc["@mozilla.org/satchel/form-history;1"].
|
||||
getService(SpecialPowers.Ci.nsIFormHistory2);
|
||||
formhist.removeAllEntries();
|
||||
}
|
||||
cleanUpFormHist();
|
||||
|
@ -36,8 +36,8 @@ autocompletePopup.style.direction = "ltr";
|
||||
var input = $_(1, "field1");
|
||||
|
||||
// Get the form history service
|
||||
var fh = SpecialPowers.wrap(Components).classes["@mozilla.org/satchel/form-history;1"].
|
||||
getService(Components.interfaces.nsIFormHistory2);
|
||||
var fh = SpecialPowers.Cc["@mozilla.org/satchel/form-history;1"].
|
||||
getService(SpecialPowers.Ci.nsIFormHistory2);
|
||||
ok(fh != null, "got form history service");
|
||||
|
||||
fh.removeAllEntries();
|
||||
|
@ -251,7 +251,7 @@ function openMenu(menu)
|
||||
}
|
||||
else {
|
||||
var bo = menu.boxObject;
|
||||
if (bo instanceof Components.interfaces.nsIMenuBoxObject)
|
||||
if (bo instanceof SpecialPowers.Ci.nsIMenuBoxObject)
|
||||
bo.openMenu(true);
|
||||
else
|
||||
synthesizeMouse(menu, 4, 4, { });
|
||||
@ -265,7 +265,7 @@ function closeMenu(menu, popup)
|
||||
}
|
||||
else {
|
||||
var bo = menu.boxObject;
|
||||
if (bo instanceof Components.interfaces.nsIMenuBoxObject)
|
||||
if (bo instanceof SpecialPowers.Ci.nsIMenuBoxObject)
|
||||
bo.openMenu(false);
|
||||
else
|
||||
popup.hidePopup();
|
||||
@ -292,7 +292,7 @@ function checkOpen(menuid, testname)
|
||||
var menu = document.getElementById(menuid);
|
||||
if ("open" in menu)
|
||||
ok(menu.open, testname + " " + menuid + " menu is open");
|
||||
else if (menu.boxObject instanceof Components.interfaces.nsIMenuBoxObject)
|
||||
else if (menu.boxObject instanceof SpecialPowers.Ci.nsIMenuBoxObject)
|
||||
ok(menu.getAttribute("open") == "true", testname + " " + menuid + " menu is open");
|
||||
}
|
||||
|
||||
@ -301,7 +301,7 @@ function checkClosed(menuid, testname)
|
||||
var menu = document.getElementById(menuid);
|
||||
if ("open" in menu)
|
||||
ok(!menu.open, testname + " " + menuid + " menu is open");
|
||||
else if (menu.boxObject instanceof Components.interfaces.nsIMenuBoxObject)
|
||||
else if (menu.boxObject instanceof SpecialPowers.Ci.nsIMenuBoxObject)
|
||||
ok(!menu.hasAttribute("open"), testname + " " + menuid + " menu is closed");
|
||||
}
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
(function() {
|
||||
// Set cache size to something large
|
||||
var prefService = SpecialPowers.wrap(Components).classes["@mozilla.org/preferences-service;1"]
|
||||
.getService(Components.interfaces.nsIPrefService);
|
||||
var prefService = SpecialPowers.Cc["@mozilla.org/preferences-service;1"]
|
||||
.getService(SpecialPowers.Ci.nsIPrefService);
|
||||
var branch = prefService.getBranch("media.");
|
||||
var oldSize = branch.getIntPref("cache_size");
|
||||
branch.setIntPref("cache_size", 40000);
|
||||
|
@ -6,9 +6,9 @@
|
||||
|
||||
"use strict";
|
||||
|
||||
const Cc = SpecialPowers.wrap(Components).classes;
|
||||
const Ci = Components.interfaces;
|
||||
const Cu = SpecialPowers.wrap(Components).utils;
|
||||
const Cc = SpecialPowers.Cc;
|
||||
const Ci = SpecialPowers.Ci;
|
||||
const Cu = SpecialPowers.Cu;
|
||||
|
||||
const TEST_URL = "http://mochi.test:8888";
|
||||
const TEST_URL2 = "https://myfavoritebaconinacan.com";
|
||||
|
@ -5,7 +5,7 @@
|
||||
// handlerApp.xhtml grabs this for verification purposes via window.opener
|
||||
var testURI = "webcal://127.0.0.1/rheeeeet.html";
|
||||
|
||||
const Cc = SpecialPowers.wrap(Components).classes;
|
||||
const Cc = SpecialPowers.Cc;
|
||||
|
||||
function test() {
|
||||
|
||||
@ -18,7 +18,7 @@ function test() {
|
||||
|
||||
// set up the web handler object
|
||||
var webHandler = Cc["@mozilla.org/uriloader/web-handler-app;1"].
|
||||
createInstance(Components.interfaces.nsIWebHandlerApp);
|
||||
createInstance(SpecialPowers.Ci.nsIWebHandlerApp);
|
||||
webHandler.name = "Test Web Handler App";
|
||||
webHandler.uriTemplate =
|
||||
"http://mochi.test:8888/tests/uriloader/exthandler/tests/mochitest/" +
|
||||
@ -26,15 +26,15 @@ function test() {
|
||||
|
||||
// set up the uri to test with
|
||||
var ioService = Cc["@mozilla.org/network/io-service;1"].
|
||||
getService(Components.interfaces.nsIIOService);
|
||||
getService(SpecialPowers.Ci.nsIIOService);
|
||||
var uri = ioService.newURI(testURI, null, null);
|
||||
|
||||
// create a window, and launch the handler in it
|
||||
var newWindow = window.open("", "handlerWindow", "height=300,width=300");
|
||||
var windowContext =
|
||||
SpecialPowers.wrap(newWindow).QueryInterface(Components.interfaces.nsIInterfaceRequestor).
|
||||
getInterface(Components.interfaces.nsIWebNavigation).
|
||||
QueryInterface(Components.interfaces.nsIDocShell);
|
||||
SpecialPowers.wrap(newWindow).QueryInterface(SpecialPowers.Ci.nsIInterfaceRequestor).
|
||||
getInterface(SpecialPowers.Ci.nsIWebNavigation).
|
||||
QueryInterface(SpecialPowers.Ci.nsIDocShell);
|
||||
|
||||
webHandler.launchWithURI(uri, windowContext);
|
||||
|
||||
@ -50,18 +50,18 @@ function test() {
|
||||
|
||||
// set up the local handler object
|
||||
var localHandler = Cc["@mozilla.org/uriloader/local-handler-app;1"].
|
||||
createInstance(Components.interfaces.nsILocalHandlerApp);
|
||||
createInstance(SpecialPowers.Ci.nsILocalHandlerApp);
|
||||
localHandler.name = "Test Local Handler App";
|
||||
|
||||
// get a local app that we know will be there and do something sane
|
||||
var osString = Cc["@mozilla.org/xre/app-info;1"].
|
||||
getService(Components.interfaces.nsIXULRuntime).OS;
|
||||
getService(SpecialPowers.Ci.nsIXULRuntime).OS;
|
||||
|
||||
var dirSvc = Cc["@mozilla.org/file/directory_service;1"].
|
||||
getService(Components.interfaces.nsIDirectoryServiceProvider);
|
||||
getService(SpecialPowers.Ci.nsIDirectoryServiceProvider);
|
||||
if (osString == "WINNT") {
|
||||
var windowsDir = dirSvc.getFile("WinD", {});
|
||||
var exe = windowsDir.clone().QueryInterface(Components.interfaces.nsILocalFile);
|
||||
var exe = windowsDir.clone().QueryInterface(SpecialPowers.Ci.nsILocalFile);
|
||||
exe.appendRelativePath("SYSTEM32\\HOSTNAME.EXE");
|
||||
|
||||
} else if (osString == "Darwin") {
|
||||
@ -79,13 +79,13 @@ function test() {
|
||||
|
||||
// assume a generic UNIX variant
|
||||
exe = Cc["@mozilla.org/file/local;1"].
|
||||
createInstance(Components.interfaces.nsILocalFile);
|
||||
createInstance(SpecialPowers.Ci.nsILocalFile);
|
||||
exe.initWithPath("/bin/echo");
|
||||
}
|
||||
} else {
|
||||
// assume a generic UNIX variant
|
||||
exe = Cc["@mozilla.org/file/local;1"].
|
||||
createInstance(Components.interfaces.nsILocalFile);
|
||||
createInstance(SpecialPowers.Ci.nsILocalFile);
|
||||
exe.initWithPath("/bin/echo");
|
||||
}
|
||||
|
||||
@ -100,11 +100,11 @@ function test() {
|
||||
if (osString == "NOTDarwin") {
|
||||
|
||||
var killall = Cc["@mozilla.org/file/local;1"].
|
||||
createInstance(Components.interfaces.nsILocalFile);
|
||||
createInstance(SpecialPowers.Ci.nsILocalFile);
|
||||
killall.initWithPath("/usr/bin/killall");
|
||||
|
||||
var process = Cc["@mozilla.org/process/util;1"].
|
||||
createInstance(Components.interfaces.nsIProcess);
|
||||
createInstance(SpecialPowers.Ci.nsIProcess);
|
||||
process.init(killall);
|
||||
|
||||
var args = ['iCal'];
|
||||
|
Loading…
Reference in New Issue
Block a user