From eb70e6e3d0bff11c25f14b1196025791bf2308fb Mon Sep 17 00:00:00 2001 From: "Matt A. Tobin" Date: Tue, 25 Feb 2020 15:07:00 -0500 Subject: Issue #439 - Remove tests from toolkit/ --- toolkit/components/alerts/moz.build | 9 +- toolkit/components/alerts/test/.eslintrc.js | 7 - toolkit/components/alerts/test/image.gif | Bin 60901 -> 0 bytes toolkit/components/alerts/test/image.png | Bin 2531 -> 0 bytes toolkit/components/alerts/test/image_server.sjs | 82 ---------- toolkit/components/alerts/test/mochitest.ini | 16 -- toolkit/components/alerts/test/test_alerts.html | 89 ----------- .../alerts/test/test_alerts_noobserve.html | 96 ------------ .../test/test_alerts_requireinteraction.html | 168 --------------------- toolkit/components/alerts/test/test_image.html | 118 --------------- .../alerts/test/test_multiple_alerts.html | 103 ------------- toolkit/components/alerts/test/test_principal.html | 122 --------------- 12 files changed, 1 insertion(+), 809 deletions(-) delete mode 100644 toolkit/components/alerts/test/.eslintrc.js delete mode 100644 toolkit/components/alerts/test/image.gif delete mode 100644 toolkit/components/alerts/test/image.png delete mode 100644 toolkit/components/alerts/test/image_server.sjs delete mode 100644 toolkit/components/alerts/test/mochitest.ini delete mode 100644 toolkit/components/alerts/test/test_alerts.html delete mode 100644 toolkit/components/alerts/test/test_alerts_noobserve.html delete mode 100644 toolkit/components/alerts/test/test_alerts_requireinteraction.html delete mode 100644 toolkit/components/alerts/test/test_image.html delete mode 100644 toolkit/components/alerts/test/test_multiple_alerts.html delete mode 100644 toolkit/components/alerts/test/test_principal.html (limited to 'toolkit/components/alerts') diff --git a/toolkit/components/alerts/moz.build b/toolkit/components/alerts/moz.build index cdbf92511..8d42a8ce7 100644 --- a/toolkit/components/alerts/moz.build +++ b/toolkit/components/alerts/moz.build @@ -4,17 +4,13 @@ # 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/. -MOCHITEST_MANIFESTS += ['test/mochitest.ini'] - XPIDL_SOURCES += [ 'nsIAlertsService.idl', ] XPIDL_MODULE = 'alerts' -EXPORTS += [ - 'nsAlertsUtils.h', -] +EXPORTS += ['nsAlertsUtils.h'] EXPORTS.mozilla += [ 'AlertNotification.h', @@ -33,6 +29,3 @@ include('/ipc/chromium/chromium-config.mozbuild') FINAL_LIBRARY = 'xul' JAR_MANIFESTS += ['jar.mn'] - -with Files('**'): - BUG_COMPONENT = ('Toolkit', 'Notifications and Alerts') diff --git a/toolkit/components/alerts/test/.eslintrc.js b/toolkit/components/alerts/test/.eslintrc.js deleted file mode 100644 index 3c788d6d6..000000000 --- a/toolkit/components/alerts/test/.eslintrc.js +++ /dev/null @@ -1,7 +0,0 @@ -"use strict"; - -module.exports = { - "extends": [ - "../../../../testing/mochitest/mochitest.eslintrc.js" - ] -}; diff --git a/toolkit/components/alerts/test/image.gif b/toolkit/components/alerts/test/image.gif deleted file mode 100644 index 053b4d926..000000000 Binary files a/toolkit/components/alerts/test/image.gif and /dev/null differ diff --git a/toolkit/components/alerts/test/image.png b/toolkit/components/alerts/test/image.png deleted file mode 100644 index 430c3c5e6..000000000 Binary files a/toolkit/components/alerts/test/image.png and /dev/null differ diff --git a/toolkit/components/alerts/test/image_server.sjs b/toolkit/components/alerts/test/image_server.sjs deleted file mode 100644 index 622052943..000000000 --- a/toolkit/components/alerts/test/image_server.sjs +++ /dev/null @@ -1,82 +0,0 @@ -const { classes: Cc, interfaces: Ci, utils: Cu, results: Cr, Constructor: CC } = Components; - -Cu.import("resource://gre/modules/Timer.jsm"); - -const LocalFile = CC("@mozilla.org/file/local;1", "nsILocalFile", - "initWithPath"); - -const FileInputStream = CC("@mozilla.org/network/file-input-stream;1", - "nsIFileInputStream", "init"); - -const BinaryInputStream = CC("@mozilla.org/binaryinputstream;1", - "nsIBinaryInputStream", "setInputStream"); - -function handleRequest(request, response) { - let params = parseQueryString(request.queryString); - - response.setStatusLine(request.httpVersion, 200, "OK"); - - // Compare and increment a cookie for this request. This is used to test - // private browsing mode; the cookie should not be set if the image is - // loaded anonymously. - if (params.has("c")) { - let expectedValue = parseInt(params.get("c"), 10); - let actualValue = !request.hasHeader("Cookie") ? 0 : - parseInt(request.getHeader("Cookie") - .replace(/^counter=(\d+)/, "$1"), 10); - if (actualValue != expectedValue) { - response.setStatusLine(request.httpVersion, 400, "Wrong counter value"); - return; - } - response.setHeader("Set-Cookie", `counter=${expectedValue + 1}`, false); - } - - // Wait to send the image if a timeout is given. - let timeout = parseInt(params.get("t"), 10); - if (timeout > 0) { - response.processAsync(); - setTimeout(() => { - respond(params, request, response); - response.finish(); - }, timeout * 1000); - return; - } - - respond(params, request, response); -} - -function parseQueryString(queryString) { - return queryString.split("&").reduce((params, param) => { - let [key, value] = param.split("=", 2); - params.set(key, value); - return params; - }, new Map()); -} - -function respond(params, request, response) { - if (params.has("s")) { - let statusCode = parseInt(params.get("s"), 10); - response.setStatusLine(request.httpVersion, statusCode, "Custom status"); - return; - } - var filename = params.get("f"); - writeFile(filename, response); -} - -function writeFile(name, response) { - var file = new LocalFile(getState("__LOCATION__")).parent; - file.append(name); - - let mimeType = Cc["@mozilla.org/uriloader/external-helper-app-service;1"] - .getService(Ci.nsIMIMEService) - .getTypeFromFile(file); - - let fileStream = new FileInputStream(file, 1, 0, false); - let binaryStream = new BinaryInputStream(fileStream); - - response.setHeader("Content-Type", mimeType, false); - response.bodyOutputStream.writeFrom(binaryStream, binaryStream.available()); - - binaryStream.close(); - fileStream.close(); -} diff --git a/toolkit/components/alerts/test/mochitest.ini b/toolkit/components/alerts/test/mochitest.ini deleted file mode 100644 index 12e2a8704..000000000 --- a/toolkit/components/alerts/test/mochitest.ini +++ /dev/null @@ -1,16 +0,0 @@ -[DEFAULT] -support-files = - image.gif - image.png - image_server.sjs - -# Synchronous tests like test_alerts.html must come before -# asynchronous tests like test_alerts_noobserve.html! -[test_alerts.html] -skip-if = toolkit == 'android' -[test_alerts_noobserve.html] -[test_alerts_requireinteraction.html] -[test_image.html] -[test_multiple_alerts.html] -[test_principal.html] -skip-if = toolkit == 'android' diff --git a/toolkit/components/alerts/test/test_alerts.html b/toolkit/components/alerts/test/test_alerts.html deleted file mode 100644 index cb087e48a..000000000 --- a/toolkit/components/alerts/test/test_alerts.html +++ /dev/null @@ -1,89 +0,0 @@ - - - - - Test for Alerts Service - - - - - -

