summaryrefslogtreecommitdiffstats
path: root/toolkit/components/urlformatter
diff options
context:
space:
mode:
authorMatt A. Tobin <email@mattatobin.com>2020-02-25 15:07:00 -0500
committerMatt A. Tobin <email@mattatobin.com>2020-02-25 15:07:00 -0500
commit0ddd00f1959c78ce37c14fef3c83401408fca3bf (patch)
treed408e02767c86cf8aac3acbb86722b03c77ede6f /toolkit/components/urlformatter
parent20f0905b33cbb18d1caa80c55e2f552c2e18957b (diff)
downloadUXP-0ddd00f1959c78ce37c14fef3c83401408fca3bf.tar
UXP-0ddd00f1959c78ce37c14fef3c83401408fca3bf.tar.gz
UXP-0ddd00f1959c78ce37c14fef3c83401408fca3bf.tar.lz
UXP-0ddd00f1959c78ce37c14fef3c83401408fca3bf.tar.xz
UXP-0ddd00f1959c78ce37c14fef3c83401408fca3bf.zip
Issue #439 - Remove tests from toolkit/
Diffstat (limited to 'toolkit/components/urlformatter')
-rw-r--r--toolkit/components/urlformatter/moz.build18
-rw-r--r--toolkit/components/urlformatter/tests/unit/.eslintrc.js7
-rw-r--r--toolkit/components/urlformatter/tests/unit/head_urlformatter.js16
-rw-r--r--toolkit/components/urlformatter/tests/unit/test_urlformatter.js63
-rw-r--r--toolkit/components/urlformatter/tests/unit/xpcshell.ini6
5 files changed, 4 insertions, 106 deletions
diff --git a/toolkit/components/urlformatter/moz.build b/toolkit/components/urlformatter/moz.build
index 1543fddda..c7a3ac76e 100644
--- a/toolkit/components/urlformatter/moz.build
+++ b/toolkit/components/urlformatter/moz.build
@@ -4,24 +4,14 @@
# 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 += ['tests/unit/xpcshell.ini']
-
-XPIDL_SOURCES += [
- 'nsIURLFormatter.idl',
-]
+XPIDL_SOURCES += ['nsIURLFormatter.idl']
XPIDL_MODULE = 'urlformatter'
-EXTRA_COMPONENTS += [
- 'nsURLFormatter.manifest',
-]
+EXTRA_COMPONENTS += ['nsURLFormatter.manifest']
-EXTRA_PP_COMPONENTS += [
- 'nsURLFormatter.js',
-]
+EXTRA_PP_COMPONENTS += ['nsURLFormatter.js']
-CONFIGURE_SUBST_FILES += [
- 'api_keys',
-]
+CONFIGURE_SUBST_FILES += ['api_keys']
DEFINES['OBJDIR'] = OBJDIR
diff --git a/toolkit/components/urlformatter/tests/unit/.eslintrc.js b/toolkit/components/urlformatter/tests/unit/.eslintrc.js
deleted file mode 100644
index d35787cd2..000000000
--- a/toolkit/components/urlformatter/tests/unit/.eslintrc.js
+++ /dev/null
@@ -1,7 +0,0 @@
-"use strict";
-
-module.exports = {
- "extends": [
- "../../../../../testing/xpcshell/xpcshell.eslintrc.js"
- ]
-};
diff --git a/toolkit/components/urlformatter/tests/unit/head_urlformatter.js b/toolkit/components/urlformatter/tests/unit/head_urlformatter.js
deleted file mode 100644
index 8af2aaac4..000000000
--- a/toolkit/components/urlformatter/tests/unit/head_urlformatter.js
+++ /dev/null
@@ -1,16 +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 Cc = Components.classes;
-var Ci = Components.interfaces;
-var Cr = Components.results;
-var Cu = Components.utils;
-
-Cu.import("resource://testing-common/AppInfo.jsm", this);
-updateAppInfo({
- name: "Url Formatter Test",
- ID: "urlformattertest@test.mozilla.org",
- version: "1",
- platformVersion: "2.0",
-});
-var gAppInfo = getAppInfo();
diff --git a/toolkit/components/urlformatter/tests/unit/test_urlformatter.js b/toolkit/components/urlformatter/tests/unit/test_urlformatter.js
deleted file mode 100644
index 6f218822a..000000000
--- a/toolkit/components/urlformatter/tests/unit/test_urlformatter.js
+++ /dev/null
@@ -1,63 +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/. */
-function run_test() {
- var formatter = Cc["@mozilla.org/toolkit/URLFormatterService;1"].
- getService(Ci.nsIURLFormatter);
- var locale = Cc["@mozilla.org/chrome/chrome-registry;1"].
- getService(Ci.nsIXULChromeRegistry).
- getSelectedLocale('global');
- var prefs = Cc['@mozilla.org/preferences-service;1'].
- getService(Ci.nsIPrefBranch);
- var sysInfo = Cc["@mozilla.org/system-info;1"].
- getService(Ci.nsIPropertyBag2);
- var OSVersion = sysInfo.getProperty("name") + " " +
- sysInfo.getProperty("version");
- try {
- OSVersion += " (" + sysInfo.getProperty("secondaryLibrary") + ")";
- } catch (e) {}
- OSVersion = encodeURIComponent(OSVersion);
- var macutils = null;
- try {
- macutils = Cc["@mozilla.org/xpcom/mac-utils;1"].
- getService(Ci.nsIMacUtils);
- } catch (e) {}
- var appInfo = Cc["@mozilla.org/xre/app-info;1"].
- getService(Ci.nsIXULAppInfo).
- QueryInterface(Ci.nsIXULRuntime);
- var abi = macutils && macutils.isUniversalBinary ? "Universal-gcc3" : appInfo.XPCOMABI;
-
- let defaults = prefs.QueryInterface(Ci.nsIPrefService).getDefaultBranch(null);
- let channel = defaults.getCharPref("app.update.channel", "default");
-
- // Set distribution values.
- defaults.setCharPref("distribution.id", "bacon");
- defaults.setCharPref("distribution.version", "1.0");
-
- var upperUrlRaw = "http://%LOCALE%.%VENDOR%.foo/?name=%NAME%&id=%ID%&version=%VERSION%&platversion=%PLATFORMVERSION%&abid=%APPBUILDID%&pbid=%PLATFORMBUILDID%&app=%APP%&os=%OS%&abi=%XPCOMABI%";
- var lowerUrlRaw = "http://%locale%.%vendor%.foo/?name=%name%&id=%id%&version=%version%&platversion=%platformversion%&abid=%appbuildid%&pbid=%platformbuildid%&app=%app%&os=%os%&abi=%xpcomabi%";
- // XXX %APP%'s RegExp is not global, so it only replaces the first space
- var ulUrlRef = "http://" + locale + ".Mozilla.foo/?name=Url Formatter Test&id=urlformattertest@test.mozilla.org&version=1&platversion=2.0&abid=" + gAppInfo.appBuildID + "&pbid=" + gAppInfo.platformBuildID + "&app=urlformatter test&os=XPCShell&abi=" + abi;
- var multiUrl = "http://%VENDOR%.%VENDOR%.%NAME%.%VENDOR%.%NAME%";
- var multiUrlRef = "http://Mozilla.Mozilla.Url Formatter Test.Mozilla.Url Formatter Test";
- var encodedUrl = "https://%LOCALE%.%VENDOR%.foo/?q=%E3%82%BF%E3%83%96&app=%NAME%&ver=%PLATFORMVERSION%";
- var encodedUrlRef = "https://" + locale + ".Mozilla.foo/?q=%E3%82%BF%E3%83%96&app=Url Formatter Test&ver=2.0";
- var advancedUrl = "http://test.mozilla.com/%NAME%/%VERSION%/%APPBUILDID%/%BUILD_TARGET%/%LOCALE%/%CHANNEL%/%OS_VERSION%/%DISTRIBUTION%/%DISTRIBUTION_VERSION%/";
- var advancedUrlRef = "http://test.mozilla.com/Url Formatter Test/1/" + gAppInfo.appBuildID + "/XPCShell_" + abi + "/" + locale + "/" + channel + "/" + OSVersion + "/bacon/1.0/";
-
- var pref = "xpcshell.urlformatter.test";
- var str = Cc["@mozilla.org/supports-string;1"].
- createInstance(Ci.nsISupportsString);
- str.data = upperUrlRaw;
- prefs.setComplexValue(pref, Ci.nsISupportsString, str);
-
- do_check_eq(formatter.formatURL(upperUrlRaw), ulUrlRef);
- do_check_eq(formatter.formatURLPref(pref), ulUrlRef);
- // Keys must be uppercase
- do_check_neq(formatter.formatURL(lowerUrlRaw), ulUrlRef);
- do_check_eq(formatter.formatURL(multiUrl), multiUrlRef);
- // Encoded strings must be kept as is (Bug 427304)
- do_check_eq(formatter.formatURL(encodedUrl), encodedUrlRef);
-
- do_check_eq(formatter.formatURL(advancedUrl), advancedUrlRef);
-}
diff --git a/toolkit/components/urlformatter/tests/unit/xpcshell.ini b/toolkit/components/urlformatter/tests/unit/xpcshell.ini
deleted file mode 100644
index 2f82beaa3..000000000
--- a/toolkit/components/urlformatter/tests/unit/xpcshell.ini
+++ /dev/null
@@ -1,6 +0,0 @@
-[DEFAULT]
-head = head_urlformatter.js
-tail =
-skip-if = toolkit == 'android'
-
-[test_urlformatter.js]