diff options
author | Matt A. Tobin <email@mattatobin.com> | 2021-11-14 04:30:01 -0500 |
---|---|---|
committer | Matt A. Tobin <email@mattatobin.com> | 2021-11-14 04:30:01 -0500 |
commit | 93f5ecf4693025d9068f38fcb5fe1b7abc0356b2 (patch) | |
tree | acec26376b1fc14794ef28b4c92dc0d11d5c3405 | |
parent | 5b7b789898077c1a8718ab0052c939a994b391a5 (diff) | |
download | aura-central-93f5ecf4693025d9068f38fcb5fe1b7abc0356b2.tar.gz |
Issue %3005 - Move chrome/ to components/registry
51 files changed, 38 insertions, 1226 deletions
diff --git a/chrome/moz.build b/chrome/moz.build deleted file mode 100644 index 71a6244a5..000000000 --- a/chrome/moz.build +++ /dev/null @@ -1,39 +0,0 @@ -# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. - -TEST_DIRS += ['test'] - -XPIDL_SOURCES += [ - 'nsIChromeRegistry.idl', - 'nsIToolkitChromeRegistry.idl', -] - -XPIDL_MODULE = 'chrome' - -EXPORTS.mozilla.chrome += [ - 'RegistryMessageUtils.h', -] - -SOURCES += [ - 'nsChromeProtocolHandler.cpp', - 'nsChromeRegistry.cpp', - 'nsChromeRegistryChrome.cpp', - 'nsChromeRegistryContent.cpp', -] - -include('/ipc/chromium/chromium-config.mozbuild') - -FINAL_LIBRARY = 'xul' - -LOCAL_INCLUDES += [ - '!/xpcom', - '/dom/base', - '/netwerk/base', - '/netwerk/protocol/res', - '/xpcom/components' -] - -if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']: - CXXFLAGS += CONFIG['TK_CFLAGS'] diff --git a/chrome/test/moz.build b/chrome/test/moz.build deleted file mode 100644 index 43cd1465d..000000000 --- a/chrome/test/moz.build +++ /dev/null @@ -1,9 +0,0 @@ -# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. - -XPCSHELL_TESTS_MANIFESTS += [ - 'unit/xpcshell.ini', - 'unit_ipc/xpcshell.ini', -] diff --git a/chrome/test/unit/data/test_abi.manifest b/chrome/test/unit/data/test_abi.manifest deleted file mode 100644 index 6d265fc99..000000000 --- a/chrome/test/unit/data/test_abi.manifest +++ /dev/null @@ -1,4 +0,0 @@ -category abitest test1 found ABI=XPCShell_noarch-spidermonkey -category abitest test2 notfound ABI=WINNT_noarch-spidermonkey -category abitest test3 found ABI!=WINNT_noarch-spidermonkey -category abitest test4 notfound ABI!=XPCShell_noarch-spidermonkey diff --git a/chrome/test/unit/data/test_bug292789.manifest b/chrome/test/unit/data/test_bug292789.manifest deleted file mode 100644 index df67aa15c..000000000 --- a/chrome/test/unit/data/test_bug292789.manifest +++ /dev/null @@ -1,4 +0,0 @@ -content test1 test/ -content test2 test/ contentaccessible=yes -content test3 test/ contentaccessible=no -content test4 test/ contentaccessible diff --git a/chrome/test/unit/data/test_bug380398.manifest b/chrome/test/unit/data/test_bug380398.manifest deleted file mode 100644 index a2349c793..000000000 --- a/chrome/test/unit/data/test_bug380398.manifest +++ /dev/null @@ -1,14 +0,0 @@ -# Success cases -content test1 test/ appversion=5 -content test2 test/ appversion<6 -content test3 test/ appversion>4 -content test4 test/ appversion>=5 -content test5 test/ appversion<=5 - -# Failure cases -content test6 test/ appversion>5 -content test7 test/ appversion<5 -content test8 test/ appversion> -content test9 test/ appversion< -content test10 test/ appversion= -content test11 test/ appversion diff --git a/chrome/test/unit/data/test_bug397073.manifest b/chrome/test/unit/data/test_bug397073.manifest deleted file mode 100644 index a219e8c7e..000000000 --- a/chrome/test/unit/data/test_bug397073.manifest +++ /dev/null @@ -1,6 +0,0 @@ -# Success cases -content test1 test/ os=xpcshell -content test2 test/ os=XPCshell - -# Failure cases -content test3 test/ os=FOOshell diff --git a/chrome/test/unit/data/test_bug399707.manifest b/chrome/test/unit/data/test_bug399707.manifest deleted file mode 100644 index ac0d97203..000000000 --- a/chrome/test/unit/data/test_bug399707.manifest +++ /dev/null @@ -1,11 +0,0 @@ -# Success cases -content test1 test/ application={39885e5f-f6b4-4e2a-87e5-6259ecf79011} -content test2 test/ application!={d51eecae-eab5-4779-85cb-45f1ec8657c8} -content test3 test/ application!= - -# Failure cases -content test4 test/ application= -content test5 test/ application={d51eecae-eab5-4779-85cb-45f1ec8657c8} -content test6 test/ application!={39885e5f-f6b4-4e2a-87e5-6259ecf79011} -content test7 test/ appversion=={39885e5f-f6b4-4e2a-87e5-6259ecf79011} -content test8 test/ application!!{d51eecae-eab5-4779-85cb-45f1ec8657c8} diff --git a/chrome/test/unit/data/test_bug401153.manifest b/chrome/test/unit/data/test_bug401153.manifest deleted file mode 100644 index 4fcba1bdc..000000000 --- a/chrome/test/unit/data/test_bug401153.manifest +++ /dev/null @@ -1,11 +0,0 @@ -# Should work -resource test1 test1/ - -# Mapping into jar files should work -resource test3 jar:test3.jar!/resources/ - -# Invalid line -resource test4 - -# Check we made it through the whole manifest -resource test5 test5/ diff --git a/chrome/test/unit/data/test_bug519468.manifest b/chrome/test/unit/data/test_bug519468.manifest deleted file mode 100644 index 36f0a18f2..000000000 --- a/chrome/test/unit/data/test_bug519468.manifest +++ /dev/null @@ -1,4 +0,0 @@ -locale testmatchos en-US jar:en-US.jar!/locale/en-US/global/ -locale testmatchos fr-FR jar:en-US.jar!/locale/en-US/global/ -locale testmatchos de-DE jar:en-US.jar!/locale/en-US/global/ -locale testmatchos xx-AA jar:en-US.jar!/locale/en-US/global/ diff --git a/chrome/test/unit/data/test_bug564667.xpi b/chrome/test/unit/data/test_bug564667.xpi Binary files differdeleted file mode 100644 index be1632d8c..000000000 --- a/chrome/test/unit/data/test_bug564667.xpi +++ /dev/null diff --git a/chrome/test/unit/data/test_bug564667/chrome.manifest b/chrome/test/unit/data/test_bug564667/chrome.manifest deleted file mode 100644 index b35692764..000000000 --- a/chrome/test/unit/data/test_bug564667/chrome.manifest +++ /dev/null @@ -1,16 +0,0 @@ -# Locally defined URLs -content test1 test/ -locale test1 en-US test/ -skin test1 test test/ - -# Test Override -content testOverride test/ -override chrome://testOverride/content file:///test1/override - - -# Load external manifest -manifest loaded.manifest - -# Failure Cases -overlay chrome://test1/content/overlay.xul chrome://test1/content/test1.xul -style chrome://test1/content/style.xul chrome://test1/content/test1.css diff --git a/chrome/test/unit/data/test_bug564667/loaded.manifest b/chrome/test/unit/data/test_bug564667/loaded.manifest deleted file mode 100644 index 2f231856a..000000000 --- a/chrome/test/unit/data/test_bug564667/loaded.manifest +++ /dev/null @@ -1,2 +0,0 @@ -content test2 test/ -locale test2 en-US test/ diff --git a/chrome/test/unit/data/test_bug848297.manifest b/chrome/test/unit/data/test_bug848297.manifest deleted file mode 100644 index d9730a9ce..000000000 --- a/chrome/test/unit/data/test_bug848297.manifest +++ /dev/null @@ -1,4 +0,0 @@ -locale basepack en-US jar:en-US.jar!/locale/en-US/global/ -locale basepack fr jar:en-US.jar!/locale/en-US/global/ -locale overpack en-US jar:en-US.jar!/locale/en-US/global/ -locale overpack de jar:en-US.jar!/locale/en-US/global/ diff --git a/chrome/test/unit/data/test_crlf.manifest b/chrome/test/unit/data/test_crlf.manifest deleted file mode 100644 index 0f3032112..000000000 --- a/chrome/test/unit/data/test_crlf.manifest +++ /dev/null @@ -1,3 +0,0 @@ -# Note: the following lines begins/end with a CR -
-
content test_crlf .
diff --git a/chrome/test/unit/data/test_data_protocol_registration.manifest b/chrome/test/unit/data/test_data_protocol_registration.manifest deleted file mode 100644 index 4effa6ee6..000000000 --- a/chrome/test/unit/data/test_data_protocol_registration.manifest +++ /dev/null @@ -1,5 +0,0 @@ -# package used only for valid override -content good-package bar/ - -# Local resource (should work) -override chrome://good-package/content/test.xul data:application/vnd.mozilla.xul+xml, diff --git a/chrome/test/unit/data/test_no_remote_registration.manifest b/chrome/test/unit/data/test_no_remote_registration.manifest deleted file mode 100644 index b677850ca..000000000 --- a/chrome/test/unit/data/test_no_remote_registration.manifest +++ /dev/null @@ -1,32 +0,0 @@ -# package used only for valid overlaying and overrides -content good-package bar/ - -# UI Resource URIs (should not work) -content moz-protocol-ui-resource moz-protocol-ui-resource://foo/ -locale moz-protocol-ui-resource en-us moz-protocol-ui-resource://foo/ -skin moz-protocol-ui-resource skin1 moz-protocol-ui-resource://foo/ -override chrome://good-package/content/override-moz-protocol-ui-resource.xul moz-protocol-ui-resource://foo/ -resource moz-protocol-ui-resource moz-protocol-ui-resource://foo/ - -# Local file URIs (should not work) -content moz-protocol-local-file moz-protocol-local-file://foo/ -locale moz-protocol-local-file en-us moz-protocol-local-file://foo/ -skin moz-protocol-local-file skin1 moz-protocol-local-file://foo/ -override chrome://good-package/content/override-moz-protocol-local-file.xul moz-protocol-local-file://foo/ -resource moz-protocol-local-file moz-protocol-local-file://foo/ - -# Loadable by anyone URIs (should not work) -content moz-protocol-loadable-by-anyone moz-protocol-loadable-by-anyone://foo/ -locale moz-protocol-loadable-by-anyone en-us moz-protocol-loadable-by-anyone://foo/ -skin moz-protocol-loadable-by-anyone skin1 moz-protocol-loadable-by-anyone://foo/ -override chrome://good-package/content/override-moz-protocol-loadable-by-anyone.xul moz-protocol-loadable-by-anyone://foo/ -resource moz-protocol-loadable-by-anyone moz-protocol-loadable-by-anyone://foo/ - -# Working protocols should be after this point. Failing ones should be before. - -# Local resource (should work) -content moz-protocol-local-resource moz-protocol-local-resource://foo/ -locale moz-protocol-local-resource en-us moz-protocol-local-resource://foo/ -skin moz-protocol-local-resource skin1 moz-protocol-local-resource://foo/ -override chrome://good-package/content/override-moz-protocol-local-resource.xul moz-protocol-local-resource://foo/ -resource moz-protocol-local-resource moz-protocol-local-resource://foo/ diff --git a/chrome/test/unit/data/test_resolve_uris.manifest b/chrome/test/unit/data/test_resolve_uris.manifest deleted file mode 100644 index 43b497e67..000000000 --- a/chrome/test/unit/data/test_resolve_uris.manifest +++ /dev/null @@ -1,5 +0,0 @@ -resource foo . -content foo resource://foo/foo-content/ -locale foo foo resource://foo/foo-locale/ -skin foo foo resource://foo/foo-skin/ -override chrome://good-package/content/override-me.xul resource://foo/foo-override/override-me.xul diff --git a/chrome/test/unit/head_crtestutils.js b/chrome/test/unit/head_crtestutils.js deleted file mode 100644 index e3be96fd2..000000000 --- a/chrome/test/unit/head_crtestutils.js +++ /dev/null @@ -1,14 +0,0 @@ -const XULAPPINFO_CONTRACTID = "@mozilla.org/xre/app-info;1"; -const XULAPPINFO_CID = Components.ID("{4ba645d3-be6f-40d6-a42a-01b2f40091b8}"); - -var Cc = Components.classes; -var Ci = Components.interfaces; -var Cr = Components.results; - - -function registerManifests(manifests) -{ - var reg = Components.manager.QueryInterface(Ci.nsIComponentRegistrar); - for (var manifest of manifests) - reg.autoRegister(manifest); -} diff --git a/chrome/test/unit/test_abi.js b/chrome/test/unit/test_abi.js deleted file mode 100644 index 076fd3215..000000000 --- a/chrome/test/unit/test_abi.js +++ /dev/null @@ -1,29 +0,0 @@ -Components.utils.import("resource://testing-common/AppInfo.jsm", this); -updateAppInfo({ - name: "XPCShell", - ID: "{39885e5f-f6b4-4e2a-87e5-6259ecf79011}", - version: "5", - platformVersion: "1.9", -}); - -registerManifests([do_get_file("data/test_abi.manifest")]); - -const catman = Components.classes["@mozilla.org/categorymanager;1"]. - getService(Components.interfaces.nsICategoryManager); - -function is_registered(name) { - try { - var d = catman.getCategoryEntry("abitest", name); - return d == "found"; - } - catch (e) { - return false; - } -} - -function run_test() { - do_check_true(is_registered("test1")); - do_check_false(is_registered("test2")); - do_check_true(is_registered("test3")); - do_check_false(is_registered("test4")); -} diff --git a/chrome/test/unit/test_bug292789.js b/chrome/test/unit/test_bug292789.js deleted file mode 100644 index e57c8ac12..000000000 --- a/chrome/test/unit/test_bug292789.js +++ /dev/null @@ -1,37 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ - -const MANIFESTS = [ - do_get_file("data/test_bug292789.manifest") -]; - -registerManifests(MANIFESTS); - -var gIOS; -var gCR; - -function check_accessibility(spec, desired) -{ - var uri = gIOS.newURI(spec, null, null); - var actual = gCR.allowContentToAccess(uri); - do_check_eq(desired, actual); -} - -function run_test() -{ - gIOS = Cc["@mozilla.org/network/io-service;1"]. - getService(Ci.nsIIOService); - gCR = Cc["@mozilla.org/chrome/chrome-registry;1"]. - getService(Ci.nsIXULChromeRegistry); - gCR.checkForNewChrome(); - - check_accessibility("chrome://test1/content/", false); - check_accessibility("chrome://test1/content/foo.js", false); - check_accessibility("chrome://test2/content/", true); - check_accessibility("chrome://test2/content/foo.js", true); - check_accessibility("chrome://test3/content/", false); - check_accessibility("chrome://test3/content/foo.js", false); - check_accessibility("chrome://test4/content/", true); -} diff --git a/chrome/test/unit/test_bug380398.js b/chrome/test/unit/test_bug380398.js deleted file mode 100644 index ce0b6233e..000000000 --- a/chrome/test/unit/test_bug380398.js +++ /dev/null @@ -1,68 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ - - -var MANIFESTS = [ - do_get_file("data/test_bug380398.manifest") -]; - -registerManifests(MANIFESTS); - -Components.utils.import("resource://testing-common/AppInfo.jsm", this); -updateAppInfo({ - name: "XPCShell", - id: "{39885e5f-f6b4-4e2a-87e5-6259ecf79011}", - version: "5", - platformVersion: "1.9", -}); - -var gIOS = Cc["@mozilla.org/network/io-service;1"] - .getService(Ci.nsIIOService); -var chromeReg = Cc["@mozilla.org/chrome/chrome-registry;1"] - .getService(Ci.nsIChromeRegistry); -chromeReg.checkForNewChrome(); - -var target = gIOS.newFileURI(do_get_file("data")); -target = target.spec + "test/test.xul"; - -function test_succeeded_mapping(namespace) -{ - var uri = gIOS.newURI("chrome://" + namespace + "/content/test.xul", - null, null); - try { - var result = chromeReg.convertChromeURL(uri); - do_check_eq(result.spec, target); - } - catch (ex) { - do_throw(namespace); - } -} - -function test_failed_mapping(namespace) -{ - var uri = gIOS.newURI("chrome://" + namespace + "/content/test.xul", - null, null); - try { - var result = chromeReg.convertChromeURL(uri); - do_throw(namespace); - } - catch (ex) { - } -} - -function run_test() -{ - test_succeeded_mapping("test1"); - test_succeeded_mapping("test2"); - test_succeeded_mapping("test3"); - test_succeeded_mapping("test4"); - test_succeeded_mapping("test5"); - test_failed_mapping("test6"); - test_failed_mapping("test7"); - test_failed_mapping("test8"); - test_failed_mapping("test9"); - test_failed_mapping("test10"); - test_failed_mapping("test11"); -} diff --git a/chrome/test/unit/test_bug397073.js b/chrome/test/unit/test_bug397073.js deleted file mode 100644 index fb9c6c095..000000000 --- a/chrome/test/unit/test_bug397073.js +++ /dev/null @@ -1,61 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ - -var MANIFESTS = [ - do_get_file("data/test_bug397073.manifest") -]; - - -registerManifests(MANIFESTS); - -Components.utils.import("resource://testing-common/AppInfo.jsm", this); -updateAppInfo({ - name: "XPCShell", - ID: "{39885e5f-f6b4-4e2a-87e5-6259ecf79011}", - version: "5", - platformVersion: "1.9", -}); - -var gIOS = Cc["@mozilla.org/network/io-service;1"] - .getService(Ci.nsIIOService); -var chromeReg = Cc["@mozilla.org/chrome/chrome-registry;1"] - .getService(Ci.nsIChromeRegistry); -chromeReg.checkForNewChrome(); - -var target = gIOS.newFileURI(do_get_file("data")); -target = target.spec + "test/test.xul"; - -function test_succeeded_mapping(namespace) -{ - var uri = gIOS.newURI("chrome://" + namespace + "/content/test.xul", - null, null); - try { - var result = chromeReg.convertChromeURL(uri); - do_check_eq(result.spec, target); - } - catch (ex) { - do_throw(namespace); - } -} - -function test_failed_mapping(namespace) -{ - var uri = gIOS.newURI("chrome://" + namespace + "/content/test.xul", - null, null); - try { - var result = chromeReg.convertChromeURL(uri); - do_throw(namespace); - } - catch (ex) { - } -} - -function run_test() -{ - test_succeeded_mapping("test1"); - test_succeeded_mapping("test2"); - - test_failed_mapping("test3"); -} diff --git a/chrome/test/unit/test_bug399707.js b/chrome/test/unit/test_bug399707.js deleted file mode 100644 index 05273550c..000000000 --- a/chrome/test/unit/test_bug399707.js +++ /dev/null @@ -1,64 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ - -var MANIFESTS = [ - do_get_file("data/test_bug399707.manifest") -]; - -registerManifests(MANIFESTS); - -Components.utils.import("resource://testing-common/AppInfo.jsm", this); -updateAppInfo({ - name: "XPCShell", - ID: "{39885e5f-f6b4-4e2a-87e5-6259ecf79011}", - version: "5", - platformVersion: "1.9", -}); - -var gIOS = Cc["@mozilla.org/network/io-service;1"] - .getService(Ci.nsIIOService); -var chromeReg = Cc["@mozilla.org/chrome/chrome-registry;1"] - .getService(Ci.nsIChromeRegistry); -chromeReg.checkForNewChrome(); - -var target = gIOS.newFileURI(do_get_file("data")); -target = target.spec + "test/test.xul"; - -function test_succeeded_mapping(namespace) -{ - var uri = gIOS.newURI("chrome://" + namespace + "/content/test.xul", - null, null); - try { - var result = chromeReg.convertChromeURL(uri); - do_check_eq(result.spec, target); - } - catch (ex) { - do_throw(namespace); - } -} - -function test_failed_mapping(namespace) -{ - var uri = gIOS.newURI("chrome://" + namespace + "/content/test.xul", - null, null); - try { - var result = chromeReg.convertChromeURL(uri); - do_throw(namespace); - } - catch (ex) { - } -} - -function run_test() -{ - test_succeeded_mapping("test1"); - test_succeeded_mapping("test2"); - test_succeeded_mapping("test3"); - test_failed_mapping("test4"); - test_failed_mapping("test5"); - test_failed_mapping("test6"); - test_failed_mapping("test7"); - test_failed_mapping("test8"); -} diff --git a/chrome/test/unit/test_bug401153.js b/chrome/test/unit/test_bug401153.js deleted file mode 100644 index 3317d8b1e..000000000 --- a/chrome/test/unit/test_bug401153.js +++ /dev/null @@ -1,55 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ - -var MANIFESTS = [ - do_get_file("data/test_bug401153.manifest") -]; - -registerManifests(MANIFESTS); - -Components.utils.import("resource://testing-common/AppInfo.jsm", this); -updateAppInfo({ - name: "XPCShell", - ID: "{39885e5f-f6b4-4e2a-87e5-6259ecf79011}", - version: "5", - platformVersion: "1.9", -}); - -var gIOS = Cc["@mozilla.org/network/io-service;1"] - .getService(Ci.nsIIOService); -var chromeReg = Cc["@mozilla.org/chrome/chrome-registry;1"] - .getService(Ci.nsIChromeRegistry); -chromeReg.checkForNewChrome(); - -var rph = gIOS.getProtocolHandler("resource") - .QueryInterface(Ci.nsIResProtocolHandler); - -function test_succeeded_mapping(namespace, target) -{ - try { - do_check_true(rph.hasSubstitution(namespace)); - var uri = gIOS.newURI("resource://" + namespace, null, null); - dump("### checking for " + target + ", getting " + rph.resolveURI(uri) + "\n"); - do_check_eq(rph.resolveURI(uri), target); - } - catch (ex) { - dump(ex + "\n"); - do_throw(namespace); - } -} - -function test_failed_mapping(namespace) -{ - do_check_false(rph.hasSubstitution(namespace)); -} - -function run_test() -{ - var data = gIOS.newFileURI(do_get_file("data")).spec; - test_succeeded_mapping("test1", data + "test1/"); - test_succeeded_mapping("test3", "jar:" + data + "test3.jar!/resources/"); - test_failed_mapping("test4"); - test_succeeded_mapping("test5", data + "test5/"); -} diff --git a/chrome/test/unit/test_bug415367.js b/chrome/test/unit/test_bug415367.js deleted file mode 100644 index 6d02223c0..000000000 --- a/chrome/test/unit/test_bug415367.js +++ /dev/null @@ -1,48 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ - -var gIOS = Cc["@mozilla.org/network/io-service;1"] - .getService(Ci.nsIIOService); - -function test_uri(obj) -{ - var uri = null; - var failed = false; - var message = ""; - try { - uri = gIOS.newURI(obj.uri, null, null); - if (!obj.result) { - failed = true; - message = obj.uri + " should not be accepted as a valid URI"; - } - } - catch (ex) { - if (obj.result) { - failed = true; - message = obj.uri + " should be accepted as a valid URI"; - } - } - if (failed) - do_throw(message); - if (obj.result) { - do_check_true(uri != null); - do_check_eq(uri.spec, obj.uri); - } -} - -function run_test() -{ - var tests = [ - {uri: "chrome://blah/content/blah.xul", result: true}, - {uri: "chrome://blah/content/:/blah/blah.xul", result: false}, - {uri: "chrome://blah/content/%252e./blah/blah.xul", result: false}, - {uri: "chrome://blah/content/%252e%252e/blah/blah.xul", result: false}, - {uri: "chrome://blah/content/blah.xul?param=%252e./blah/", result: true}, - {uri: "chrome://blah/content/blah.xul?param=:/blah/", result: true}, - {uri: "chrome://blah/content/blah.xul?param=%252e%252e/blah/", result: true}, - ]; - for (var i = 0; i < tests.length; ++ i) - test_uri(tests[i]); -} diff --git a/chrome/test/unit/test_bug519468.js b/chrome/test/unit/test_bug519468.js deleted file mode 100644 index 69c5c8622..000000000 --- a/chrome/test/unit/test_bug519468.js +++ /dev/null @@ -1,94 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ - -var MANIFESTS = [ - do_get_file("data/test_bug519468.manifest") -]; - -Components.utils.import("resource://testing-common/MockRegistrar.jsm"); -// Stub in the locale service so we can control what gets returned as the OS locale setting -Components.utils.import("resource://gre/modules/XPCOMUtils.jsm"); - -var stubOSLocale = null; - -StubLocaleService = { - QueryInterface: XPCOMUtils.generateQI([Ci.nsILocaleService, Ci.nsISupports]), - - getLocaleComponentForUserAgent: function SLS_getLocaleComponentForUserAgent() - { - return stubOSLocale; - } -} - -MockRegistrar.register("@mozilla.org/intl/nslocaleservice;1", StubLocaleService); - -// Now fire up the test -do_test_pending() -registerManifests(MANIFESTS); - -var chromeReg = Cc["@mozilla.org/chrome/chrome-registry;1"] - .getService(Ci.nsIXULChromeRegistry) - .QueryInterface(Ci.nsIToolkitChromeRegistry); -chromeReg.checkForNewChrome(); - -var prefService = Cc["@mozilla.org/preferences-service;1"] - .getService(Ci.nsIPrefService) - .QueryInterface(Ci.nsIPrefBranch); -var os = Cc["@mozilla.org/observer-service;1"] - .getService(Ci.nsIObserverService); - -var testsLocale = [ - // These tests cover when the OS local is included in our manifest - {matchOS: false, selected: "en-US", osLocale: "xx-AA", locale: "en-US"}, - {matchOS: true, selected: "en-US", osLocale: "xx-AA", locale: "xx-AA"}, - {matchOS: false, selected: "fr-FR", osLocale: "xx-AA", locale: "fr-FR"}, - {matchOS: true, selected: "fr-FR", osLocale: "xx-AA", locale: "xx-AA"}, - {matchOS: false, selected: "de-DE", osLocale: "xx-AA", locale: "de-DE"}, - {matchOS: true, selected: "de-DE", osLocale: "xx-AA", locale: "xx-AA"}, - // these tests cover the case where the OS locale is not available in our manifest, but the - // base language is (ie, substitute xx-AA which we have for xx-BB which we don't) - {matchOS: false, selected: "en-US", osLocale: "xx-BB", locale: "en-US"}, - {matchOS: true, selected: "en-US", osLocale: "xx-BB", locale: "xx-AA"}, - {matchOS: false, selected: "fr-FR", osLocale: "xx-BB", locale: "fr-FR"}, - {matchOS: true, selected: "fr-FR", osLocale: "xx-BB", locale: "xx-AA"}, - // These tests cover where the language is not available - {matchOS: false, selected: "en-US", osLocale: "xy-BB", locale: "en-US"}, - {matchOS: true, selected: "en-US", osLocale: "xy-BB", locale: "en-US"}, - {matchOS: false, selected: "fr-FR", osLocale: "xy-BB", locale: "fr-FR"}, - {matchOS: true, selected: "fr-FR", osLocale: "xy-BB", locale: "en-US"}, -]; - -var observedLocale = null; - -function test_locale(aTest) { - observedLocale = null; - - stubOSLocale = aTest.osLocale; - prefService.setBoolPref("intl.locale.matchOS", aTest.matchOS); - prefService.setCharPref("general.useragent.locale", aTest.selected); - - chromeReg.reloadChrome(); - - do_check_eq(observedLocale, aTest.locale); -} - -// Callback function for observing locale change. May be called more than once -// per test iteration. -function checkValidity() { - observedLocale = chromeReg.getSelectedLocale("testmatchos"); - dump("checkValidity called back with locale = " + observedLocale + "\n"); -} - -function run_test() { - os.addObserver(checkValidity, "selected-locale-has-changed", false); - - for (let count = 0 ; count < testsLocale.length ; count++) { - dump("count = " + count + " " + testsLocale[count].toSource() + "\n"); - test_locale(testsLocale[count]); - } - - os.removeObserver(checkValidity, "selected-locale-has-changed"); - do_test_finished(); -} diff --git a/chrome/test/unit/test_bug564667.js b/chrome/test/unit/test_bug564667.js deleted file mode 100644 index 5f5e9940d..000000000 --- a/chrome/test/unit/test_bug564667.js +++ /dev/null @@ -1,121 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ - -const UNPACKAGED_ADDON = do_get_file("data/test_bug564667"); -const PACKAGED_ADDON = do_get_file("data/test_bug564667.xpi"); - -var gIOS = Cc["@mozilla.org/network/io-service;1"]. - getService(Ci.nsIIOService); - -var gCR = Cc["@mozilla.org/chrome/chrome-registry;1"]. - getService(Ci.nsIChromeRegistry). - QueryInterface(Ci.nsIXULOverlayProvider); - -/* - * Checks that a mapping was added - */ -function test_mapping(chromeURL, target) { - var uri = gIOS.newURI(chromeURL, null, null); - - try { - var result = gCR.convertChromeURL(uri); - do_check_eq(result.spec, target); - } - catch (ex) { - do_throw(chromeURL + " not Registered"); - } -} - -/* - * Checks that a mapping was removed - */ -function test_removed_mapping(chromeURL, target) { - var uri = gIOS.newURI(chromeURL, null, null); - try { - var result = gCR.convertChromeURL(uri); - do_throw(chromeURL + " not removed"); - } - catch (ex) { - // This should throw - } -} - -/* - * Checks if any overlay was added after loading - * the manifest files - * - * @param type The type of overlay: overlay|style - */ -function test_no_overlays(chromeURL, target, type) { - var type = type || "overlay"; - var uri = gIOS.newURI(chromeURL, null, null); - var present = false, elem; - - var overlays = (type == "overlay") ? - gCR.getXULOverlays(uri) : gCR.getStyleOverlays(uri); - - // We shouldn't be allowed to register overlays nor styles - if (overlays.hasMoreElements()) { - if (type == "styles") - do_throw("Style Registered: " + chromeURL); - else - do_throw("Overlay Registered: " + chromeURL); - } -} - -function testManifest(manifestPath, baseURI) { - - // ------------------ Add manifest file ------------------------ - Components.manager.addBootstrappedManifestLocation(manifestPath); - - // Test Adding Content URL - test_mapping("chrome://test1/content", baseURI + "test/test1.xul"); - - // Test Adding Locale URL - test_mapping("chrome://test1/locale", baseURI + "test/test1.dtd"); - - // Test Adding Skin URL - test_mapping("chrome://test1/skin", baseURI + "test/test1.css"); - - // Test Adding Manifest URL - test_mapping("chrome://test2/content", baseURI + "test/test2.xul"); - test_mapping("chrome://test2/locale", baseURI + "test/test2.dtd"); - - // Test Adding Override - test_mapping("chrome://testOverride/content", 'file:///test1/override') - - // Test Not-Adding Overlays - test_no_overlays("chrome://test1/content/overlay.xul", - "chrome://test1/content/test1.xul"); - - // Test Not-Adding Styles - test_no_overlays("chrome://test1/content/style.xul", - "chrome://test1/content/test1.css", "styles"); - - - // ------------------ Remove manifest file ------------------------ - Components.manager.removeBootstrappedManifestLocation(manifestPath); - - // Test Removing Content URL - test_removed_mapping("chrome://test1/content", baseURI + "test/test1.xul"); - - // Test Removing Content URL - test_removed_mapping("chrome://test1/locale", baseURI + "test/test1.dtd"); - - // Test Removing Skin URL - test_removed_mapping("chrome://test1/skin", baseURI + "test/test1.css"); - - // Test Removing Manifest URL - test_removed_mapping("chrome://test2/content", baseURI + "test/test2.xul"); - test_removed_mapping("chrome://test2/locale", baseURI + "test/test2.dtd"); -} - -function run_test() { - // Test an unpackaged addon - testManifest(UNPACKAGED_ADDON, gIOS.newFileURI(UNPACKAGED_ADDON).spec); - - // Test a packaged addon - testManifest(PACKAGED_ADDON, "jar:" + gIOS.newFileURI(PACKAGED_ADDON).spec + "!/"); -} diff --git a/chrome/test/unit/test_bug848297.js b/chrome/test/unit/test_bug848297.js deleted file mode 100644 index 0875370f7..000000000 --- a/chrome/test/unit/test_bug848297.js +++ /dev/null @@ -1,48 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ - -var MANIFESTS = [ - do_get_file("data/test_bug848297.manifest") -]; - -// Stub in the locale service so we can control what gets returned as the OS locale setting -Components.utils.import("resource://gre/modules/XPCOMUtils.jsm"); - -registerManifests(MANIFESTS); - -var chromeReg = Cc["@mozilla.org/chrome/chrome-registry;1"] - .getService(Ci.nsIXULChromeRegistry) - .QueryInterface(Ci.nsIToolkitChromeRegistry); -chromeReg.checkForNewChrome(); - -var prefService = Cc["@mozilla.org/preferences-service;1"] - .getService(Ci.nsIPrefService) - .QueryInterface(Ci.nsIPrefBranch); - -function enum_to_array(strings) { - let rv = []; - while (strings.hasMore()) { - rv.push(strings.getNext()); - } - rv.sort(); - return rv; -} - -function run_test() { - - // without override - prefService.setCharPref("general.useragent.locale", "de"); - do_check_eq(chromeReg.getSelectedLocale("basepack"), "en-US"); - do_check_eq(chromeReg.getSelectedLocale("overpack"), "de"); - do_check_matches(enum_to_array(chromeReg.getLocalesForPackage("basepack")), - ['en-US', 'fr']); - - // with override - prefService.setCharPref("chrome.override_package.basepack", "overpack"); - do_check_eq(chromeReg.getSelectedLocale("basepack"), "de"); - do_check_matches(enum_to_array(chromeReg.getLocalesForPackage("basepack")), - ['de', 'en-US']); - -} diff --git a/chrome/test/unit/test_crlf.js b/chrome/test/unit/test_crlf.js deleted file mode 100644 index b577c49a9..000000000 --- a/chrome/test/unit/test_crlf.js +++ /dev/null @@ -1,15 +0,0 @@ -registerManifests([do_get_file("data/test_crlf.manifest")]); - -function run_test() -{ - let cr = Cc["@mozilla.org/chrome/chrome-registry;1"]. - getService(Ci.nsIChromeRegistry); - - let ios = Cc["@mozilla.org/network/io-service;1"]. - getService(Ci.nsIIOService); - let sourceURI = ios.newURI("chrome://test_crlf/content/", null, null); - // this throws for packages that are not registered - let file = cr.convertChromeURL(sourceURI).QueryInterface(Ci.nsIFileURL).file; - - do_check_true(file.equals(do_get_file("data/test_crlf.xul", true))); -} diff --git a/chrome/test/unit/test_data_protocol_registration.js b/chrome/test/unit/test_data_protocol_registration.js deleted file mode 100644 index 71138bd92..000000000 --- a/chrome/test/unit/test_data_protocol_registration.js +++ /dev/null @@ -1,65 +0,0 @@ -/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- - * vim: sw=2 ts=2 sts=2 tw=78 expandtab : - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -var manifests = [ - do_get_file("data/test_data_protocol_registration.manifest"), -]; -registerManifests(manifests); - -var XULAppInfoFactory = { - // These two are used when we register all our factories (and unregister) - CID: XULAPPINFO_CID, - scheme: "XULAppInfo", - contractID: XULAPPINFO_CONTRACTID, - createInstance: function (outer, iid) { - if (outer != null) - throw Cr.NS_ERROR_NO_AGGREGATION; - return XULAppInfo.QueryInterface(iid); - } -}; - -function run_test() -{ - // Add our XULAppInfo factory - let factories = [XULAppInfoFactory]; - - // Register our factories - for (let i = 0; i < factories.length; i++) { - let factory = factories[i]; - Components.manager.QueryInterface(Ci.nsIComponentRegistrar) - .registerFactory(factory.CID, "test-" + factory.scheme, - factory.contractID, factory); - } - - // Check for new chrome - let cr = Cc["@mozilla.org/chrome/chrome-registry;1"]. - getService(Ci.nsIChromeRegistry); - cr.checkForNewChrome(); - - // Check that our override worked - let expectedURI = "data:application/vnd.mozilla.xul+xml,"; - let sourceURI = "chrome://good-package/content/test.xul"; - try { - let ios = Cc["@mozilla.org/network/io-service;1"]. - getService(Ci.nsIIOService); - sourceURI = ios.newURI(sourceURI, null, null); - // this throws for packages that are not registered - let uri = cr.convertChromeURL(sourceURI).spec; - - do_check_eq(expectedURI, uri); - } - catch (e) { - dump(e + "\n"); - do_throw("Should have registered our URI!"); - } - - // Unregister our factories so we do not leak - for (let i = 0; i < factories.length; i++) { - let factory = factories[i]; - Components.manager.QueryInterface(Ci.nsIComponentRegistrar) - .unregisterFactory(factory.CID, factory); - } -} diff --git a/chrome/test/unit/test_no_remote_registration.js b/chrome/test/unit/test_no_remote_registration.js deleted file mode 100644 index 281a79dd3..000000000 --- a/chrome/test/unit/test_no_remote_registration.js +++ /dev/null @@ -1,202 +0,0 @@ -/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- - * vim: sw=2 ts=2 sts=2 tw=78 expandtab : - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -var manifests = [ - do_get_file("data/test_no_remote_registration.manifest"), -]; -registerManifests(manifests); - -Components.utils.import("resource://gre/modules/XPCOMUtils.jsm"); - -Components.utils.import("resource://testing-common/AppInfo.jsm", this); -var XULAppInfo = newAppInfo({ - name: "XPCShell", - ID: "{39885e5f-f6b4-4e2a-87e5-6259ecf79011}", - version: "5", - platformVersion: "1.9", -}); - -var XULAppInfoFactory = { - // These two are used when we register all our factories (and unregister) - CID: Components.ID("{c763b610-9d49-455a-bbd2-ede71682a1ac}"), - scheme: "XULAppInfo", - contractID: "@mozilla.org/xre/app-info;1", - createInstance: function (outer, iid) { - if (outer != null) - throw Cr.NS_ERROR_NO_AGGREGATION; - return XULAppInfo.QueryInterface(iid); - } -}; - -function ProtocolHandler(aScheme, aFlags) -{ - this.scheme = aScheme; - this.protocolFlags = aFlags; - this.contractID = "@mozilla.org/network/protocol;1?name=" + aScheme; -} - -ProtocolHandler.prototype = -{ - defaultPort: -1, - allowPort: () => false, - newURI: function(aSpec, aCharset, aBaseURI) - { - let uri = Cc["@mozilla.org/network/standard-url;1"]. - createInstance(Ci.nsIURI); - uri.spec = aSpec; - if (!uri.scheme) { - // We got a partial uri, so let's resolve it with the base one - uri.spec = aBaseURI.resolve(aSpec); - } - return uri; - }, - newChannel2: function() { throw Cr.NS_ERROR_NOT_IMPLEMENTED }, - newChannel: function() { throw Cr.NS_ERROR_NOT_IMPLEMENTED }, - QueryInterface: XPCOMUtils.generateQI([ - Ci.nsIProtocolHandler - ]) -}; - -var testProtocols = [ - // It doesn't matter if it has this flag - the only flag we accept is - // URI_IS_LOCAL_RESOURCE. - {scheme: "moz-protocol-ui-resource", - flags: Ci.nsIProtocolHandler.URI_IS_UI_RESOURCE, - CID: Components.ID("{d6dedc93-558f-44fe-90f4-3b4bba8a0b14}"), - shouldRegister: false - }, - // It doesn't matter if it has this flag - the only flag we accept is - // URI_IS_LOCAL_RESOURCE. - {scheme: "moz-protocol-local-file", - flags: Ci.nsIProtocolHandler.URI_IS_LOCAL_FILE, - CID: Components.ID("{ee30d594-0a2d-4f47-89cc-d4cde320ab69}"), - shouldRegister: false - }, - // This clearly is non-local - {scheme: "moz-protocol-loadable-by-anyone", - flags: Ci.nsIProtocolHandler.URI_LOADABLE_BY_ANYONE, - CID: Components.ID("{c3735f23-3b0c-4a33-bfa0-79436dcd40b2}"), - shouldRegister: false - }, - // This should always be last (unless we add more flags that are OK) - {scheme: "moz-protocol-local-resource", - flags: Ci.nsIProtocolHandler.URI_IS_LOCAL_RESOURCE, - CID: Components.ID("{b79e977c-f840-469a-b413-0125cc1b62a5}"), - shouldRegister: true - }, -]; -function run_test() -{ - // Create factories - let factories = []; - for (let i = 0; i < testProtocols.length; i++) { - factories[i] = { - scheme: testProtocols[i].scheme, - flags: testProtocols[i].flags, - CID: testProtocols[i].CID, - contractID: "@mozilla.org/network/protocol;1?name=" + testProtocols[i].scheme, - createInstance: function(aOuter, aIID) - { - if (aOuter != null) - throw Cr.NS_ERROR_NO_AGGREGATION; - let handler = new ProtocolHandler(this.scheme, this.flags, this.CID); - return handler.QueryInterface(aIID); - } - }; - } - // Add our XULAppInfo factory - factories.push(XULAppInfoFactory); - - // Register our factories - for (let i = 0; i < factories.length; i++) { - let factory = factories[i]; - Components.manager.QueryInterface(Ci.nsIComponentRegistrar) - .registerFactory(factory.CID, "test-" + factory.scheme, - factory.contractID, factory); - } - - // Check for new chrome - let cr = Cc["@mozilla.org/chrome/chrome-registry;1"]. - getService(Ci.nsIChromeRegistry); - cr.checkForNewChrome(); - - // See if our various things were able to register - let registrationTypes = [ - "content", - "locale", - "skin", - "override", - "resource", - ]; - for (let i = 0; i < testProtocols.length; i++) { - let protocol = testProtocols[i]; - for (let j = 0; j < registrationTypes.length; j++) { - let type = registrationTypes[j]; - dump("Testing protocol '" + protocol.scheme + "' with type '" + type + - "'\n"); - let expectedURI = protocol.scheme + "://foo/"; - let sourceURI = "chrome://" + protocol.scheme + "/" + type + "/"; - switch (type) { - case "content": - expectedURI += protocol.scheme + ".xul"; - break; - case "locale": - expectedURI += protocol.scheme + ".dtd"; - break; - case "skin": - expectedURI += protocol.scheme + ".css"; - break; - case "override": - sourceURI = "chrome://good-package/content/override-" + - protocol.scheme + ".xul"; - break; - case "resource": - sourceURI = "resource://" + protocol.scheme + "/"; - break; - }; - try { - let ios = Cc["@mozilla.org/network/io-service;1"]. - getService(Ci.nsIIOService); - sourceURI = ios.newURI(sourceURI, null, null); - let uri; - if (type == "resource") { - // resources go about a slightly different way than everything else - let rph = ios.getProtocolHandler("resource"). - QueryInterface(Ci.nsIResProtocolHandler); - // this throws for packages that are not registered - uri = rph.resolveURI(sourceURI); - } - else { - // this throws for packages that are not registered - uri = cr.convertChromeURL(sourceURI).spec; - } - - if (protocol.shouldRegister) { - do_check_eq(expectedURI, uri); - } - else { - // Overrides will not throw, so we'll get to here. We want to make - // sure that the two strings are not the same in this situation. - do_check_neq(expectedURI, uri); - } - } - catch (e) { - if (protocol.shouldRegister) { - dump(e + "\n"); - do_throw("Should have registered our URI for protocol " + - protocol.scheme); - } - } - } - } - - // Unregister our factories so we do not leak - for (let i = 0; i < factories.length; i++) { - let factory = factories[i]; - Components.manager.QueryInterface(Ci.nsIComponentRegistrar) - .unregisterFactory(factory.CID, factory); - } -} diff --git a/chrome/test/unit/test_resolve_uris.js b/chrome/test/unit/test_resolve_uris.js deleted file mode 100644 index 30ae9bc26..000000000 --- a/chrome/test/unit/test_resolve_uris.js +++ /dev/null @@ -1,93 +0,0 @@ -/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -// head_crtestutils.js doesn't get included in the child by default -if (typeof registerManifests === "undefined") { - load("../unit/head_crtestutils.js"); -} - -var manifestFile = do_get_file("../unit/data/test_resolve_uris.manifest"); - -var manifests = [ manifestFile ]; -registerManifests(manifests); - -var ios = Cc["@mozilla.org/network/io-service;1"]. - getService(Ci.nsIIOService); - -function do_run_test() -{ - let cr = Cc["@mozilla.org/chrome/chrome-registry;1"]. - getService(Ci.nsIChromeRegistry); - - // If we don't have libxul or e10s then we don't have process separation, so - // we don't need to worry about checking for new chrome. - var appInfo = Cc["@mozilla.org/xre/app-info;1"]; - if (!appInfo || - (appInfo.getService(Ci.nsIXULRuntime).processType == - Ci.nsIXULRuntime.PROCESS_TYPE_DEFAULT)) { - cr.checkForNewChrome(); - } - - // See if our various things were able to register - let registrationTypes = [ - "content", - "locale", - "skin", - "override", - "resource", - ]; - - for (let j = 0; j < registrationTypes.length; j++) { - let type = registrationTypes[j]; - dump("Testing type '" + type + "'\n"); - let expectedURI = "resource://foo/foo-" + type + "/"; - let sourceURI = "chrome://foo/" + type + "/"; - switch (type) { - case "content": - expectedURI += "foo.xul"; - break; - case "locale": - expectedURI += "foo.dtd"; - break; - case "skin": - expectedURI += "foo.css"; - break; - case "override": - sourceURI = "chrome://good-package/content/override-me.xul"; - expectedURI += "override-me.xul"; - break; - case "resource": - expectedURI = ios.newFileURI(manifestFile.parent).spec; - sourceURI = "resource://foo/"; - break; - }; - try { - sourceURI = ios.newURI(sourceURI, null, null); - let uri; - if (type == "resource") { - // resources go about a slightly different way than everything else - let rph = ios.getProtocolHandler("resource"). - QueryInterface(Ci.nsIResProtocolHandler); - uri = rph.resolveURI(sourceURI); - } - else { - uri = cr.convertChromeURL(sourceURI).spec; - } - - do_check_eq(expectedURI, uri); - } - catch (e) { - dump(e + "\n"); - do_throw("Should have registered a handler for type '" + - type + "'\n"); - } - } -} - -if (typeof run_test === "undefined") { - run_test = function() { - do_run_test(); - }; -} diff --git a/chrome/test/unit/xpcshell.ini b/chrome/test/unit/xpcshell.ini deleted file mode 100644 index 3b9f84547..000000000 --- a/chrome/test/unit/xpcshell.ini +++ /dev/null @@ -1,20 +0,0 @@ -[DEFAULT] -head = head_crtestutils.js -tail = -support-files = data/** - -[test_abi.js] -[test_bug292789.js] -[test_bug380398.js] -[test_bug397073.js] -[test_bug399707.js] -[test_bug401153.js] -[test_bug415367.js] -[test_bug519468.js] -[test_bug564667.js] -tags = addons -[test_bug848297.js] -[test_crlf.js] -[test_data_protocol_registration.js] -[test_no_remote_registration.js] -[test_resolve_uris.js] diff --git a/chrome/test/unit_ipc/test_resolve_uris_ipc.js b/chrome/test/unit_ipc/test_resolve_uris_ipc.js deleted file mode 100644 index 8babc23fd..000000000 --- a/chrome/test/unit_ipc/test_resolve_uris_ipc.js +++ /dev/null @@ -1,9 +0,0 @@ -// -// Run test script in content process instead of chrome (xpcshell's default) -// - -function run_test() { - load("../unit/test_resolve_uris.js"); - do_run_test(); - run_test_in_child("../unit/test_resolve_uris.js"); -} diff --git a/chrome/test/unit_ipc/xpcshell.ini b/chrome/test/unit_ipc/xpcshell.ini deleted file mode 100644 index 1633bf995..000000000 --- a/chrome/test/unit_ipc/xpcshell.ini +++ /dev/null @@ -1,10 +0,0 @@ -[DEFAULT] -head = -tail = -skip-if = toolkit == 'android' -support-files = - !/chrome/test/unit/data/** - !/chrome/test/unit/test_resolve_uris.js - !/chrome/test/unit/head_crtestutils.js - -[test_resolve_uris_ipc.js] diff --git a/components/registry/moz.build b/components/registry/moz.build new file mode 100644 index 000000000..6ba81c3e2 --- /dev/null +++ b/components/registry/moz.build @@ -0,0 +1,34 @@ +# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +XPIDL_SOURCES += [ + 'public/nsIChromeRegistry.idl', + 'public/nsIToolkitChromeRegistry.idl', +] + +EXPORTS.mozilla.chrome += ['src/RegistryMessageUtils.h'] + +SOURCES += [ + 'src/nsChromeProtocolHandler.cpp', + 'src/nsChromeRegistry.cpp', + 'src/nsChromeRegistryChrome.cpp', + 'src/nsChromeRegistryContent.cpp', +] + +LOCAL_INCLUDES += [ + '!/xpcom', + '/dom/base', + '/netwerk/base', + '/netwerk/protocol/res', + '/xpcom/components' +] + +if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']: + CXXFLAGS += CONFIG['TK_CFLAGS'] + +XPIDL_MODULE = 'chrome' +FINAL_LIBRARY = 'xul' + +include('/ipc/chromium/chromium-config.mozbuild')
\ No newline at end of file diff --git a/chrome/nsIChromeRegistry.idl b/components/registry/public/nsIChromeRegistry.idl index 8df3a8bdf..8df3a8bdf 100644 --- a/chrome/nsIChromeRegistry.idl +++ b/components/registry/public/nsIChromeRegistry.idl diff --git a/chrome/nsIToolkitChromeRegistry.idl b/components/registry/public/nsIToolkitChromeRegistry.idl index 3a9884517..3a9884517 100644 --- a/chrome/nsIToolkitChromeRegistry.idl +++ b/components/registry/public/nsIToolkitChromeRegistry.idl diff --git a/chrome/RegistryMessageUtils.h b/components/registry/src/RegistryMessageUtils.h index a9dc81331..a9dc81331 100644 --- a/chrome/RegistryMessageUtils.h +++ b/components/registry/src/RegistryMessageUtils.h diff --git a/chrome/nsChromeProtocolHandler.cpp b/components/registry/src/nsChromeProtocolHandler.cpp index f66c6d362..f66c6d362 100644 --- a/chrome/nsChromeProtocolHandler.cpp +++ b/components/registry/src/nsChromeProtocolHandler.cpp diff --git a/chrome/nsChromeProtocolHandler.h b/components/registry/src/nsChromeProtocolHandler.h index 42c3f52be..42c3f52be 100644 --- a/chrome/nsChromeProtocolHandler.h +++ b/components/registry/src/nsChromeProtocolHandler.h diff --git a/chrome/nsChromeRegistry.cpp b/components/registry/src/nsChromeRegistry.cpp index ef2cb79ab..ef2cb79ab 100644 --- a/chrome/nsChromeRegistry.cpp +++ b/components/registry/src/nsChromeRegistry.cpp diff --git a/chrome/nsChromeRegistry.h b/components/registry/src/nsChromeRegistry.h index 27b45791f..27b45791f 100644 --- a/chrome/nsChromeRegistry.h +++ b/components/registry/src/nsChromeRegistry.h diff --git a/chrome/nsChromeRegistryChrome.cpp b/components/registry/src/nsChromeRegistryChrome.cpp index c115280fd..c115280fd 100644 --- a/chrome/nsChromeRegistryChrome.cpp +++ b/components/registry/src/nsChromeRegistryChrome.cpp diff --git a/chrome/nsChromeRegistryChrome.h b/components/registry/src/nsChromeRegistryChrome.h index 60e93274e..60e93274e 100644 --- a/chrome/nsChromeRegistryChrome.h +++ b/components/registry/src/nsChromeRegistryChrome.h diff --git a/chrome/nsChromeRegistryContent.cpp b/components/registry/src/nsChromeRegistryContent.cpp index 97e8cba48..97e8cba48 100644 --- a/chrome/nsChromeRegistryContent.cpp +++ b/components/registry/src/nsChromeRegistryContent.cpp diff --git a/chrome/nsChromeRegistryContent.h b/components/registry/src/nsChromeRegistryContent.h index 0a74d13db..0a74d13db 100644 --- a/chrome/nsChromeRegistryContent.h +++ b/components/registry/src/nsChromeRegistryContent.h diff --git a/dom/ipc/moz.build b/dom/ipc/moz.build index 7ebd02e15..bc73209f0 100644 --- a/dom/ipc/moz.build +++ b/dom/ipc/moz.build @@ -101,7 +101,7 @@ if CONFIG['MOZ_SANDBOX'] and CONFIG['OS_TARGET'] == 'Darwin': LOCAL_INCLUDES += [ '/caps', - '/chrome', + '/components/registry/src', '/docshell/base', '/dom/base', '/dom/events', diff --git a/xpcom/build/moz.build b/xpcom/build/moz.build index 48e72f623..da3828c6d 100644 --- a/xpcom/build/moz.build +++ b/xpcom/build/moz.build @@ -80,7 +80,7 @@ LOCAL_INCLUDES += [ '../io', '../reflect/xptinfo', '../threads', - '/chrome', + '/components/registry/src', '/docshell/base', ] diff --git a/xpcom/components/moz.build b/xpcom/components/moz.build index 421d514ed..d4ad128b2 100644 --- a/xpcom/components/moz.build +++ b/xpcom/components/moz.build @@ -46,7 +46,7 @@ LOCAL_INCLUDES += [ '../build', '../ds', '../reflect/xptinfo', - '/chrome', + '/components/registry/src', '/modules/libjar', ] diff --git a/xpcom/moz.build b/xpcom/moz.build index 6cb4a4a5b..f1d732180 100644 --- a/xpcom/moz.build +++ b/xpcom/moz.build @@ -21,7 +21,7 @@ DIRS += [ 'threads', 'reflect', 'system', - '../chrome', + '/components/registry', 'build', ] |