- -
Alerts service, with observer "synchronous" case. -
-
Did a notification appear anywhere? -
If so, the test will finish once the notification disappears. - -
-
-
- - diff --git a/toolkit/components/alerts/test/test_alerts_noobserve.html b/toolkit/components/alerts/test/test_alerts_noobserve.html deleted file mode 100644 index 0cc452b8a..000000000 --- a/toolkit/components/alerts/test/test_alerts_noobserve.html +++ /dev/null @@ -1,96 +0,0 @@ - - - - - Test for Alerts Service - - - - - -

- -
Alerts service, without observer "asynchronous" case. -
-
A notification should soon appear somewhere. -
If there has been no crash when the notification (later) disappears, assume all is good. - -
-
-
- - diff --git a/toolkit/components/alerts/test/test_alerts_requireinteraction.html b/toolkit/components/alerts/test/test_alerts_requireinteraction.html deleted file mode 100644 index 26fe87104..000000000 --- a/toolkit/components/alerts/test/test_alerts_requireinteraction.html +++ /dev/null @@ -1,168 +0,0 @@ - - - - Test for alerts with requireInteraction - - - - - -
-
-
- - diff --git a/toolkit/components/alerts/test/test_image.html b/toolkit/components/alerts/test/test_image.html deleted file mode 100644 index 7bf89fab2..000000000 --- a/toolkit/components/alerts/test/test_image.html +++ /dev/null @@ -1,118 +0,0 @@ - - - - Test for Bug 1233086 - - - - - - -

- -
-
-
- - diff --git a/toolkit/components/alerts/test/test_multiple_alerts.html b/toolkit/components/alerts/test/test_multiple_alerts.html deleted file mode 100644 index 9d939b63a..000000000 --- a/toolkit/components/alerts/test/test_multiple_alerts.html +++ /dev/null @@ -1,103 +0,0 @@ - - - - Test for multiple alerts - - - - - -
-
-
- - diff --git a/toolkit/components/alerts/test/test_principal.html b/toolkit/components/alerts/test/test_principal.html deleted file mode 100644 index 74a20dbd7..000000000 --- a/toolkit/components/alerts/test/test_principal.html +++ /dev/null @@ -1,122 +0,0 @@ - - - - Test for Bug 1202933 - - - - - - -

- -
-
-
- - -- cgit v1.2.3