summaryrefslogtreecommitdiffstats
path: root/dom/downloads/tests/test_downloads_large.html
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@gmail.com>2018-05-12 14:32:03 +0200
committerwolfbeast <mcwerewolf@gmail.com>2018-05-12 14:32:03 +0200
commitb7d9dad58e5a3f87a6c767412941700bc8010044 (patch)
treef5e99b3029cf54409ae5951e9e91cca3a54addc7 /dom/downloads/tests/test_downloads_large.html
parent73cdd6117df7c17b76aad93952cf574c494351aa (diff)
downloadUXP-b7d9dad58e5a3f87a6c767412941700bc8010044.tar
UXP-b7d9dad58e5a3f87a6c767412941700bc8010044.tar.gz
UXP-b7d9dad58e5a3f87a6c767412941700bc8010044.tar.lz
UXP-b7d9dad58e5a3f87a6c767412941700bc8010044.tar.xz
UXP-b7d9dad58e5a3f87a6c767412941700bc8010044.zip
Remove MOZ_B2G leftovers and some dead B2G-only components.
Diffstat (limited to 'dom/downloads/tests/test_downloads_large.html')
-rw-r--r--dom/downloads/tests/test_downloads_large.html110
1 files changed, 0 insertions, 110 deletions
diff --git a/dom/downloads/tests/test_downloads_large.html b/dom/downloads/tests/test_downloads_large.html
deleted file mode 100644
index 9f7f73c19..000000000
--- a/dom/downloads/tests/test_downloads_large.html
+++ /dev/null
@@ -1,110 +0,0 @@
-<!DOCTYPE html>
-<html>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=938023
--->
-<head>
- <title>Test for Bug 938023 Downloads API</title>
- <script type="text/javascript" src="/MochiKit/MochiKit.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="clear_all_done_helper.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
-</head>
-<body>
-
-<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=938023">Mozilla Bug 938023</a>
-<p id="display"></p>
-<div id="content" style="display: none">
-</div>
-<a href="serve_file.sjs?contentType=application/octet-stream&size=102400" download="test.bin" id="download1">Large Download</a>
-<pre id="test">
-<script class="testbody" type="text/javascript;version=1.7">
-
-// Testing downloading a file, then checking getDownloads() and clearAllDone().
-
-SimpleTest.waitForExplicitFinish();
-
-var index = -1;
-
-function next(args) {
- index += 1;
- if (index >= steps.length) {
- ok(false, "Shouldn't get here!");
- return;
- }
- try {
- steps[index](args);
- } catch(ex) {
- ok(false, "Caught exception", ex);
- }
-}
-
-// Catch all error function.
-function error() {
- ok(false, "API failure");
- SimpleTest.finish();
-}
-
-function getDownloads(downloads) {
- ok(downloads.length == 1, "One downloads after getDownloads");
- clearAllDoneHelper(true).then(clearAllDone, error);
-}
-
-function clearAllDone(downloads) {
- ok(downloads.length == 0, "No downloads after clearAllDone");
- SimpleTest.finish();
-}
-
-function downloadChange(evt) {
- var download = evt.download;
-
- if (download.state == "succeeded") {
- ok(download.totalBytes == 102400, "Download size is 100k bytes.");
- navigator.mozDownloadManager.getDownloads().then(getDownloads, error);
- }
-}
-
-var steps = [
- // Start by setting the pref to true.
- function() {
- SpecialPowers.pushPrefEnv({
- set: [["dom.mozDownloads.enabled", true]]
- }, next);
- },
-
- // Setup permission and clear current list.
- function() {
- SpecialPowers.pushPermissions([
- {type: "downloads", allow: true, context: document}
- ], function() {
- clearAllDoneHelper(true).then(next, error);
- });
- },
-
- function(downloads) {
- ok(downloads.length == 0, "Start with an empty download list.");
- next();
- },
-
- // Setup the event listeners.
- function() {
- navigator.mozDownloadManager.ondownloadstart =
- function(evt) {
- ok(true, "Download started");
- evt.download.addEventListener("statechange", downloadChange);
- }
- next();
- },
-
- // Click on the <a download> to start the download.
- function() {
- document.getElementById("download1").click();
- }
-];
-
-next();
-
-</script>
-</pre>
-</body>
-</html>