summaryrefslogtreecommitdiffstats
path: root/toolkit/content/tests/browser/browser_saveImageURL.js
diff options
context:
space:
mode:
authorMatt A. Tobin <email@mattatobin.com>2020-02-25 15:07:00 -0500
committerwolfbeast <mcwerewolf@wolfbeast.com>2020-04-14 12:55:19 +0200
commiteb70e6e3d0bff11c25f14b1196025791bf2308fb (patch)
tree5ef4ce17db83c74d7b05ec12c8f59e095a6dd5bd /toolkit/content/tests/browser/browser_saveImageURL.js
parent32ead795290b3399d56b4708fc75b77d296f6a1a (diff)
downloadUXP-eb70e6e3d0bff11c25f14b1196025791bf2308fb.tar
UXP-eb70e6e3d0bff11c25f14b1196025791bf2308fb.tar.gz
UXP-eb70e6e3d0bff11c25f14b1196025791bf2308fb.tar.lz
UXP-eb70e6e3d0bff11c25f14b1196025791bf2308fb.tar.xz
UXP-eb70e6e3d0bff11c25f14b1196025791bf2308fb.zip
Issue #439 - Remove tests from toolkit/
Diffstat (limited to 'toolkit/content/tests/browser/browser_saveImageURL.js')
-rw-r--r--toolkit/content/tests/browser/browser_saveImageURL.js68
1 files changed, 0 insertions, 68 deletions
diff --git a/toolkit/content/tests/browser/browser_saveImageURL.js b/toolkit/content/tests/browser/browser_saveImageURL.js
deleted file mode 100644
index 75e1cfdcd..000000000
--- a/toolkit/content/tests/browser/browser_saveImageURL.js
+++ /dev/null
@@ -1,68 +0,0 @@
-"use strict";
-
-const IMAGE_PAGE = "https://example.com/browser/toolkit/content/tests/browser/image_page.html";
-const PREF_UNSAFE_FORBIDDEN = "dom.ipc.cpows.forbid-unsafe-from-browser";
-
-MockFilePicker.init(window);
-MockFilePicker.returnValue = MockFilePicker.returnCancel;
-
-registerCleanupFunction(function() {
- MockFilePicker.cleanup();
-});
-
-function waitForFilePicker() {
- return new Promise((resolve) => {
- MockFilePicker.showCallback = () => {
- MockFilePicker.showCallback = null;
- ok(true, "Saw the file picker");
- resolve();
- }
- })
-}
-
-/**
- * Test that saveImageURL works when we pass in the aIsContentWindowPrivate
- * argument instead of a document. This is the preferred API.
- */
-add_task(function* preferred_API() {
- yield BrowserTestUtils.withNewTab({
- gBrowser,
- url: IMAGE_PAGE,
- }, function*(browser) {
- let url = yield ContentTask.spawn(browser, null, function*() {
- let image = content.document.getElementById("image");
- return image.href;
- });
-
- saveImageURL(url, "image.jpg", null, true, false, null, null, null, null, false);
- yield waitForFilePicker();
- });
-});
-
-/**
- * Test that saveImageURL will still work when passed a document instead
- * of the aIsContentWindowPrivate argument. This is the deprecated API, and
- * will not work in apps using remote browsers having PREF_UNSAFE_FORBIDDEN
- * set to true.
- */
-add_task(function* deprecated_API() {
- yield BrowserTestUtils.withNewTab({
- gBrowser,
- url: IMAGE_PAGE,
- }, function*(browser) {
- yield pushPrefs([PREF_UNSAFE_FORBIDDEN, false]);
-
- let url = yield ContentTask.spawn(browser, null, function*() {
- let image = content.document.getElementById("image");
- return image.href;
- });
-
- // Now get the document directly from content. If we run this test with
- // e10s-enabled, this will be a CPOW, which is forbidden. We'll just
- // pass the XUL document instead to test this interface.
- let doc = document;
-
- saveImageURL(url, "image.jpg", null, true, false, null, doc, null, null);
- yield waitForFilePicker();
- });
-});