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:
Bobby Holley 2012-09-24 14:46:29 +02:00
parent 7f912ddc79
commit 9f03f90fb7
97 changed files with 332 additions and 332 deletions

View File

@ -18,10 +18,10 @@ Browser context menu tests.
/** Test for Login Manager: multiple login autocomplete. **/ /** 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 Cc = SpecialPowers.Components.classes;
const Ci = Components.interfaces; const Ci = SpecialPowers.Ci;
function openContextMenuFor(element, shiftkey, shouldWaitForFocus) { function openContextMenuFor(element, shiftkey, shouldWaitForFocus) {
// Context menu should be closed before we open it again. // Context menu should be closed before we open it again.

View File

@ -26,7 +26,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=462856
<script class="testbody" type="text/javascript"> <script class="testbody" type="text/javascript">
SimpleTest.waitForExplicitFinish(); SimpleTest.waitForExplicitFinish();
const Cc = SpecialPowers.wrap(Components).classes; const Cc = SpecialPowers.Cc;
var numFinished = 0; var numFinished = 0;
@ -36,17 +36,17 @@ window.addEventListener("message", function(event) {
if (++numFinished == 3) { if (++numFinished == 3) {
// Clean up after ourself // Clean up after ourself
var pm = Cc["@mozilla.org/permissionmanager;1"]. var pm = Cc["@mozilla.org/permissionmanager;1"].
getService(Components.interfaces.nsIPermissionManager); getService(SpecialPowers.Ci.nsIPermissionManager);
var ioService = Cc["@mozilla.org/network/io-service;1"] 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 uri1 = ioService.newURI(frames.testFrame.location, null, null);
var uri2 = ioService.newURI(frames.testFrame3.location, null, null); var uri2 = ioService.newURI(frames.testFrame3.location, null, null);
var principal1 = Cc["@mozilla.org/scriptsecuritymanager;1"] var principal1 = Cc["@mozilla.org/scriptsecuritymanager;1"]
.getService(Components.interfaces.nsIScriptSecurityManager) .getService(SpecialPowers.Ci.nsIScriptSecurityManager)
.getNoAppCodebasePrincipal(uri1); .getNoAppCodebasePrincipal(uri1);
var principal2 = Cc["@mozilla.org/scriptsecuritymanager;1"] var principal2 = Cc["@mozilla.org/scriptsecuritymanager;1"]
.getService(Components.interfaces.nsIScriptSecurityManager) .getService(SpecialPowers.Ci.nsIScriptSecurityManager)
.getNoAppCodebasePrincipal(uri2); .getNoAppCodebasePrincipal(uri2);
pm.removeFromPrincipal(principal1, "offline-app"); pm.removeFromPrincipal(principal1, "offline-app");
@ -108,8 +108,8 @@ function loaded() {
// Click the notification bar's "Allow" button. This should kick // Click the notification bar's "Allow" button. This should kick
// off updates, which will eventually lead to getting messages from // off updates, which will eventually lead to getting messages from
// the children. // the children.
var wm = SpecialPowers.wrap(Components).classes["@mozilla.org/appshell/window-mediator;1"]. var wm = SpecialPowers.Cc["@mozilla.org/appshell/window-mediator;1"].
getService(Components.interfaces.nsIWindowMediator); getService(SpecialPowers.Ci.nsIWindowMediator);
var win = wm.getMostRecentWindow("navigator:browser"); var win = wm.getMostRecentWindow("navigator:browser");
var notificationBox = win.gBrowser.getNotificationBox(); var notificationBox = win.gBrowser.getNotificationBox();

View File

@ -32,14 +32,14 @@ SimpleTest.waitForExplicitFinish();
function finishTest() { function finishTest() {
// Clean up after ourselves. // Clean up after ourselves.
var Cc = SpecialPowers.wrap(Components).classes; var Cc = SpecialPowers.Cc;
var pm = Cc["@mozilla.org/permissionmanager;1"]. 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); .newURI(window.frames[0].location, null, null);
var principal = Cc["@mozilla.org/scriptsecuritymanager;1"] var principal = Cc["@mozilla.org/scriptsecuritymanager;1"]
.getService(Components.interfaces.nsIScriptSecurityManager) .getService(SpecialPowers.Ci.nsIScriptSecurityManager)
.getNoAppCodebasePrincipal(uri); .getNoAppCodebasePrincipal(uri);
pm.removeFromPrincipal(principal, "offline-app"); pm.removeFromPrincipal(principal, "offline-app");
@ -99,8 +99,8 @@ function loaded() {
// Click the notification bar's "Allow" button. This should kick // Click the notification bar's "Allow" button. This should kick
// off updates, which will eventually lead to getting messages from // off updates, which will eventually lead to getting messages from
// the iframe. // the iframe.
var wm = SpecialPowers.wrap(Components).classes["@mozilla.org/appshell/window-mediator;1"]. var wm = SpecialPowers.Cc["@mozilla.org/appshell/window-mediator;1"].
getService(Components.interfaces.nsIWindowMediator); getService(SpecialPowers.Ci.nsIWindowMediator);
var win = wm.getMostRecentWindow("navigator:browser"); var win = wm.getMostRecentWindow("navigator:browser");
var notificationBox = win.gBrowser.getNotificationBox(); var notificationBox = win.gBrowser.getNotificationBox();

View File

@ -50,14 +50,14 @@ function tryChromeLoad()
function tryComponentsClasses() function tryComponentsClasses()
{ {
return Components.classes["@mozilla.org/dummy;1"]; return SpecialPowers.Components.classes["@mozilla.org/dummy;1"];
} }
is(inciteCaps(tryChromeLoad), "denied-stack", is(inciteCaps(tryChromeLoad), "denied-stack",
"should get stack for content-loading-chrome rejection"); "should get stack for content-loading-chrome rejection");
is(inciteCaps(tryComponentsClasses), "denied-stack", is(inciteCaps(tryComponentsClasses), "denied-stack",
"should get stack for Components.classes rejection"); "should get stack for SpecialPowers.Components.classes rejection");
</script> </script>
</pre> </pre>
</body> </body>

View File

@ -21,10 +21,10 @@ function runTests() {
let tearDown = (function setUp() { let tearDown = (function setUp() {
SimpleTest.waitForExplicitFinish(); 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"] 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", authMgr.setAuthIdentity("http", "example.com", 80, "basic", "testrealm",
"", "example.com", "user1", "password1"); "", "example.com", "user1", "password1");

View File

@ -16,7 +16,7 @@
<script class="testbody" type="application/javascript;version=1.8"> <script class="testbody" type="application/javascript;version=1.8">
function runTests() { function runTests() {
var comp = SpecialPowers.wrap(Components); var comp = SpecialPowers.wrap(SpecialPowers.Components);
SimpleTest.waitForExplicitFinish(); SimpleTest.waitForExplicitFinish();
SpecialPowers.addPermission("systemXHR", true, document); SpecialPowers.addPermission("systemXHR", true, document);

View File

@ -21,19 +21,19 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=166235
<script type="application/javascript"> <script type="application/javascript">
/** Test for Bug 166235 **/ /** Test for Bug 166235 **/
var Cc = SpecialPowers.wrap(Components).classes; var Cc = SpecialPowers.Cc;
var Ci = SpecialPowers.wrap(Components).interfaces; var Ci = SpecialPowers.Ci;
var webnav = SpecialPowers.wrap(window).QueryInterface(Components.interfaces.nsIInterfaceRequestor) var webnav = SpecialPowers.wrap(window).QueryInterface(SpecialPowers.Ci.nsIInterfaceRequestor)
.getInterface(Components.interfaces.nsIWebNavigation) .getInterface(SpecialPowers.Ci.nsIWebNavigation)
var docShell = webnav.QueryInterface(Components.interfaces.nsIDocShell); var docShell = webnav.QueryInterface(SpecialPowers.Ci.nsIDocShell);
var documentViewer = docShell.contentViewer var documentViewer = docShell.contentViewer
.QueryInterface(Components.interfaces.nsIContentViewerEdit); .QueryInterface(SpecialPowers.Ci.nsIContentViewerEdit);
var clipboard = Cc["@mozilla.org/widget/clipboard;1"] var clipboard = Cc["@mozilla.org/widget/clipboard;1"]
.getService(Components.interfaces.nsIClipboard); .getService(SpecialPowers.Ci.nsIClipboard);
var textarea = SpecialPowers.wrap(document).getElementById('input'); var textarea = SpecialPowers.wrap(document).getElementById('input');
@ -54,7 +54,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=166235
} }
function getClipboardData(mime) { function getClipboardData(mime) {
var transferable = Cc['@mozilla.org/widget/transferable;1'] var transferable = Cc['@mozilla.org/widget/transferable;1']
.createInstance(Components.interfaces.nsITransferable); .createInstance(SpecialPowers.Ci.nsITransferable);
transferable.init(getLoadContext()); transferable.init(getLoadContext());
transferable.addDataFlavor(mime); transferable.addDataFlavor(mime);
clipboard.getData(transferable, 1); clipboard.getData(transferable, 1);
@ -65,7 +65,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=166235
function testClipboardValue(mime, expected, test) { function testClipboardValue(mime, expected, test) {
var data = getClipboardData(mime); var data = getClipboardData(mime);
is (data.value == null ? data.value : is (data.value == null ? data.value :
data.value.QueryInterface(Components.interfaces.nsISupportsString).data, data.value.QueryInterface(SpecialPowers.Ci.nsISupportsString).data,
expected, expected,
mime + " value in the clipboard"); mime + " value in the clipboard");
return data.value; return data.value;
@ -73,7 +73,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=166235
function testPasteText(expected, test) { function testPasteText(expected, test) {
textarea.value=""; textarea.value="";
textarea.focus(); textarea.focus();
textarea.QueryInterface(Components.interfaces.nsIDOMNSEditableElement) textarea.QueryInterface(SpecialPowers.Ci.nsIDOMNSEditableElement)
.editor.paste(1); .editor.paste(1);
is(textarea.value, expected, test + ": textarea paste"); is(textarea.value, expected, test + ": textarea paste");
} }

View File

@ -32,11 +32,11 @@ function afterLoad() {
iframeDoc.getElementById("password").value = "123456"; iframeDoc.getElementById("password").value = "123456";
iframeDoc.getElementById("hidden").value = "gecko"; iframeDoc.getElementById("hidden").value = "gecko";
var file = SpecialPowers.wrap(Components).classes["@mozilla.org/file/directory_service;1"] var file = SpecialPowers.Cc["@mozilla.org/file/directory_service;1"]
.getService(Components.interfaces.nsIProperties) .getService(SpecialPowers.Ci.nsIProperties)
.get("TmpD", Components.interfaces.nsILocalFile); .get("TmpD", SpecialPowers.Ci.nsILocalFile);
file.append("345339_test.file"); 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; filePath = file.path;
SpecialPowers.wrap(iframeDoc).getElementById("file").value = filePath; SpecialPowers.wrap(iframeDoc).getElementById("file").value = filePath;

View File

@ -29,7 +29,7 @@ function checkTypes(aNode, aNodeType, aTypeArray)
function checkInterfaces(aNode, aNodeType, aInterfaceArray) function checkInterfaces(aNode, aNodeType, aInterfaceArray)
{ {
for (var i = 0; i < aInterfaceArray.length; ++i) { 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 + " interface test " + i,
aNodeType + " should be a " + aInterfaceArray[i]); aNodeType + " should be a " + aInterfaceArray[i]);
} }

View File

@ -53,7 +53,7 @@ function checkTypes(aNode, aNodeType, aTypeArray)
function checkInterfaces(aNode, aNodeType, aInterfaceArray) function checkInterfaces(aNode, aNodeType, aInterfaceArray)
{ {
for (var i = 0; i < aInterfaceArray.length; ++i) { 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 + " interface test " + i,
aNodeType + " should be a " + aInterfaceArray[i]); aNodeType + " should be a " + aInterfaceArray[i]);
} }

View File

@ -21,11 +21,11 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=375314
var lastContentType = -1; var lastContentType = -1;
const testURL = window.location.href + "/this/is/the/test/url"; const testURL = window.location.href + "/this/is/the/test/url";
const Cc = SpecialPowers.wrap(Components).classes; const Cc = SpecialPowers.Cc;
const Ci = Components.interfaces; const Ci = SpecialPowers.Ci;
// Content policy / factory implementation for the test // 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 policyName = "@mozilla.org/testpolicy;1";
var policy = { var policy = {
// nsISupports implementation // nsISupports implementation
@ -37,7 +37,7 @@ var policy = {
iid.equals(Ci.nsIContentPolicy)) iid.equals(Ci.nsIContentPolicy))
return this; return this;
throw SpecialPowers.wrap(Components).results.NS_ERROR_NO_INTERFACE; throw SpecialPowers.Cr.NS_ERROR_NO_INTERFACE;
}, },
// nsIFactory implementation // nsIFactory implementation
@ -64,7 +64,7 @@ var policy = {
} }
// Register content policy // Register content policy
var componentManager = SpecialPowers.wrap(Components).manager var componentManager = SpecialPowers.wrap(SpecialPowers.Components).manager
.QueryInterface(Ci.nsIComponentRegistrar); .QueryInterface(Ci.nsIComponentRegistrar);
componentManager.registerFactory(policyID, "Test content policy", policyName, policy); componentManager.registerFactory(policyID, "Test content policy", policyName, policy);

View File

@ -24,7 +24,7 @@ req.setRequestHeader("Content-Type", "text/plain; charset=us-ascii; boundary=012
req.send("Some text"); req.send("Some text");
is(SpecialPowers.wrap(req).channel is(SpecialPowers.wrap(req).channel
.QueryInterface(Components.interfaces.nsIHttpChannel) .QueryInterface(SpecialPowers.Ci.nsIHttpChannel)
.getRequestHeader("Content-Type"), .getRequestHeader("Content-Type"),
"text/plain; charset=UTF-8; boundary=01234567890", "text/plain; charset=UTF-8; boundary=01234567890",
"Headers should match"); "Headers should match");

View File

@ -25,7 +25,7 @@ req.setRequestHeader("Content-Type", "text/plain; charset='uTf-8'");
req.send("Some text"); req.send("Some text");
is(SpecialPowers.wrap(req).channel is(SpecialPowers.wrap(req).channel
.QueryInterface(Components.interfaces.nsIHttpChannel) .QueryInterface(SpecialPowers.Ci.nsIHttpChannel)
.getRequestHeader("Content-Type"), .getRequestHeader("Content-Type"),
"text/plain; charset='uTf-8'", "text/plain; charset='uTf-8'",
"Headers should match"); "Headers should match");

View File

@ -24,7 +24,7 @@ req.setRequestHeader("Content-Type", "text/plain; boundary=01234567890");
req.send("Some text"); req.send("Some text");
is(SpecialPowers.wrap(req).channel is(SpecialPowers.wrap(req).channel
.QueryInterface(Components.interfaces.nsIHttpChannel) .QueryInterface(SpecialPowers.Ci.nsIHttpChannel)
.getRequestHeader("Content-Type"), .getRequestHeader("Content-Type"),
"text/plain; charset=UTF-8; boundary=01234567890", "text/plain; charset=UTF-8; boundary=01234567890",
"Charset should come before boundary"); "Charset should come before boundary");

View File

@ -23,17 +23,17 @@ function loadFileContent(aFile, aCharset) {
if(aCharset == undefined) if(aCharset == undefined)
aCharset = 'UTF-8'; aCharset = 'UTF-8';
var baseUri = SpecialPowers.wrap(Components).classes['@mozilla.org/network/standard-url;1'] var baseUri = SpecialPowers.Cc['@mozilla.org/network/standard-url;1']
.createInstance(Components.interfaces.nsIURI); .createInstance(SpecialPowers.Ci.nsIURI);
baseUri.spec = window.location.href; baseUri.spec = window.location.href;
var ios = SpecialPowers.wrap(Components).classes['@mozilla.org/network/io-service;1'] var ios = SpecialPowers.Cc['@mozilla.org/network/io-service;1']
.getService(Components.interfaces.nsIIOService); .getService(SpecialPowers.Ci.nsIIOService);
var chann = ios.newChannel(aFile, aCharset, baseUri); 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); .createInstance(cis);
inputStream.init(chann.open(), aCharset, 1024, cis.DEFAULT_REPLACEMENT_CHARACTER); inputStream.init(chann.open(), aCharset, 1024, cis.DEFAULT_REPLACEMENT_CHARACTER);
var str = {}, content = ''; var str = {}, content = '';
@ -45,9 +45,9 @@ function loadFileContent(aFile, aCharset) {
function testHtmlSerializer_1 () { function testHtmlSerializer_1 () {
const de = Components.interfaces.nsIDocumentEncoder const de = SpecialPowers.Ci.nsIDocumentEncoder
var encoder = SpecialPowers.wrap(Components).classes["@mozilla.org/layout/documentEncoder;1?type=application/xhtml+xml"] var encoder = SpecialPowers.Cc["@mozilla.org/layout/documentEncoder;1?type=application/xhtml+xml"]
.createInstance(Components.interfaces.nsIDocumentEncoder); .createInstance(SpecialPowers.Ci.nsIDocumentEncoder);
var doc = SpecialPowers.wrap($("testframe")).contentDocument; var doc = SpecialPowers.wrap($("testframe")).contentDocument;
var out, expected; var out, expected;

View File

@ -19,8 +19,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=422537
<script class="testbody" type="text/javascript"> <script class="testbody" type="text/javascript">
/** Test for Bug 422537 **/ /** Test for Bug 422537 **/
var isupports_string = SpecialPowers.wrap(Components).classes["@mozilla.org/supports-string;1"] var isupports_string = SpecialPowers.Cc["@mozilla.org/supports-string;1"]
.createInstance(Components.interfaces.nsISupportsString); .createInstance(SpecialPowers.Ci.nsISupportsString);
isupports_string.data = "foo"; isupports_string.data = "foo";
const url = "http://mochi.test:8888"; const url = "http://mochi.test:8888";
@ -38,13 +38,13 @@ for each (var i in body) {
else else
xhr.send(i); xhr.send(i);
var chan = SpecialPowers.wrap(xhr).channel; 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"; throw "Must be an upload channel";
var stream = chan.uploadStream; 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"; throw "Stream must be seekable";
// the following is a no-op, but should not throw an exception // 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"); ok(true, "xhr is seekable");

View File

@ -98,7 +98,7 @@ addLoadEvent(function() {
var xhr = new XMLHttpRequest(); var xhr = new XMLHttpRequest();
xhr.open("POST", document.location.href); xhr.open("POST", document.location.href);
xhr.send(createDoc()); xhr.send(createDoc());
is(SpecialPowers.wrap(xhr).channel.QueryInterface(Components.interfaces.nsIHttpChannel) is(SpecialPowers.wrap(xhr).channel.QueryInterface(SpecialPowers.Ci.nsIHttpChannel)
.getRequestHeader("Content-Type"), .getRequestHeader("Content-Type"),
"application/xml; charset=UTF-8", "Testing correct type on the wire"); "application/xml; charset=UTF-8", "Testing correct type on the wire");
xhr.abort(); xhr.abort();

View File

@ -32,9 +32,9 @@ function testHTMLDocuments(ids, isXHTML) {
is(docType1.ownerDocument, doc1, "docType should have ownerDocument!"); is(docType1.ownerDocument, doc1, "docType should have ownerDocument!");
ok(!doc1.documentElement, "Document shouldn't have document element!"); ok(!doc1.documentElement, "Document shouldn't have document element!");
is(doc1.body, null, "Shouldn't have .body!"); 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!"); "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!"); "Document shouldn't be an SVG document!");
var docType2 = var docType2 =
@ -68,9 +68,9 @@ function testSVGDocument() {
var doc1 = document.implementation.createDocument(null, null, docType1); var doc1 = document.implementation.createDocument(null, null, docType1);
is(docType1.ownerDocument, doc1, "docType should have ownerDocument!"); is(docType1.ownerDocument, doc1, "docType should have ownerDocument!");
ok(!doc1.documentElement, "Document shouldn't have document element!"); 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!"); "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!"); "Document should be an SVG document!");
// SVG documents have .rootElement. // SVG documents have .rootElement.
@ -95,9 +95,9 @@ function testFooBarDocument() {
var doc1 = document.implementation.createDocument(null, null, docType1); var doc1 = document.implementation.createDocument(null, null, docType1);
is(docType1.ownerDocument, doc1, "docType should have ownerDocument!"); is(docType1.ownerDocument, doc1, "docType should have ownerDocument!");
ok(!doc1.documentElement, "Document shouldn't have document element!"); 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!"); "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!"); "Document shouldn't be an SVG document!");
var docType2 = var docType2 =
@ -112,9 +112,9 @@ function testFooBarDocument() {
function testNullDocTypeDocument() { function testNullDocTypeDocument() {
var doc1 = document.implementation.createDocument(null, null, null); var doc1 = document.implementation.createDocument(null, null, null);
ok(!doc1.documentElement, "Document shouldn't have document element!"); 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!"); "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!"); "Document shouldn't be an SVG document!");
var doc2 = document.implementation.createDocument("FooBarNS", var doc2 = document.implementation.createDocument("FooBarNS",

View File

@ -17,7 +17,7 @@ var path = "http://mochi.test:8888/tests/content/base/test/";
function fromCache(xhr) 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(); return ch.isFromCache();
} }

View File

@ -11,9 +11,9 @@
var url = "bug482935.sjs"; var url = "bug482935.sjs";
function clearCache() { function clearCache() {
SpecialPowers.wrap(Components).classes["@mozilla.org/network/cache-service;1"]. SpecialPowers.Cc["@mozilla.org/network/cache-service;1"].
getService(Components.interfaces.nsICacheService). getService(SpecialPowers.Ci.nsICacheService).
evictEntries(Components.interfaces.nsICache.STORE_ANYWHERE); evictEntries(SpecialPowers.Ci.nsICache.STORE_ANYWHERE);
} }
// Tests that the response is cached if the request is cancelled // Tests that the response is cached if the request is cancelled

View File

@ -19,7 +19,7 @@ function setPass(aNode) {
SimpleTest.waitForExplicitFinish(); SimpleTest.waitForExplicitFinish();
window.addEventListener("load", function() { window.addEventListener("load", function() {
const nsIDOMNodeFilter = Components.interfaces.nsIDOMNodeFilter; const nsIDOMNodeFilter = SpecialPowers.Ci.nsIDOMNodeFilter;
var walker = document.createTreeWalker( var walker = document.createTreeWalker(
document, document,
nsIDOMNodeFilter.SHOW_TEXT | nsIDOMNodeFilter.SHOW_DOCUMENT, nsIDOMNodeFilter.SHOW_TEXT | nsIDOMNodeFilter.SHOW_DOCUMENT,

View File

@ -6,14 +6,14 @@
<script> <script>
SimpleTest.waitForExplicitFinish(); SimpleTest.waitForExplicitFinish();
const Cc = SpecialPowers.wrap(Components).classes; const Cc = SpecialPowers.Cc;
const Cr = SpecialPowers.wrap(Components).results; const Cr = SpecialPowers.Cr;
function IsD2DEnabled() { function IsD2DEnabled() {
var enabled = false; var enabled = false;
try { 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) {} } catch(e) {}
return enabled; return enabled;
@ -29,7 +29,7 @@ function IsMacOSX10_5orOlder() {
if (navigator.platform.indexOf("Mac") == 0) { if (navigator.platform.indexOf("Mac") == 0) {
var version = Cc["@mozilla.org/system-info;1"] var version = Cc["@mozilla.org/system-info;1"]
.getService(Components.interfaces.nsIPropertyBag2) .getService(SpecialPowers.Ci.nsIPropertyBag2)
.getProperty("version"); .getProperty("version");
// the next line is correct: Mac OS 10.6 corresponds to Darwin version 10 ! // 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 // 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; var enabled = false;
try { 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"); enabled = (backend != "none");
} catch (e) { } } catch (e) { }
@ -55,7 +55,7 @@ function IsAzureSkia() {
var enabled = false; var enabled = false;
try { 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"); enabled = (backend == "skia");
} catch (e) { } } catch (e) { }
@ -66,7 +66,7 @@ function IsAzureCairo() {
var enabled = false; var enabled = false;
try { 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"); enabled = (backend == "cairo");
} catch (e) { } } catch (e) { }

View File

@ -23,12 +23,12 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=448602
function runTests() { function runTests() {
/* /*
Disabled due to lack of present support for JSD in JM Disabled due to lack of present support for JSD in JM
var jsdIDebuggerService = Components.interfaces.jsdIDebuggerService; var jsdIDebuggerService = SpecialPowers.Ci.jsdIDebuggerService;
var jsd = Components.classes['@mozilla.org/js/jsd/debugger-service;1'] var jsd = SpecialPowers.Components.classes['@mozilla.org/js/jsd/debugger-service;1']
.getService(jsdIDebuggerService); .getService(jsdIDebuggerService);
*/ */
var els = SpecialPowers.wrap(Components).classes["@mozilla.org/eventlistenerservice;1"] var els = SpecialPowers.Cc["@mozilla.org/eventlistenerservice;1"]
.getService(Components.interfaces.nsIEventListenerService); .getService(SpecialPowers.Ci.nsIEventListenerService);
// Event listener info tests // Event listener info tests
var root = document.getElementById("testroot"); var root = document.getElementById("testroot");
@ -53,7 +53,7 @@ function runTests() {
jsd.on(); jsd.on();
ok(jsd.isOn, "JSD should be running."); 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)"); 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].capturing, true, "Wrong phase (2)");
is(infos[0].allowsUntrusted, true, "Should allow untrusted events (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.jsType, 3, "Event listener should be a function!(2)");
is(jsdvalue.getWrappedValue(), l, "Wrong JS value! (1)"); 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)"); 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.jsType, 3, "Event listener should be a function! (3)");
is(jsdvalue2.getWrappedValue(), l, "Wrong JS value! (2)"); is(jsdvalue2.getWrappedValue(), l, "Wrong JS value! (2)");
*/ */

View File

@ -40,7 +40,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=493251
var utils = SpecialPowers.getDOMWindowUtils(win); var utils = SpecialPowers.getDOMWindowUtils(win);
ok(true, "Dipatching key event: type=" + type); ok(true, "Dipatching key event: type=" + type);
utils.sendKeyEvent(type, utils.sendKeyEvent(type,
Components.interfaces.nsIDOMKeyEvent.DOM_VK_A, SpecialPowers.Ci.nsIDOMKeyEvent.DOM_VK_A,
0, 0); 0, 0);
} }
@ -82,8 +82,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=493251
} }
ok(true, aEvent.type + " event is handled: " + detail); ok(true, aEvent.type + " event is handled: " + detail);
var fm = SpecialPowers.wrap(Components).classes["@mozilla.org/focus-manager;1"]. var fm = SpecialPowers.Cc["@mozilla.org/focus-manager;1"].
getService(Components.interfaces.nsIFocusManager); getService(SpecialPowers.Ci.nsIFocusManager);
ok(true, "focused element is \"" + fm.focusedElement + ok(true, "focused element is \"" + fm.focusedElement +
"\" and focused window is \"" + fm.focusedWindow + "\" and focused window is \"" + fm.focusedWindow +
"\" (the testing window is \"" + win + "\""); "\" (the testing window is \"" + win + "\"");

View File

@ -36,7 +36,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=545268
function dispatchKeyEvent(type) { function dispatchKeyEvent(type) {
var utils = SpecialPowers.getDOMWindowUtils(subwin); var utils = SpecialPowers.getDOMWindowUtils(subwin);
utils.sendKeyEvent(type, utils.sendKeyEvent(type,
Components.interfaces.nsIDOMKeyEvent.DOM_VK_A, SpecialPowers.Ci.nsIDOMKeyEvent.DOM_VK_A,
0, 0); 0, 0);
} }

View File

@ -26,8 +26,8 @@ function prepareListener(eventName, expectedValue) {
}; };
} }
const INPUT_SOURCE_UNKNOWN = Components.interfaces.nsIDOMMouseEvent.MOZ_SOURCE_UNKNOWN; const INPUT_SOURCE_UNKNOWN = SpecialPowers.Ci.nsIDOMMouseEvent.MOZ_SOURCE_UNKNOWN;
const INPUT_SOURCE_KEYBOARD = Components.interfaces.nsIDOMMouseEvent.MOZ_SOURCE_KEYBOARD; const INPUT_SOURCE_KEYBOARD = SpecialPowers.Ci.nsIDOMMouseEvent.MOZ_SOURCE_KEYBOARD;
function doTest() { function doTest() {
var eventNames = [ var eventNames = [

View File

@ -29,13 +29,13 @@ function check(event) {
function doTest() { function doTest() {
setup(); setup();
expectedInputSource = Components.interfaces.nsIDOMMouseEvent.MOZ_SOURCE_KEYBOARD; expectedInputSource = SpecialPowers.Ci.nsIDOMMouseEvent.MOZ_SOURCE_KEYBOARD;
testKeyboard(); testKeyboard();
expectedInputSource = Components.interfaces.nsIDOMMouseEvent.MOZ_SOURCE_MOUSE; expectedInputSource = SpecialPowers.Ci.nsIDOMMouseEvent.MOZ_SOURCE_MOUSE;
testMouse(); testMouse();
expectedInputSource = Components.interfaces.nsIDOMMouseEvent.MOZ_SOURCE_UNKNOWN; expectedInputSource = SpecialPowers.Ci.nsIDOMMouseEvent.MOZ_SOURCE_UNKNOWN;
testScriptedClicks(); testScriptedClicks();
cleanup(); cleanup();

View File

@ -18,8 +18,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=402089
function getListenerCount() { function getListenerCount() {
var Cc = SpecialPowers.wrap(Components).classes; var Cc = SpecialPowers.Cc;
var Ci = SpecialPowers.wrap(Components).interfaces; var Ci = SpecialPowers.Ci;
var dss = Cc["@mozilla.org/devicesensors;1"].getService(Ci.nsIDeviceSensors); var dss = Cc["@mozilla.org/devicesensors;1"].getService(Ci.nsIDeviceSensors);
return dss.listenerCount(Ci.nsIDeviceSensorData.TYPE_ORIENTATION); return dss.listenerCount(Ci.nsIDeviceSensorData.TYPE_ORIENTATION);

View File

@ -34,7 +34,7 @@ var escKeyReceived = false;
var escKeySent = false; var escKeySent = false;
function keyHandler(event) { function keyHandler(event) {
if (escKeyReceived == Components.interfaces.nsIDOMKeyEvent.DOM_VK_ESC) { if (escKeyReceived == SpecialPowers.Ci.nsIDOMKeyEvent.DOM_VK_ESC) {
escKeyReceived = true; escKeyReceived = true;
} }
} }

View File

@ -26,9 +26,9 @@ var fullPath;
function initVals() { function initVals() {
var dirSvc = SpecialPowers.wrap(Components).classes["@mozilla.org/file/directory_service;1"] var dirSvc = SpecialPowers.Cc["@mozilla.org/file/directory_service;1"]
.getService(Components.interfaces.nsIProperties); .getService(SpecialPowers.Ci.nsIProperties);
var file = dirSvc.get("XpcomLib", Components.interfaces.nsILocalFile); var file = dirSvc.get("XpcomLib", SpecialPowers.Ci.nsILocalFile);
isnot(file, null, "Must have file here"); isnot(file, null, "Must have file here");
leafName = file.leafName; leafName = file.leafName;

View File

@ -44,12 +44,12 @@ function setFileInputs () {
} }
function createFileWithData(fileName, fileData) { function createFileWithData(fileName, fileData) {
var dirSvc = SpecialPowers.wrap(Components).classes["@mozilla.org/file/directory_service;1"] var dirSvc = SpecialPowers.Cc["@mozilla.org/file/directory_service;1"]
.getService(Components.interfaces.nsIProperties); .getService(SpecialPowers.Ci.nsIProperties);
var testFile = dirSvc.get("ProfD", Components.interfaces.nsIFile); var testFile = dirSvc.get("ProfD", SpecialPowers.Ci.nsIFile);
testFile.append(fileName); testFile.append(fileName);
var outStream = SpecialPowers.wrap(Components).classes["@mozilla.org/network/file-output-stream;1"]. var outStream = SpecialPowers.Cc["@mozilla.org/network/file-output-stream;1"].
createInstance(Components.interfaces.nsIFileOutputStream); createInstance(SpecialPowers.Ci.nsIFileOutputStream);
outStream.init(testFile, 0x02 | 0x08 | 0x20, // write, create, truncate outStream.init(testFile, 0x02 | 0x08 | 0x20, // write, create, truncate
0666, 0); 0666, 0);
outStream.write(fileData, fileData.length); outStream.write(fileData, fileData.length);

View File

@ -26,11 +26,11 @@ SimpleTest.waitForExplicitFinish();
addLoadEvent(function() { addLoadEvent(function() {
var viewer = var viewer =
SpecialPowers.wrap(frame.contentWindow SpecialPowers.wrap(frame.contentWindow
.QueryInterface(Components.interfaces.nsIInterfaceRequestor)) .QueryInterface(SpecialPowers.Ci.nsIInterfaceRequestor))
.getInterface(Components.interfaces.nsIWebNavigation) .getInterface(SpecialPowers.Ci.nsIWebNavigation)
.QueryInterface(Components.interfaces.nsIDocShell) .QueryInterface(SpecialPowers.Ci.nsIDocShell)
.contentViewer .contentViewer
.QueryInterface(Components.interfaces.nsIMarkupDocumentViewer); .QueryInterface(SpecialPowers.Ci.nsIMarkupDocumentViewer);
viewer.fullZoom = 1.5; viewer.fullZoom = 1.5;

View File

@ -175,9 +175,9 @@ function fileUriToSrc(path, mustExist) {
if (navigator.appVersion.indexOf("Android") != -1) if (navigator.appVersion.indexOf("Android") != -1)
return path; return path;
const Ci = Components.interfaces; const Ci = SpecialPowers.Ci;
const Cc = SpecialPowers.wrap(Components).classes; const Cc = SpecialPowers.Cc;
const Cr = SpecialPowers.wrap(Components).results; const Cr = SpecialPowers.Cr;
var dirSvc = Cc["@mozilla.org/file/directory_service;1"]. var dirSvc = Cc["@mozilla.org/file/directory_service;1"].
getService(Ci.nsIProperties); getService(Ci.nsIProperties);
var f = dirSvc.get("CurWorkD", Ci.nsILocalFile); var f = dirSvc.get("CurWorkD", Ci.nsILocalFile);
@ -540,9 +540,9 @@ function mediaTestCleanup() {
(function() { (function() {
// Ensure that preload preferences are comsistent // Ensure that preload preferences are comsistent
var prefService = SpecialPowers.wrap(Components) var prefService = SpecialPowers.wrap(SpecialPowers.Components)
.classes["@mozilla.org/preferences-service;1"] .classes["@mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefService); .getService(SpecialPowers.Ci.nsIPrefService);
var branch = prefService.getBranch("media."); var branch = prefService.getBranch("media.");
var oldDefault = 2; var oldDefault = 2;
var oldAuto = 3; var oldAuto = 3;

View File

@ -36,7 +36,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=319374
var result = xp.evaluate("*", var result = xp.evaluate("*",
document.getElementById('content'), document.getElementById('content'),
null, null,
Components.interfaces.nsIDOMXPathResult. SpecialPowers.Ci.nsIDOMXPathResult.
UNORDERED_NODE_ITERATOR_TYPE, UNORDERED_NODE_ITERATOR_TYPE,
null); null);
var res = null; var res = null;
@ -66,7 +66,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=319374
var xp2 = xp.evaluate(".", var xp2 = xp.evaluate(".",
anonAttr1, anonAttr1,
null, null,
Components.interfaces.nsIDOMXPathResult. SpecialPowers.Ci.nsIDOMXPathResult.
UNORDERED_NODE_ITERATOR_TYPE, UNORDERED_NODE_ITERATOR_TYPE,
null); null);
// Attribute changing in a different anonymous tree. // Attribute changing in a different anonymous tree.
@ -84,7 +84,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=319374
var xp3 = xp.evaluate(".", var xp3 = xp.evaluate(".",
anonAttr1, anonAttr1,
null, null,
Components.interfaces.nsIDOMXPathResult. SpecialPowers.Ci.nsIDOMXPathResult.
UNORDERED_NODE_ITERATOR_TYPE, UNORDERED_NODE_ITERATOR_TYPE,
null); null);
// Attribute changing in the same anonymous tree. // Attribute changing in the same anonymous tree.

View File

@ -99,8 +99,8 @@ function isInaccessible(wnd, message) {
function xpcEnumerateContentWindows(callback) { function xpcEnumerateContentWindows(callback) {
var Ci = Components.interfaces; var Ci = SpecialPowers.Ci;
var ww = SpecialPowers.wrap(Components) var ww = SpecialPowers.wrap(SpecialPowers.Components)
.classes["@mozilla.org/embedcomp/window-watcher;1"] .classes["@mozilla.org/embedcomp/window-watcher;1"]
.getService(Ci.nsIWindowWatcher); .getService(Ci.nsIWindowWatcher);
var enumerator = ww.getWindowEnumerator(); var enumerator = ww.getWindowEnumerator();

View File

@ -26,7 +26,7 @@ SimpleTest.waitForExplicitFinish();
// checking the results. // checking the results.
const gLoadEventLoopCount = 100; const gLoadEventLoopCount = 100;
var Ci = Components.interfaces; var Ci = SpecialPowers.Ci;
var gCurrentTest; var gCurrentTest;
var gTargetWindow; var gTargetWindow;
@ -186,8 +186,8 @@ var gNextTest = 0;
function runNextTest() function runNextTest()
{ {
var prefs = SpecialPowers.wrap(Components).classes["@mozilla.org/preferences-service;1"] var prefs = SpecialPowers.Cc["@mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefBranch); .getService(SpecialPowers.Ci.nsIPrefBranch);
if (gNextTest < gTests.length) { if (gNextTest < gTests.length) {
gCurrentTest = gTests[gNextTest++]; gCurrentTest = gTests[gNextTest++];
@ -213,8 +213,8 @@ function runNextTest()
function finishTest() function finishTest()
{ {
var prefs = SpecialPowers.wrap(Components).classes["@mozilla.org/preferences-service;1"] var prefs = SpecialPowers.Cc["@mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefBranch); .getService(SpecialPowers.Ci.nsIPrefBranch);
prefs.setBoolPref("network.jar.open-unsafe-types", false); prefs.setBoolPref("network.jar.open-unsafe-types", false);
if (gNumPokes == 0) { if (gNumPokes == 0) {
@ -226,8 +226,8 @@ function finishTest()
function startTests() function startTests()
{ {
var prefs = SpecialPowers.wrap(Components).classes["@mozilla.org/preferences-service;1"] var prefs = SpecialPowers.Cc["@mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefBranch); .getService(SpecialPowers.Ci.nsIPrefBranch);
gPrefValue = prefs.getBoolPref("network.jar.open-unsafe-types"); gPrefValue = prefs.getBoolPref("network.jar.open-unsafe-types");
} }

View File

@ -71,8 +71,8 @@ function runTest() {
yield; yield;
var sh = SpecialPowers.wrap(popup) var sh = SpecialPowers.wrap(popup)
.QueryInterface(Components.interfaces.nsIInterfaceRequestor) .QueryInterface(SpecialPowers.Ci.nsIInterfaceRequestor)
.getInterface(Components.interfaces.nsIWebNavigation) .getInterface(SpecialPowers.Ci.nsIWebNavigation)
.sessionHistory; .sessionHistory;
// Get the title of the inner popup's current SHEntry // Get the title of the inner popup's current SHEntry

View File

@ -24,7 +24,7 @@ SpecialPowers.pushPrefEnv({"set": [["dom.mozAlarms.enabled", true]]}, function()
} else { } else {
ok('mozAlarms' in navigator, "navigator.mozAlarms should exist"); ok('mozAlarms' in navigator, "navigator.mozAlarms should exist");
ok(navigator.mozAlarms, "navigator.mozAlarms should return an object"); 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"); "navigator.mozAlarms should be an nsIDOMMozAlarmsManager object");
} }

View File

@ -81,12 +81,12 @@ function testHttpAuth(e) {
function testFinish() { function testFinish() {
// Clear login information stored in password manager. // Clear login information stored in password manager.
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(Components.interfaces.nsIHttpAuthManager); .getService(SpecialPowers.Ci.nsIHttpAuthManager);
authMgr.clearAll(); authMgr.clearAll();
var pwmgr = SpecialPowers.wrap(Components).classes["@mozilla.org/login-manager;1"] var pwmgr = SpecialPowers.Cc["@mozilla.org/login-manager;1"]
.getService(Components.interfaces.nsILoginManager); .getService(SpecialPowers.Ci.nsILoginManager);
pwmgr.removeAllLogins(); pwmgr.removeAllLogins();
SimpleTest.finish(); SimpleTest.finish();

View File

@ -5,7 +5,7 @@
// whitelisted key events. // whitelisted key events.
"use strict"; "use strict";
let Ci = Components.interfaces; let Ci = SpecialPowers.Ci;
let whitelistedEvents = [ let whitelistedEvents = [
Ci.nsIDOMKeyEvent.DOM_VK_ESCAPE, // Back button. Ci.nsIDOMKeyEvent.DOM_VK_ESCAPE, // Back button.

View File

@ -13,7 +13,7 @@ document.getElementById('url').innerHTML = window.location;
var alreadyBlocked = false; var alreadyBlocked = false;
addEventListener('keydown', function(e) { 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 == false) {
alreadyBlocked = true; alreadyBlocked = true;
e.preventDefault(); e.preventDefault();

View File

@ -21,7 +21,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id={674720}
"use strict"; "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/ContactService.jsm");
comp.utils.import("resource://gre/modules/PermissionPromptHelper.jsm"); comp.utils.import("resource://gre/modules/PermissionPromptHelper.jsm");
SpecialPowers.setBoolPref("dom.mozContacts.enabled", true); SpecialPowers.setBoolPref("dom.mozContacts.enabled", true);

View File

@ -21,7 +21,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id={674720}
"use strict"; "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/ContactService.jsm");
comp.utils.import("resource://gre/modules/PermissionPromptHelper.jsm"); comp.utils.import("resource://gre/modules/PermissionPromptHelper.jsm");
SpecialPowers.setBoolPref("dom.mozContacts.enabled", true); SpecialPowers.setBoolPref("dom.mozContacts.enabled", true);
@ -106,10 +106,10 @@ function onFailure() {
function verifyBlob(blob1, blob2, isLast) function verifyBlob(blob1, blob2, isLast)
{ {
dump("islast? " + isLast + "\n"); dump("islast? " + isLast + "\n");
is(blob1 instanceof Components.interfaces.nsIDOMBlob, true, is(blob1 instanceof SpecialPowers.Ci.nsIDOMBlob, true,
"Instance of nsIDOMBlob"); "Instance of nsIDOMBlob");
is(blob1 instanceof Components.interfaces.nsIDOMFile, is(blob1 instanceof SpecialPowers.Ci.nsIDOMFile,
blob2 instanceof Components.interfaces.nsIDOMFile, blob2 instanceof SpecialPowers.Ci.nsIDOMFile,
"Instance of nsIDOMFile"); "Instance of nsIDOMFile");
is(blob1.size, blob2.size, "Correct size"); is(blob1.size, blob2.size, "Correct size");
is(blob1.type, blob2.type, "Correct type"); is(blob1.type, blob2.type, "Correct type");

View File

@ -70,7 +70,7 @@
} }
function onTestComplete() { function onTestComplete() {
let comp = SpecialPowers.wrap(Components); let comp = SpecialPowers.wrap(SpecialPowers.Components);
let mm = SpecialPowers.getBrowserFrameMessageManager(iframe); let mm = SpecialPowers.getBrowserFrameMessageManager(iframe);
let spObserver = comp.classes["@mozilla.org/special-powers-observer;1"] let spObserver = comp.classes["@mozilla.org/special-powers-observer;1"]
.getService(comp.interfaces.nsIMessageListener); .getService(comp.interfaces.nsIMessageListener);
@ -109,7 +109,7 @@
let mm = SpecialPowers.getBrowserFrameMessageManager(iframe); let mm = SpecialPowers.getBrowserFrameMessageManager(iframe);
let comp = SpecialPowers.wrap(Components); let comp = SpecialPowers.wrap(SpecialPowers.Components);
let spObserver = let spObserver =
comp.classes["@mozilla.org/special-powers-observer;1"] comp.classes["@mozilla.org/special-powers-observer;1"]

View File

@ -16,8 +16,8 @@ function devicestorage_setup() {
// ensure that the directory we are writing into is empty // ensure that the directory we are writing into is empty
try { try {
const Cc = SpecialPowers.wrap(Components).classes; const Cc = SpecialPowers.Cc;
const Ci = Components.interfaces; const Ci = SpecialPowers.Ci;
var directoryService = Cc["@mozilla.org/file/directory_service;1"].getService(Ci.nsIProperties); var directoryService = Cc["@mozilla.org/file/directory_service;1"].getService(Ci.nsIProperties);
var f = directoryService.get("TmpD", Ci.nsIFile); var f = directoryService.get("TmpD", Ci.nsIFile);
f.appendRelativePath("device-storage-testing"); f.appendRelativePath("device-storage-testing");

View File

@ -51,8 +51,8 @@ function verifyAndDelete(prefix, files, e) {
function addFiles(prefix, files, date, callback) { function addFiles(prefix, files, date, callback) {
const Cc = SpecialPowers.wrap(Components).classes; const Cc = SpecialPowers.Cc;
const Ci = Components.interfaces; const Ci = SpecialPowers.Ci;
var directoryService = Cc["@mozilla.org/file/directory_service;1"].getService(Ci.nsIProperties); var directoryService = Cc["@mozilla.org/file/directory_service;1"].getService(Ci.nsIProperties);

View File

@ -11,8 +11,8 @@
<script type="text/javascript;version=1.7"> <script type="text/javascript;version=1.7">
function createZipFileWithData(fileData) { function createZipFileWithData(fileData) {
var Cc = SpecialPowers.wrap(Components).classes; var Cc = SpecialPowers.Cc;
var Ci = SpecialPowers.wrap(Components).interfaces; var Ci = SpecialPowers.Ci;
var dirSvc = Cc["@mozilla.org/file/directory_service;1"].getService(Ci.nsIProperties); var dirSvc = Cc["@mozilla.org/file/directory_service;1"].getService(Ci.nsIProperties);
var testFile = dirSvc.get("ProfD", Ci.nsIFile); var testFile = dirSvc.get("ProfD", Ci.nsIFile);
@ -30,8 +30,8 @@
} }
function createTextFileWithData(fileData) { function createTextFileWithData(fileData) {
var Cc = SpecialPowers.wrap(Components).classes; var Cc = SpecialPowers.Cc;
var Ci = SpecialPowers.wrap(Components).interfaces; var Ci = SpecialPowers.Ci;
var dirSvc = Cc["@mozilla.org/file/directory_service;1"].getService(Ci.nsIProperties); var dirSvc = Cc["@mozilla.org/file/directory_service;1"].getService(Ci.nsIProperties);
var testFile = dirSvc.get("ProfD", Ci.nsIFile); var testFile = dirSvc.get("ProfD", Ci.nsIFile);

View File

@ -11,8 +11,8 @@
<script type="text/javascript;version=1.7"> <script type="text/javascript;version=1.7">
function createZipInZipData() { function createZipInZipData() {
var Cc = SpecialPowers.wrap(Components).classes; var Cc = SpecialPowers.Cc;
var Ci = SpecialPowers.wrap(Components).interfaces; var Ci = SpecialPowers.Ci;
var dirSvc = Cc["@mozilla.org/file/directory_service;1"].getService(Ci.nsIProperties); var dirSvc = Cc["@mozilla.org/file/directory_service;1"].getService(Ci.nsIProperties);
var testFile = dirSvc.get("ProfD", Ci.nsIFile); var testFile = dirSvc.get("ProfD", Ci.nsIFile);

View File

@ -25,7 +25,7 @@
let lockedFile2; let lockedFile2;
let comp = SpecialPowers.wrap(Components); let comp = SpecialPowers.wrap(SpecialPowers.Components);
let thread = comp.classes["@mozilla.org/thread-manager;1"] let thread = comp.classes["@mozilla.org/thread-manager;1"]
.getService(comp.interfaces.nsIThreadManager) .getService(comp.interfaces.nsIThreadManager)
.currentThread; .currentThread;
@ -36,7 +36,7 @@
eventHasRun = true; eventHasRun = true;
lockedFile2 = fileHandle.open(); lockedFile2 = fileHandle.open();
}, Components.interfaces.nsIThread.DISPATCH_NORMAL); }, SpecialPowers.Ci.nsIThread.DISPATCH_NORMAL);
while (!eventHasRun) { while (!eventHasRun) {
thread.processNextEvent(false); thread.processNextEvent(false);

View File

@ -44,7 +44,7 @@
is(sawError, true, "Saw getMetadata() error"); is(sawError, true, "Saw getMetadata() error");
// Make sure the success event isn't queued somehow. // 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"] var thread = comp.classes["@mozilla.org/thread-manager;1"]
.getService(comp.interfaces.nsIThreadManager) .getService(comp.interfaces.nsIThreadManager)
.currentThread; .currentThread;

View File

@ -3,8 +3,8 @@
"use strict"; "use strict";
const Ci = Components.interfaces; const Ci = SpecialPowers.Ci;
const Cu = SpecialPowers.wrap(Components).utils; const Cu = SpecialPowers.Cu;
SpecialPowers.setBoolPref("toolkit.identity.debug", true); SpecialPowers.setBoolPref("toolkit.identity.debug", true);
SpecialPowers.setBoolPref("dom.identity.enabled", true); SpecialPowers.setBoolPref("dom.identity.enabled", true);

View File

@ -128,7 +128,7 @@
let mm = SpecialPowers.getBrowserFrameMessageManager(iframe); let mm = SpecialPowers.getBrowserFrameMessageManager(iframe);
let comp = SpecialPowers.wrap(Components); let comp = SpecialPowers.wrap(SpecialPowers.Components);
let spObserver = let spObserver =
comp.classes["@mozilla.org/special-powers-observer;1"] comp.classes["@mozilla.org/special-powers-observer;1"]

View File

@ -21,7 +21,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id={678695}
"use strict"; "use strict";
var comp = SpecialPowers.wrap(Components); var comp = SpecialPowers.wrap(SpecialPowers.Components);
comp.utils.import("resource://gre/modules/SettingsChangeNotifier.jsm"); comp.utils.import("resource://gre/modules/SettingsChangeNotifier.jsm");
SpecialPowers.setBoolPref("dom.mozSettings.enabled", true); SpecialPowers.setBoolPref("dom.mozSettings.enabled", true);
SpecialPowers.addPermission("settings", true, document); SpecialPowers.addPermission("settings", true, document);

View File

@ -10,8 +10,8 @@
function manifestUpdated() function manifestUpdated()
{ {
var appCacheService = Components.classes["@mozilla.org/network/application-cache-service;1"] var appCacheService = SpecialPowers.Components.classes["@mozilla.org/network/application-cache-service;1"]
.getService(Components.interfaces.nsIApplicationCacheService); .getService(SpecialPowers.Ci.nsIApplicationCacheService);
var foreign2cache = appCacheService.chooseApplicationCache( var foreign2cache = appCacheService.chooseApplicationCache(
"http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/foreign2.html"); "http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/foreign2.html");
@ -30,8 +30,8 @@ function manifestUpdated()
function onLoaded() function onLoaded()
{ {
var appCacheService = Components.classes["@mozilla.org/network/application-cache-service;1"] var appCacheService = SpecialPowers.Components.classes["@mozilla.org/network/application-cache-service;1"]
.getService(Components.interfaces.nsIApplicationCacheService); .getService(SpecialPowers.Ci.nsIApplicationCacheService);
var foreign1cache = appCacheService.getActiveCache( var foreign1cache = appCacheService.getActiveCache(
"http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/foreign1.cacheManifest"); "http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/foreign1.cacheManifest");
@ -47,7 +47,7 @@ function onLoaded()
try try
{ {
OfflineTest.ok(applicationCache.status == Components.interfaces.nsIDOMOfflineResourceList.UNCACHED, OfflineTest.ok(applicationCache.status == SpecialPowers.Ci.nsIDOMOfflineResourceList.UNCACHED,
"there is no associated application cache"); "there is no associated application cache");
} }
catch (ex) catch (ex)

View File

@ -50,7 +50,7 @@ applicationCache.oncached = function() {
var req = new XMLHttpRequest(); var req = new XMLHttpRequest();
req.open("GET", "http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/obsoletingManifest.sjs?state="); req.open("GET", "http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/obsoletingManifest.sjs?state=");
var channel = SpecialPowers.wrap(req).channel var channel = SpecialPowers.wrap(req).channel
.QueryInterface(Components.interfaces.nsIApplicationCacheChannel); .QueryInterface(SpecialPowers.Ci.nsIApplicationCacheChannel);
channel.chooseApplicationCache = false; channel.chooseApplicationCache = false;
channel.inheritApplicationCache = false; channel.inheritApplicationCache = false;
req.send(""); req.send("");

View File

@ -21,8 +21,8 @@
function manifestUpdated() function manifestUpdated()
{ {
var appCacheService = Components.classes["@mozilla.org/network/application-cache-service;1"] var appCacheService = SpecialPowers.Components.classes["@mozilla.org/network/application-cache-service;1"]
.getService(Components.interfaces.nsIApplicationCacheService); .getService(SpecialPowers.Ci.nsIApplicationCacheService);
foreign1cache = appCacheService.chooseApplicationCache( foreign1cache = appCacheService.chooseApplicationCache(
"http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/foreign2.html"); "http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/foreign2.html");

View File

@ -17,8 +17,8 @@
* swaps cache for this document, reloads and checks document state. * swaps cache for this document, reloads and checks document state.
*/ */
const NAMESPACE_BYPASS = Components.interfaces.nsIApplicationCacheNamespace.NAMESPACE_BYPASS; const NAMESPACE_BYPASS = SpecialPowers.Ci.nsIApplicationCacheNamespace.NAMESPACE_BYPASS;
const NAMESPACE_FALLBACK = Components.interfaces.nsIApplicationCacheNamespace.NAMESPACE_FALLBACK; const NAMESPACE_FALLBACK = SpecialPowers.Ci.nsIApplicationCacheNamespace.NAMESPACE_FALLBACK;
var gStep = 0; var gStep = 0;
var gGotFrameVersion = 0; var gGotFrameVersion = 0;
@ -153,7 +153,7 @@ function implicitCached()
"http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/fallback.html", false); "http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/fallback.html", false);
// Cache object status // 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)"); "we have associated application cache (1)");
OfflineTest.is(gGotFrameVersion, 1, "IFrame version 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); "http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/fallback2.html", false);
// Cache object status // 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)"); "we have associated application cache and update is pending (2)");
var entries = [ var entries = [
@ -256,7 +256,7 @@ function manifestUpdated()
"http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/fallback2.html", false); "http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/fallback2.html", false);
// Cache object status // 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)"); "we have associated application cache and update is pending (3)");
OfflineTest.is(gGotFrameVersion, 1, "IFrame version 1 because cache was not swapped"); OfflineTest.is(gGotFrameVersion, 1, "IFrame version 1 because cache was not swapped");
@ -299,10 +299,10 @@ function manifestNoUpdate()
OfflineTest.ok(gStep == 3); 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)"); "we have associated application cache and update is pending (4)");
applicationCache.swapCache(); applicationCache.swapCache();
OfflineTest.is(applicationCache.status, Components.interfaces.nsIDOMOfflineResourceList.IDLE, OfflineTest.is(applicationCache.status, SpecialPowers.Ci.nsIDOMOfflineResourceList.IDLE,
"we have associated application cache (4)"); "we have associated application cache (4)");
gGotFrameVersion = 0; gGotFrameVersion = 0;

View File

@ -21,12 +21,12 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=317448
var x = new XMLHttpRequest(); var x = new XMLHttpRequest();
x.open("GET", document.location.href); x.open("GET", document.location.href);
x.send(""); x.send("");
is(x instanceof Components.interfaces.nsIInterfaceRequestor, is(x instanceof SpecialPowers.Ci.nsIInterfaceRequestor,
true, "Must be interface requestor"); true, "Must be interface requestor");
var count = {}; var count = {};
var interfaces = SpecialPowers.wrap(x). var interfaces = SpecialPowers.wrap(x).
QueryInterface(Components.interfaces.nsIClassInfo). QueryInterface(SpecialPowers.Ci.nsIClassInfo).
getInterfaces(count). getInterfaces(count).
map(function(id) { map(function(id) {
id = SpecialPowers.wrap(id); id = SpecialPowers.wrap(id);

View File

@ -116,8 +116,8 @@ function test5()
SimpleTest.executeSoon(function() { SimpleTest.executeSoon(function() {
// We have to focus back the originating window but we can't do that with // We have to focus back the originating window but we can't do that with
// .focus() or .blur() anymore. // .focus() or .blur() anymore.
var fm = SpecialPowers.wrap(Components).classes["@mozilla.org/focus-manager;1"] var fm = SpecialPowers.Cc["@mozilla.org/focus-manager;1"]
.getService(Components.interfaces.nsIFocusManager); .getService(SpecialPowers.Ci.nsIFocusManager);
fm.focusedWindow = window; fm.focusedWindow = window;
}); });
}, w, true); }, w, true);
@ -125,8 +125,8 @@ function test5()
function finished() function finished()
{ {
SpecialPowers.wrap(Components).classes["@mozilla.org/preferences-service;1"] SpecialPowers.Cc["@mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefBranch) .getService(SpecialPowers.Ci.nsIPrefBranch)
.setBoolPref("dom.disable_window_flip", gOldPrefValue); .setBoolPref("dom.disable_window_flip", gOldPrefValue);
SimpleTest.finish(); SimpleTest.finish();
} }
@ -135,8 +135,8 @@ SimpleTest.waitForExplicitFinish();
// dom.disable_window_flip has to be set to true for this test. // dom.disable_window_flip has to be set to true for this test.
var prefs = SpecialPowers.wrap(Components).classes["@mozilla.org/preferences-service;1"] var prefs = SpecialPowers.Cc["@mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefBranch); .getService(SpecialPowers.Ci.nsIPrefBranch);
gOldPrefValue = prefs.getBoolPref("dom.disable_window_flip"); gOldPrefValue = prefs.getBoolPref("dom.disable_window_flip");
prefs.setBoolPref("dom.disable_window_flip", true); prefs.setBoolPref("dom.disable_window_flip", true);

View File

@ -45,16 +45,16 @@ var outerWindowDestroyID;
function outerObserver(id) { function outerObserver(id) {
outerWindowDestroyID = outerWindowDestroyID =
SpecialPowers.wrap(id).QueryInterface(Components.interfaces.nsISupportsPRUint64).data; SpecialPowers.wrap(id).QueryInterface(SpecialPowers.Ci.nsISupportsPRUint64).data;
} }
function innerObserver(id) { function innerObserver(id) {
innerWindowDestroyID = innerWindowDestroyID =
SpecialPowers.wrap(id).QueryInterface(Components.interfaces.nsISupportsPRUint64).data; SpecialPowers.wrap(id).QueryInterface(SpecialPowers.Ci.nsISupportsPRUint64).data;
} }
function removeFrame(iframe) { function removeFrame(iframe) {
var obsSvc = SpecialPowers.wrap(Components).classes["@mozilla.org/observer-service;1"] var obsSvc = SpecialPowers.Cc["@mozilla.org/observer-service;1"]
.getService(Components.interfaces.nsIObserverService); .getService(SpecialPowers.Ci.nsIObserverService);
obsSvc.addObserver(outerObserver, "outer-window-destroyed", false); obsSvc.addObserver(outerObserver, "outer-window-destroyed", false);
obsSvc.addObserver(innerObserver, "inner-window-destroyed", false); obsSvc.addObserver(innerObserver, "inner-window-destroyed", false);
@ -66,8 +66,8 @@ SimpleTest.waitForExplicitFinish();
SimpleTest.executeSoon(function() { SimpleTest.executeSoon(function() {
is(innerWindowDestroyID, i1inner, "inner window of frame 1 should be destroyed"); is(innerWindowDestroyID, i1inner, "inner window of frame 1 should be destroyed");
is(outerWindowDestroyID, i1outer, "outer 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"] var obsSvc = SpecialPowers.Cc["@mozilla.org/observer-service;1"]
.getService(Components.interfaces.nsIObserverService); .getService(SpecialPowers.Ci.nsIObserverService);
obsSvc.removeObserver(outerObserver, "outer-window-destroyed"); obsSvc.removeObserver(outerObserver, "outer-window-destroyed");
obsSvc.removeObserver(innerObserver, "inner-window-destroyed"); obsSvc.removeObserver(innerObserver, "inner-window-destroyed");
SimpleTest.finish(); SimpleTest.finish();

View File

@ -52,12 +52,12 @@ function alter_file(uri, file) {
(function() { (function() {
var prefService = SpecialPowers.wrap(Components).classes["@mozilla.org/preferences-service;1"] var prefService = SpecialPowers.Cc["@mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefService), .getService(SpecialPowers.Ci.nsIPrefService),
pm = SpecialPowers.wrap(Components).classes["@mozilla.org/permissionmanager;1"] pm = SpecialPowers.Cc["@mozilla.org/permissionmanager;1"]
.getService(Components.interfaces.nsIPermissionManager), .getService(SpecialPowers.Ci.nsIPermissionManager),
ioService = SpecialPowers.wrap(Components).classes["@mozilla.org/network/io-service;1"] ioService = SpecialPowers.Cc["@mozilla.org/network/io-service;1"]
.getService(Components.interfaces.nsIIOService); .getService(SpecialPowers.Ci.nsIIOService);
ALLOW_ACTION = pm.ALLOW_ACTION; ALLOW_ACTION = pm.ALLOW_ACTION;
DENY_ACTION = pm.DENY_ACTION; DENY_ACTION = pm.DENY_ACTION;
@ -98,8 +98,8 @@ function alter_file(uri, file) {
makePopupPrivAccessor = function(uri) { makePopupPrivAccessor = function(uri) {
uri = ioService.newURI(uri, null, null); uri = ioService.newURI(uri, null, null);
var principal = SpecialPowers.wrap(Components).classes["@mozilla.org/scriptsecuritymanager;1"] var principal = SpecialPowers.Cc["@mozilla.org/scriptsecuritymanager;1"]
.getService(Components.interfaces.nsIScriptSecurityManager) .getService(SpecialPowers.Ci.nsIScriptSecurityManager)
.getNoAppCodebasePrincipal(uri); .getNoAppCodebasePrincipal(uri);
return function(permission) { return function(permission) {

View File

@ -537,7 +537,7 @@ var interfaceNamesInGlobalScope =
"PermissionSettings" "PermissionSettings"
] ]
for (var i in Components.interfaces) { for (var i in SpecialPowers.Components.interfaces) {
var s = i.toString(); var s = i.toString();
var name = null; var name = null;
if (s.indexOf("nsIDOM") == 0) { if (s.indexOf("nsIDOM") == 0) {

View File

@ -37,7 +37,7 @@ resume_geolocationProvider();
force_prompt(true); force_prompt(true);
var comp = SpecialPowers.wrap(Components); var comp = SpecialPowers.wrap(SpecialPowers.Components);
SpecialPowers.setBoolPref("dom.mozSettings.enabled", true); SpecialPowers.setBoolPref("dom.mozSettings.enabled", true);
SpecialPowers.addPermission("settings", true, document); SpecialPowers.addPermission("settings", true, document);
comp.utils.import("resource://gre/modules/SettingsChangeNotifier.jsm"); comp.utils.import("resource://gre/modules/SettingsChangeNotifier.jsm");

View File

@ -37,7 +37,7 @@ resume_geolocationProvider();
force_prompt(true); force_prompt(true);
var comp = SpecialPowers.wrap(Components); var comp = SpecialPowers.wrap(SpecialPowers.Components);
SpecialPowers.setBoolPref("dom.mozSettings.enabled", true); SpecialPowers.setBoolPref("dom.mozSettings.enabled", true);
SpecialPowers.addPermission("settings", true, document); SpecialPowers.addPermission("settings", true, document);
comp.utils.import("resource://gre/modules/SettingsChangeNotifier.jsm"); comp.utils.import("resource://gre/modules/SettingsChangeNotifier.jsm");

View File

@ -6,7 +6,7 @@
<script type="text/javascript"> <script type="text/javascript">
const DOM_QUOTA_REACHED = 2152924150; const DOM_QUOTA_REACHED = 2152924150;
const Cc = SpecialPowers.wrap(Components).classes; const Cc = SpecialPowers.Cc;
function checkException(func, exc) function checkException(func, exc)
{ {
@ -24,12 +24,12 @@ function checkException(func, exc)
function doStep() function doStep()
{ {
var io = Cc["@mozilla.org/network/io-service;1"] 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 uri = io.newURI(window.location, "", null);
var cp = Cc["@mozilla.org/cookie/permission;1"] 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 query = location.search.substring(1);
var queries = query.split("&"); var queries = query.split("&");
@ -95,7 +95,7 @@ function doStep()
{ {
case "clear": case "clear":
localStorage.clear(); localStorage.clear();
cp.setAccess(uri, Components.interfaces.nsICookiePermission.ACCESS_DEFAULT); cp.setAccess(uri, SpecialPowers.Ci.nsICookiePermission.ACCESS_DEFAULT);
break; break;
} }

View File

@ -6,8 +6,8 @@ function get_PBSvc()
return _PBSvc; return _PBSvc;
try { try {
_PBSvc = Components.classes["@mozilla.org/privatebrowsing;1"]. _PBSvc = SpecialPowers.Components.classes["@mozilla.org/privatebrowsing;1"].
getService(Components.interfaces.nsIPrivateBrowsingService); getService(SpecialPowers.Ci.nsIPrivateBrowsingService);
return _PBSvc; return _PBSvc;
} }
catch (ex) { catch (ex) {
@ -19,8 +19,8 @@ function get_PBSvc()
function enterPrivateBrowsing() function enterPrivateBrowsing()
{ {
if (get_PBSvc()) { if (get_PBSvc()) {
var prefBranch = Components.classes["@mozilla.org/preferences-service;1"]. var prefBranch = SpecialPowers.Components.classes["@mozilla.org/preferences-service;1"].
getService(Components.interfaces.nsIPrefBranch); getService(SpecialPowers.Ci.nsIPrefBranch);
prefBranch.setBoolPref("browser.privatebrowsing.keep_current_session", true); prefBranch.setBoolPref("browser.privatebrowsing.keep_current_session", true);
get_PBSvc().privateBrowsingEnabled = true; get_PBSvc().privateBrowsingEnabled = true;
@ -32,8 +32,8 @@ function leavePrivateBrowsing()
if (get_PBSvc()) { if (get_PBSvc()) {
get_PBSvc().privateBrowsingEnabled = false; get_PBSvc().privateBrowsingEnabled = false;
var prefBranch = Components.classes["@mozilla.org/preferences-service;1"]. var prefBranch = SpecialPowers.Components.classes["@mozilla.org/preferences-service;1"].
getService(Components.interfaces.nsIPrefBranch); getService(SpecialPowers.Ci.nsIPrefBranch);
if (prefBranch.prefHasUserValue("browser.privatebrowsing.keep_current_session")) if (prefBranch.prefHasUserValue("browser.privatebrowsing.keep_current_session"))
prefBranch.clearUserPref("browser.privatebrowsing.keep_current_session"); prefBranch.clearUserPref("browser.privatebrowsing.keep_current_session");
} }

View File

@ -9,13 +9,13 @@
function startTest() function startTest()
{ {
var io = SpecialPowers.wrap(Components).classes["@mozilla.org/network/io-service;1"] var io = SpecialPowers.Cc["@mozilla.org/network/io-service;1"]
.getService(Components.interfaces.nsIIOService); .getService(SpecialPowers.Ci.nsIIOService);
var uri = io.newURI(window.location, "", null); var uri = io.newURI(window.location, "", null);
var cp = SpecialPowers.wrap(Components).classes["@mozilla.org/cookie/permission;1"] var cp = SpecialPowers.Cc["@mozilla.org/cookie/permission;1"]
.getService(Components.interfaces.nsICookiePermission); .getService(SpecialPowers.Ci.nsICookiePermission);
cp.setAccess(uri, Components.interfaces.nsICookiePermission.ACCESS_DENY); cp.setAccess(uri, SpecialPowers.Ci.nsICookiePermission.ACCESS_DENY);
try { try {
localStorage.setItem("blocked", "blockedvalue"); localStorage.setItem("blocked", "blockedvalue");
@ -33,7 +33,7 @@ function startTest()
ok(true, "Exception for localStorage.getItem, ACCESS_DENY"); 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(); SimpleTest.finish();
} }

View File

@ -19,12 +19,12 @@ function startTest()
localStorage.setItem("persistent1", "persistent value 1"); localStorage.setItem("persistent1", "persistent value 1");
localStorage.setItem("persistent2", "persistent value 2"); localStorage.setItem("persistent2", "persistent value 2");
var io = SpecialPowers.wrap(Components).classes["@mozilla.org/network/io-service;1"] var io = SpecialPowers.Cc["@mozilla.org/network/io-service;1"]
.getService(Components.interfaces.nsIIOService); .getService(SpecialPowers.Ci.nsIIOService);
var uri = io.newURI(window.location, "", null); var uri = io.newURI(window.location, "", null);
var cp = SpecialPowers.wrap(Components).classes["@mozilla.org/cookie/permission;1"] var cp = SpecialPowers.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);
localStorage.setItem("session only", "session value"); localStorage.setItem("session only", "session value");
is(localStorage.getItem("session only"), "session value"); is(localStorage.getItem("session only"), "session value");

View File

@ -9,11 +9,11 @@
function startTest() function startTest()
{ {
var io = SpecialPowers.wrap(Components).classes["@mozilla.org/network/io-service;1"] var io = SpecialPowers.Cc["@mozilla.org/network/io-service;1"]
.getService(Components.interfaces.nsIIOService); .getService(SpecialPowers.Ci.nsIIOService);
var uri = io.newURI(window.location, "", null); var uri = io.newURI(window.location, "", null);
var cp = SpecialPowers.wrap(Components).classes["@mozilla.org/cookie/permission;1"] var cp = SpecialPowers.Cc["@mozilla.org/cookie/permission;1"]
.getService(Components.interfaces.nsICookiePermission); .getService(SpecialPowers.Ci.nsICookiePermission);
is(localStorage.getItem("session only"), "session value", "Value present when cookies in session-only mode"); 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"); 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"); 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"), 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("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("persistent1"), "persistent value 1", "Persistent value present");
is(localStorage.getItem("persistent2"), "persistent value 2", "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"), 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("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("persistent1"), "persistent value 1", "Persistent value present again");
is(localStorage.getItem("persistent2"), "persistent value 2", "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(); localStorage.clear();
@ -57,14 +57,14 @@ function startTest()
is(localStorage.getItem("persistent1"), null, "Persistent value not present after delete"); is(localStorage.getItem("persistent1"), null, "Persistent value not present after delete");
is(localStorage.getItem("persistent2"), 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"), 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("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("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"); 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(); SimpleTest.finish();
} }

View File

@ -8,16 +8,16 @@
<script type="text/javascript"> <script type="text/javascript">
const Cc = SpecialPowers.wrap(Components).classes; const Cc = SpecialPowers.Cc;
var currentTest = 1; var currentTest = 1;
var prefs = Cc["@mozilla.org/preferences-service;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"] 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 uri = io.newURI(window.location, "", null);
var cp = Cc["@mozilla.org/cookie/permission;1"] var cp = Cc["@mozilla.org/cookie/permission;1"]
.getService(Components.interfaces.nsICookiePermission); .getService(SpecialPowers.Ci.nsICookiePermission);
var quota; var quota;
@ -45,7 +45,7 @@ function doNextTest()
// In subdomain now set another key with length 500 bytes, i.e. // In subdomain now set another key with length 500 bytes, i.e.
// allocate 501 bytes // allocate 501 bytes
case 2: case 2:
cp.setAccess(uri, Components.interfaces.nsICookiePermission.ACCESS_SESSION); cp.setAccess(uri, SpecialPowers.Ci.nsICookiePermission.ACCESS_SESSION);
slaveOrigin = "http://example.com"; slaveOrigin = "http://example.com";
slave.location = slaveOrigin + slavePath + "frameQuotaSessionOnly.html?add&B&success"; slave.location = slaveOrigin + slavePath + "frameQuotaSessionOnly.html?add&B&success";
break; break;
@ -88,12 +88,12 @@ function doNextTest()
// Do a clean up... // Do a clean up...
slaveOrigin = "http://example.com"; slaveOrigin = "http://example.com";
slave.location = slaveOrigin + slavePath + "frameQuotaSessionOnly.html?clear"; slave.location = slaveOrigin + slavePath + "frameQuotaSessionOnly.html?clear";
cp.setAccess(uri, Components.interfaces.nsICookiePermission.ACCESS_DEFAULT); cp.setAccess(uri, SpecialPowers.Ci.nsICookiePermission.ACCESS_DEFAULT);
break; break;
default: default:
prefs.setIntPref("dom.storage.default_quota", quota); 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(); SimpleTest.finish();
} }

View File

@ -154,14 +154,14 @@ function popstateExpected(msg) {
function getColor(elem) { function getColor(elem) {
var utils = SpecialPowers.wrap(document).defaultView. var utils = SpecialPowers.wrap(document).defaultView.
QueryInterface(Components.interfaces.nsIInterfaceRequestor). QueryInterface(SpecialPowers.Ci.nsIInterfaceRequestor).
getInterface(Components.interfaces.nsIDOMWindowUtils); getInterface(SpecialPowers.Ci.nsIDOMWindowUtils);
return utils.getVisitedDependentComputedStyle(elem, "", "color"); return utils.getVisitedDependentComputedStyle(elem, "", "color");
} }
function getSHistory(theWindow) function getSHistory(theWindow)
{ {
const Ci = Components.interfaces; const Ci = SpecialPowers.Ci;
var sh = SpecialPowers.wrap(theWindow.QueryInterface(Ci.nsIInterfaceRequestor)) var sh = SpecialPowers.wrap(theWindow.QueryInterface(Ci.nsIInterfaceRequestor))
.getInterface(Ci.nsIWebNavigation) .getInterface(Ci.nsIWebNavigation)
.sessionHistory; .sessionHistory;

View File

@ -22,9 +22,9 @@ var iframe = document.getElementById("load-frame");
function enableJS() allowJS(true, iframe); function enableJS() allowJS(true, iframe);
function disableJS() allowJS(false, iframe); function disableJS() allowJS(false, iframe);
function allowJS(allow, frame) { function allowJS(allow, frame) {
SpecialPowers.wrap(frame.contentWindow.QueryInterface(Components.interfaces.nsIInterfaceRequestor)) SpecialPowers.wrap(frame.contentWindow.QueryInterface(SpecialPowers.Ci.nsIInterfaceRequestor))
.getInterface(Components.interfaces.nsIWebNavigation) .getInterface(SpecialPowers.Ci.nsIWebNavigation)
.QueryInterface(Components.interfaces.nsIDocShell) .QueryInterface(SpecialPowers.Ci.nsIDocShell)
.allowJavascript = allow; .allowJavascript = allow;
} }
function expectJSAllowed(allowed, testCondition, callback) { function expectJSAllowed(allowed, testCondition, callback) {

View File

@ -34,7 +34,7 @@ function editDoc() {
} }
function getSpellCheckSelection() { function getSpellCheckSelection() {
var Ci = Components.interfaces; var Ci = SpecialPowers.Ci;
var win = editDoc().defaultView; var win = editDoc().defaultView;
var editingSession = SpecialPowers.wrap(win.QueryInterface(Ci.nsIInterfaceRequestor)) var editingSession = SpecialPowers.wrap(win.QueryInterface(Ci.nsIInterfaceRequestor))
.getInterface(Ci.nsIWebNavigation) .getInterface(Ci.nsIWebNavigation)

View File

@ -41,8 +41,8 @@ function checkStylesheets() {
} }
function runTest() { function runTest() {
const Ci = Components.interfaces; const Ci = SpecialPowers.Ci;
const Cc = Components.classes; const Cc = SpecialPowers.Components.classes;
/** Found while fixing bug 440614 **/ /** Found while fixing bug 440614 **/
var editframe = window.frames[0]; var editframe = window.frames[0];

View File

@ -549,7 +549,7 @@ function doNextTest() {
} }
function getLoadContext() { function getLoadContext() {
const Ci = Components.interfaces; const Ci = SpecialPowers.Ci;
return SpecialPowers.wrap(window) return SpecialPowers.wrap(window)
.QueryInterface(Ci.nsIInterfaceRequestor) .QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIWebNavigation) .getInterface(Ci.nsIWebNavigation)
@ -564,11 +564,11 @@ function runTest(test) {
} else } else
elem.focus(); elem.focus();
var trans = SpecialPowers.wrap(Components).classes["@mozilla.org/widget/transferable;1"] var trans = SpecialPowers.Cc["@mozilla.org/widget/transferable;1"]
.createInstance(Components.interfaces.nsITransferable); .createInstance(SpecialPowers.Ci.nsITransferable);
trans.init(getLoadContext()); trans.init(getLoadContext());
var data = SpecialPowers.wrap(Components).classes["@mozilla.org/supports-string;1"] var data = SpecialPowers.Cc["@mozilla.org/supports-string;1"]
.createInstance(Components.interfaces.nsISupportsString); .createInstance(SpecialPowers.Ci.nsISupportsString);
data.data = test.payload; data.data = test.payload;
trans.addDataFlavor("text/html"); trans.addDataFlavor("text/html");
trans.setTransferData("text/html", data, data.data.length * 2); trans.setTransferData("text/html", data, data.data.length * 2);
@ -581,16 +581,16 @@ function runTest(test) {
getSelection().collapse(elem, 0); getSelection().collapse(elem, 0);
win = window; win = window;
} }
editor = SpecialPowers.wrap(win).QueryInterface(Components.interfaces.nsIInterfaceRequestor) editor = SpecialPowers.wrap(win).QueryInterface(SpecialPowers.Ci.nsIInterfaceRequestor)
.getInterface(Components.interfaces.nsIWebNavigation) .getInterface(SpecialPowers.Ci.nsIWebNavigation)
.QueryInterface(Components.interfaces.nsIEditorDocShell) .QueryInterface(SpecialPowers.Ci.nsIEditorDocShell)
.editor; .editor;
editor.pasteTransferable(trans); editor.pasteTransferable(trans);
} else { } else {
var clipboard = SpecialPowers.wrap(Components).classes["@mozilla.org/widget/clipboard;1"] var clipboard = SpecialPowers.Cc["@mozilla.org/widget/clipboard;1"]
.getService(Components.interfaces.nsIClipboard); .getService(SpecialPowers.Ci.nsIClipboard);
clipboard.setData(trans, null, Components.interfaces.nsIClipboard.kGlobalClipboard); clipboard.setData(trans, null, SpecialPowers.Ci.nsIClipboard.kGlobalClipboard);
synthesizeKey("V", {accelKey: true}); synthesizeKey("V", {accelKey: true});
} }

View File

@ -8,9 +8,9 @@
<script class="testbody" type="application/javascript"> <script class="testbody" type="application/javascript">
var utils = SpecialPowers.wrap(window) var utils = SpecialPowers.wrap(window)
.QueryInterface(Components.interfaces.nsIInterfaceRequestor).getInterface(Components.interfaces.nsIDOMWindowUtils); .QueryInterface(SpecialPowers.Ci.nsIInterfaceRequestor).getInterface(SpecialPowers.Ci.nsIDOMWindowUtils);
var Cc = SpecialPowers.wrap(Components).classes; var Cc = SpecialPowers.Cc;
var Ci = Components.interfaces; var Ci = SpecialPowers.Ci;
function getLoadContext() { function getLoadContext() {
return SpecialPowers.wrap(window) return SpecialPowers.wrap(window)
@ -87,7 +87,7 @@ function runTest() {
} }
// We cannot use plain strings, we have to use nsSupportsString. // 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); var ssData = supportsStringClass.createInstance(Ci.nsISupportsString);
// Create the transferable. // Create the transferable.

View File

@ -84,13 +84,13 @@ function onLoadIFrame()
var frameDoc = gIFrame.contentWindow.document; var frameDoc = gIFrame.contentWindow.document;
var selCon = SpecialPowers.wrap(gIFrame).contentWindow. var selCon = SpecialPowers.wrap(gIFrame).contentWindow.
QueryInterface(Components.interfaces.nsIInterfaceRequestor). QueryInterface(SpecialPowers.Ci.nsIInterfaceRequestor).
getInterface(Components.interfaces.nsIWebNavigation). getInterface(SpecialPowers.Ci.nsIWebNavigation).
QueryInterface(Components.interfaces.nsIInterfaceRequestor). QueryInterface(SpecialPowers.Ci.nsIInterfaceRequestor).
getInterface(Components.interfaces.nsISelectionDisplay). getInterface(SpecialPowers.Ci.nsISelectionDisplay).
QueryInterface(Components.interfaces.nsISelectionController); QueryInterface(SpecialPowers.Ci.nsISelectionController);
var utils = SpecialPowers.getDOMWindowUtils(window); var utils = SpecialPowers.getDOMWindowUtils(window);
const nsIDOMNode = Components.interfaces.nsIDOMNode; const nsIDOMNode = SpecialPowers.Ci.nsIDOMNode;
// move focus to the HTML editor // move focus to the HTML editor
const kTest = kTests[gTestIndex]; const kTest = kTests[gTestIndex];

View File

@ -21,7 +21,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=772288
/** Test for Bug 772288 **/ /** Test for Bug 772288 **/
SimpleTest.waitForExplicitFinish(); SimpleTest.waitForExplicitFinish();
const Cu = SpecialPowers.wrap(Components).utils; const Cu = SpecialPowers.Cu;
function doTest() { function doTest() {
msg = "Services should be imported on window"; msg = "Services should be imported on window";

View File

@ -17,7 +17,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=774245
<pre id="test"> <pre id="test">
<script type="application/javascript"> <script type="application/javascript">
/** Test for Components.lookupMethod in content scope. **/ /** Test for SpecialPowers.Components.lookupMethod in content scope. **/
SimpleTest.waitForExplicitFinish(); SimpleTest.waitForExplicitFinish();
// We're testing things from an unprivileged perspective, so don't use // We're testing things from an unprivileged perspective, so don't use

View File

@ -10,7 +10,7 @@
var d = document.querySelector("input"); var d = document.querySelector("input");
d.value = "b"; d.value = "b";
d.focus(); 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 sel = editor.selection;
var t = editor.rootElement.firstChild; var t = editor.rootElement.firstChild;
sel.collapse(t, 1); // put the caret at the end of the textbox sel.collapse(t, 1); // put the caret at the end of the textbox

View File

@ -15,7 +15,7 @@
var d = document.querySelector("input"); var d = document.querySelector("input");
d.value = "a"; d.value = "a";
d.focus(); 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 sel = editor.selection;
var t = editor.rootElement.firstChild; var t = editor.rootElement.firstChild;
sel.collapse(t, 1); // put the caret at the end of the div sel.collapse(t, 1); // put the caret at the end of the div

View File

@ -38,11 +38,11 @@ addLoadEvent(function() {
var viewer = var viewer =
SpecialPowers.wrap($("ourFrame")).contentWindow SpecialPowers.wrap($("ourFrame")).contentWindow
.QueryInterface(Components.interfaces.nsIInterfaceRequestor) .QueryInterface(SpecialPowers.Ci.nsIInterfaceRequestor)
.getInterface(Components.interfaces.nsIWebNavigation) .getInterface(SpecialPowers.Ci.nsIWebNavigation)
.QueryInterface(Components.interfaces.nsIDocShell) .QueryInterface(SpecialPowers.Ci.nsIDocShell)
.contentViewer .contentViewer
.QueryInterface(Components.interfaces.nsIMarkupDocumentViewer); .QueryInterface(SpecialPowers.Ci.nsIMarkupDocumentViewer);
viewer.fullZoom = 2; viewer.fullZoom = 2;
s3 = snapshotWindow(window); s3 = snapshotWindow(window);

View File

@ -37,7 +37,7 @@ SimpleTest.waitForExplicitFinish()
addLoadEvent(function test() { addLoadEvent(function test() {
var var
CI = Components.interfaces, CI = SpecialPowers.Components.interfaces,
WinUtils = SpecialPowers.getDOMWindowUtils(window), WinUtils = SpecialPowers.getDOMWindowUtils(window),
sec = netscape.security, sec = netscape.security,
eSelect = $("eSelect"), eSelect = $("eSelect"),

View File

@ -28,8 +28,8 @@ window.fileInputGotClick = false;
// on a mac. // on a mac.
function setOrRestoreTabFocus(newValue) { function setOrRestoreTabFocus(newValue) {
const prefSvcContractID = "@mozilla.org/preferences-service;1"; const prefSvcContractID = "@mozilla.org/preferences-service;1";
const prefSvcIID = Components.interfaces.nsIPrefService; const prefSvcIID = SpecialPowers.Ci.nsIPrefService;
var prefs = SpecialPowers.wrap(Components).classes[prefSvcContractID].getService(prefSvcIID) var prefs = SpecialPowers.Cc[prefSvcContractID].getService(prefSvcIID)
.getBranch("accessibility."); .getBranch("accessibility.");
if (!newValue) { if (!newValue) {
prefs.clearUserPref("tabfocus"); prefs.clearUserPref("tabfocus");
@ -41,7 +41,7 @@ function setOrRestoreTabFocus(newValue) {
function tab() { function tab() {
var utils = SpecialPowers.DOMWindowUtils; var utils = SpecialPowers.DOMWindowUtils;
// Send tab key events. // 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("keydown", key, 0, 0);
utils.sendKeyEvent("keypress", key, 0, 0); utils.sendKeyEvent("keypress", key, 0, 0);
utils.sendKeyEvent("keyup", key, 0, 0); utils.sendKeyEvent("keyup", key, 0, 0);

View File

@ -299,7 +299,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=348681
selection.addRange(range8); selection.addRange(range8);
intervalChecker.reset(); intervalChecker.reset();
intervalChecker.addExpected(testNode, 8, 10); 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"); ok(privSel, "Test 17 - QIed to instance of nsISelection2 interface");
var numResults = {}; var numResults = {};
var results = privSel.GetRangesForInterval(testNode, 8, testNode, 10, var results = privSel.GetRangesForInterval(testNode, 8, testNode, 10,

View File

@ -1,6 +1,6 @@
var Ci = Components.interfaces; var Ci = SpecialPowers.Ci;
ok(Ci != null, "Access Ci"); ok(Ci != null, "Access Ci");
var Cc = SpecialPowers.wrap(Components).classes; var Cc = SpecialPowers.Cc;
ok(Cc != null, "Access Cc"); ok(Cc != null, "Access Cc");
var didDialog; var didDialog;
@ -24,7 +24,7 @@ var observer = {
Ci.nsISupports, Ci.nsISupportsWeakReference]; Ci.nsISupports, Ci.nsISupportsWeakReference];
if (!interfaces.some( function(v) { return iid.equals(v) } )) 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; return this;
}, },

View File

@ -10,7 +10,7 @@
<script class="testbody" type="text/javascript"> <script class="testbody" type="text/javascript">
SimpleTest.waitForExplicitFinish(); SimpleTest.waitForExplicitFinish();
var Cc = SpecialPowers.wrap(Components).classes; var Cc = SpecialPowers.Cc;
testNum = 1; testNum = 1;
@ -82,7 +82,7 @@
var gCurrentTest; var gCurrentTest;
function runNextTest() { function runNextTest() {
is(gExpectedDialogs, 0, "received expected number of auth dialogs"); 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) { if (pendingTests.length > 0) {
({expectedDialogs: gExpectedDialogs, ({expectedDialogs: gExpectedDialogs,
test: gCurrentTest}) = pendingTests.shift(); test: gCurrentTest}) = pendingTests.shift();

View File

@ -137,7 +137,7 @@ var storageObserver = {
Ci.nsISupports, Ci.nsISupportsWeakReference]; Ci.nsISupports, Ci.nsISupportsWeakReference];
if (!interfaces.some( function(v) { return iid.equals(v) } )) 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; return this;
}, },

View File

@ -13,7 +13,7 @@
// Class monitoring number of open dialog windows // Class monitoring number of open dialog windows
// It checks there is always open just a single dialog per application // It checks there is always open just a single dialog per application
function dialogMonitor() { 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); .getService(Ci.nsIObserverService);
observerService.addObserver(this, "domwindowopened", false); observerService.addObserver(this, "domwindowopened", false);
observerService.addObserver(this, "domwindowclosed", false); observerService.addObserver(this, "domwindowclosed", false);
@ -33,7 +33,7 @@
const interfaces = [Ci.nsIObserver, Ci.nsISupports]; const interfaces = [Ci.nsIObserver, Ci.nsISupports];
if (!interfaces.some( function(v) { return iid.equals(v) } )) 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; return this;
}, },
@ -51,7 +51,7 @@
}, },
shutdown: function() { 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); .getService(Ci.nsIObserverService);
observerService.removeObserver(this, "domwindowopened"); observerService.removeObserver(this, "domwindowopened");
observerService.removeObserver(this, "domwindowclosed"); observerService.removeObserver(this, "domwindowclosed");
@ -68,11 +68,11 @@
var pwmgr, logins = []; var pwmgr, logins = [];
function initLogins() { function initLogins() {
pwmgr = SpecialPowers.wrap(Components).classes["@mozilla.org/login-manager;1"] pwmgr = SpecialPowers.Cc["@mozilla.org/login-manager;1"]
.getService(Ci.nsILoginManager); .getService(Ci.nsILoginManager);
function addLogin(host, realm, user, pass) { 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); .createInstance(Ci.nsILoginInfo);
login.init(host, null, realm, user, pass, "", ""); login.init(host, null, realm, user, pass, "", "");
pwmgr.addLogin(login); pwmgr.addLogin(login);
@ -80,11 +80,11 @@
} }
//need to allow for arbitrary network servers defined in PAC instead of a hardcoded moz-proxy. //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"] .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"] .classes["@mozilla.org/network/protocol-proxy-service;1"]
.getService(); .getService();
@ -121,7 +121,7 @@
for (i in logins) for (i in logins)
pwmgr.removeLogin(logins[i]); 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); .getService(Ci.nsIHttpAuthManager);
authMgr.clearAll(); authMgr.clearAll();

View File

@ -22,12 +22,12 @@ Login Manager test: XML prompt
var pwmgr, login1, login2; var pwmgr, login1, login2;
function initLogins() { function initLogins() {
pwmgr = SpecialPowers.wrap(Components).classes["@mozilla.org/login-manager;1"] pwmgr = SpecialPowers.Cc["@mozilla.org/login-manager;1"]
.getService(Ci.nsILoginManager); .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); .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); .createInstance(Ci.nsILoginInfo);
login1.init("http://mochi.test:8888", null, "xml", login1.init("http://mochi.test:8888", null, "xml",
@ -164,8 +164,8 @@ initLogins();
// clear plain HTTP auth sessions before the test, to allow // clear plain HTTP auth sessions before the test, to allow
// running them more than once. // running them more than once.
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(Components.interfaces.nsIHttpAuthManager); .getService(SpecialPowers.Ci.nsIHttpAuthManager);
authMgr.clearAll(); authMgr.clearAll();
// start the tests // start the tests

View File

@ -31,7 +31,7 @@ var utils = SpecialPowers.DOMWindowUtils;
function hasTabModalPrompts() { function hasTabModalPrompts() {
var prefName = "prompts.tab_modal.enabled"; var prefName = "prompts.tab_modal.enabled";
var Services = SpecialPowers.wrap(Components).utils var Services = SpecialPowers.Cu
.import("resource://gre/modules/Services.jsm") .import("resource://gre/modules/Services.jsm")
.Services; .Services;
return Services.prefs.getPrefType(prefName) == Services.prefs.PREF_BOOL && return Services.prefs.getPrefType(prefName) == Services.prefs.PREF_BOOL &&

View File

@ -38,7 +38,7 @@ function $_(formNum, name) {
// This basically sends an untargeted key event, to whatever's focused. // This basically sends an untargeted key event, to whatever's focused.
function doKey(aKey, modifier) { function doKey(aKey, modifier) {
var keyName = "DOM_VK_" + aKey.toUpperCase(); var keyName = "DOM_VK_" + aKey.toUpperCase();
var key = Components.interfaces.nsIDOMKeyEvent[keyName]; var key = SpecialPowers.Ci.nsIDOMKeyEvent[keyName];
// undefined --> null // undefined --> null
if (!modifier) if (!modifier)
@ -54,7 +54,7 @@ function doKey(aKey, modifier) {
function getAutocompletePopup() { function getAutocompletePopup() {
var Ci = Components.interfaces; var Ci = SpecialPowers.Ci;
chromeWin = SpecialPowers.wrap(window) chromeWin = SpecialPowers.wrap(window)
.QueryInterface(Ci.nsIInterfaceRequestor) .QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIWebNavigation) .getInterface(Ci.nsIWebNavigation)
@ -71,8 +71,8 @@ function getAutocompletePopup() {
function cleanUpFormHist() { function cleanUpFormHist() {
var formhist = SpecialPowers.wrap(Components).classes["@mozilla.org/satchel/form-history;1"]. var formhist = SpecialPowers.Cc["@mozilla.org/satchel/form-history;1"].
getService(Components.interfaces.nsIFormHistory2); getService(SpecialPowers.Ci.nsIFormHistory2);
formhist.removeAllEntries(); formhist.removeAllEntries();
} }
cleanUpFormHist(); cleanUpFormHist();

View File

@ -36,8 +36,8 @@ autocompletePopup.style.direction = "ltr";
var input = $_(1, "field1"); var input = $_(1, "field1");
// Get the form history service // Get the form history service
var fh = SpecialPowers.wrap(Components).classes["@mozilla.org/satchel/form-history;1"]. var fh = SpecialPowers.Cc["@mozilla.org/satchel/form-history;1"].
getService(Components.interfaces.nsIFormHistory2); getService(SpecialPowers.Ci.nsIFormHistory2);
ok(fh != null, "got form history service"); ok(fh != null, "got form history service");
fh.removeAllEntries(); fh.removeAllEntries();

View File

@ -251,7 +251,7 @@ function openMenu(menu)
} }
else { else {
var bo = menu.boxObject; var bo = menu.boxObject;
if (bo instanceof Components.interfaces.nsIMenuBoxObject) if (bo instanceof SpecialPowers.Ci.nsIMenuBoxObject)
bo.openMenu(true); bo.openMenu(true);
else else
synthesizeMouse(menu, 4, 4, { }); synthesizeMouse(menu, 4, 4, { });
@ -265,7 +265,7 @@ function closeMenu(menu, popup)
} }
else { else {
var bo = menu.boxObject; var bo = menu.boxObject;
if (bo instanceof Components.interfaces.nsIMenuBoxObject) if (bo instanceof SpecialPowers.Ci.nsIMenuBoxObject)
bo.openMenu(false); bo.openMenu(false);
else else
popup.hidePopup(); popup.hidePopup();
@ -292,7 +292,7 @@ function checkOpen(menuid, testname)
var menu = document.getElementById(menuid); var menu = document.getElementById(menuid);
if ("open" in menu) if ("open" in menu)
ok(menu.open, testname + " " + menuid + " menu is open"); 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"); ok(menu.getAttribute("open") == "true", testname + " " + menuid + " menu is open");
} }
@ -301,7 +301,7 @@ function checkClosed(menuid, testname)
var menu = document.getElementById(menuid); var menu = document.getElementById(menuid);
if ("open" in menu) if ("open" in menu)
ok(!menu.open, testname + " " + menuid + " menu is open"); 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"); ok(!menu.hasAttribute("open"), testname + " " + menuid + " menu is closed");
} }

View File

@ -1,7 +1,7 @@
(function() { (function() {
// Set cache size to something large // Set cache size to something large
var prefService = SpecialPowers.wrap(Components).classes["@mozilla.org/preferences-service;1"] var prefService = SpecialPowers.Cc["@mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefService); .getService(SpecialPowers.Ci.nsIPrefService);
var branch = prefService.getBranch("media."); var branch = prefService.getBranch("media.");
var oldSize = branch.getIntPref("cache_size"); var oldSize = branch.getIntPref("cache_size");
branch.setIntPref("cache_size", 40000); branch.setIntPref("cache_size", 40000);

View File

@ -6,9 +6,9 @@
"use strict"; "use strict";
const Cc = SpecialPowers.wrap(Components).classes; const Cc = SpecialPowers.Cc;
const Ci = Components.interfaces; const Ci = SpecialPowers.Ci;
const Cu = SpecialPowers.wrap(Components).utils; const Cu = SpecialPowers.Cu;
const TEST_URL = "http://mochi.test:8888"; const TEST_URL = "http://mochi.test:8888";
const TEST_URL2 = "https://myfavoritebaconinacan.com"; const TEST_URL2 = "https://myfavoritebaconinacan.com";

View File

@ -5,7 +5,7 @@
// handlerApp.xhtml grabs this for verification purposes via window.opener // handlerApp.xhtml grabs this for verification purposes via window.opener
var testURI = "webcal://127.0.0.1/rheeeeet.html"; var testURI = "webcal://127.0.0.1/rheeeeet.html";
const Cc = SpecialPowers.wrap(Components).classes; const Cc = SpecialPowers.Cc;
function test() { function test() {
@ -18,7 +18,7 @@ function test() {
// set up the web handler object // set up the web handler object
var webHandler = Cc["@mozilla.org/uriloader/web-handler-app;1"]. 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.name = "Test Web Handler App";
webHandler.uriTemplate = webHandler.uriTemplate =
"http://mochi.test:8888/tests/uriloader/exthandler/tests/mochitest/" + "http://mochi.test:8888/tests/uriloader/exthandler/tests/mochitest/" +
@ -26,15 +26,15 @@ function test() {
// set up the uri to test with // set up the uri to test with
var ioService = Cc["@mozilla.org/network/io-service;1"]. var ioService = Cc["@mozilla.org/network/io-service;1"].
getService(Components.interfaces.nsIIOService); getService(SpecialPowers.Ci.nsIIOService);
var uri = ioService.newURI(testURI, null, null); var uri = ioService.newURI(testURI, null, null);
// create a window, and launch the handler in it // create a window, and launch the handler in it
var newWindow = window.open("", "handlerWindow", "height=300,width=300"); var newWindow = window.open("", "handlerWindow", "height=300,width=300");
var windowContext = var windowContext =
SpecialPowers.wrap(newWindow).QueryInterface(Components.interfaces.nsIInterfaceRequestor). SpecialPowers.wrap(newWindow).QueryInterface(SpecialPowers.Ci.nsIInterfaceRequestor).
getInterface(Components.interfaces.nsIWebNavigation). getInterface(SpecialPowers.Ci.nsIWebNavigation).
QueryInterface(Components.interfaces.nsIDocShell); QueryInterface(SpecialPowers.Ci.nsIDocShell);
webHandler.launchWithURI(uri, windowContext); webHandler.launchWithURI(uri, windowContext);
@ -50,18 +50,18 @@ function test() {
// set up the local handler object // set up the local handler object
var localHandler = Cc["@mozilla.org/uriloader/local-handler-app;1"]. var localHandler = Cc["@mozilla.org/uriloader/local-handler-app;1"].
createInstance(Components.interfaces.nsILocalHandlerApp); createInstance(SpecialPowers.Ci.nsILocalHandlerApp);
localHandler.name = "Test Local Handler App"; localHandler.name = "Test Local Handler App";
// get a local app that we know will be there and do something sane // get a local app that we know will be there and do something sane
var osString = Cc["@mozilla.org/xre/app-info;1"]. 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"]. var dirSvc = Cc["@mozilla.org/file/directory_service;1"].
getService(Components.interfaces.nsIDirectoryServiceProvider); getService(SpecialPowers.Ci.nsIDirectoryServiceProvider);
if (osString == "WINNT") { if (osString == "WINNT") {
var windowsDir = dirSvc.getFile("WinD", {}); 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"); exe.appendRelativePath("SYSTEM32\\HOSTNAME.EXE");
} else if (osString == "Darwin") { } else if (osString == "Darwin") {
@ -79,13 +79,13 @@ function test() {
// assume a generic UNIX variant // assume a generic UNIX variant
exe = Cc["@mozilla.org/file/local;1"]. exe = Cc["@mozilla.org/file/local;1"].
createInstance(Components.interfaces.nsILocalFile); createInstance(SpecialPowers.Ci.nsILocalFile);
exe.initWithPath("/bin/echo"); exe.initWithPath("/bin/echo");
} }
} else { } else {
// assume a generic UNIX variant // assume a generic UNIX variant
exe = Cc["@mozilla.org/file/local;1"]. exe = Cc["@mozilla.org/file/local;1"].
createInstance(Components.interfaces.nsILocalFile); createInstance(SpecialPowers.Ci.nsILocalFile);
exe.initWithPath("/bin/echo"); exe.initWithPath("/bin/echo");
} }
@ -100,11 +100,11 @@ function test() {
if (osString == "NOTDarwin") { if (osString == "NOTDarwin") {
var killall = Cc["@mozilla.org/file/local;1"]. var killall = Cc["@mozilla.org/file/local;1"].
createInstance(Components.interfaces.nsILocalFile); createInstance(SpecialPowers.Ci.nsILocalFile);
killall.initWithPath("/usr/bin/killall"); killall.initWithPath("/usr/bin/killall");
var process = Cc["@mozilla.org/process/util;1"]. var process = Cc["@mozilla.org/process/util;1"].
createInstance(Components.interfaces.nsIProcess); createInstance(SpecialPowers.Ci.nsIProcess);
process.init(killall); process.init(killall);
var args = ['iCal']; var args = ['iCal'];