From 43a97878ce14b72f0981164f87f2e35e14151312 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 11:22:09 +0200 Subject: Adding upstream version 110.0.1. Signed-off-by: Daniel Baumann --- dom/filesystem/compat/tests/mochitest.ini | 8 + dom/filesystem/compat/tests/moz.build | 7 + dom/filesystem/compat/tests/script_entries.js | 47 ++ dom/filesystem/compat/tests/test_basic.html | 549 +++++++++++++++++++++ .../compat/tests/test_formSubmission.html | 271 ++++++++++ dom/filesystem/compat/tests/test_no_dnd.html | 84 ++++ 6 files changed, 966 insertions(+) create mode 100644 dom/filesystem/compat/tests/mochitest.ini create mode 100644 dom/filesystem/compat/tests/moz.build create mode 100644 dom/filesystem/compat/tests/script_entries.js create mode 100644 dom/filesystem/compat/tests/test_basic.html create mode 100644 dom/filesystem/compat/tests/test_formSubmission.html create mode 100644 dom/filesystem/compat/tests/test_no_dnd.html (limited to 'dom/filesystem/compat/tests') diff --git a/dom/filesystem/compat/tests/mochitest.ini b/dom/filesystem/compat/tests/mochitest.ini new file mode 100644 index 0000000000..2b6eafb550 --- /dev/null +++ b/dom/filesystem/compat/tests/mochitest.ini @@ -0,0 +1,8 @@ +[DEFAULT] +support-files = + script_entries.js + !/dom/html/test/form_submit_server.sjs + +[test_basic.html] +[test_no_dnd.html] +[test_formSubmission.html] diff --git a/dom/filesystem/compat/tests/moz.build b/dom/filesystem/compat/tests/moz.build new file mode 100644 index 0000000000..7c990fbc62 --- /dev/null +++ b/dom/filesystem/compat/tests/moz.build @@ -0,0 +1,7 @@ +# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- +# vim: set filetype=python: +# 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/. + +MOCHITEST_MANIFESTS += ["mochitest.ini"] diff --git a/dom/filesystem/compat/tests/script_entries.js b/dom/filesystem/compat/tests/script_entries.js new file mode 100644 index 0000000000..4b18a901ed --- /dev/null +++ b/dom/filesystem/compat/tests/script_entries.js @@ -0,0 +1,47 @@ +/* eslint-env mozilla/chrome-script */ +// eslint-disable-next-line mozilla/reject-importGlobalProperties +Cu.importGlobalProperties(["File", "Directory"]); +var tmpFile, tmpDir; + +addMessageListener("entries.open", function(e) { + tmpFile = Services.dirsvc + .QueryInterface(Ci.nsIProperties) + .get("TmpD", Ci.nsIFile); + tmpFile.append("file.txt"); + tmpFile.createUnique(Ci.nsIFile.NORMAL_FILE_TYPE, 0o600); + + tmpDir = Services.dirsvc + .QueryInterface(Ci.nsIProperties) + .get("TmpD", Ci.nsIFile); + + tmpDir.append("dir-test"); + tmpDir.createUnique(Ci.nsIFile.DIRECTORY_TYPE, 0o700); + + var file1 = tmpDir.clone(); + file1.append("foo.txt"); + file1.create(Ci.nsIFile.NORMAL_FILE_TYPE, 0o600); + + var dir1 = tmpDir.clone(); + dir1.append("subdir"); + dir1.create(Ci.nsIFile.DIRECTORY_TYPE, 0o700); + + var file2 = dir1.clone(); + file2.append("bar..txt"); // Note the double .. + file2.create(Ci.nsIFile.NORMAL_FILE_TYPE, 0o600); + + var dir2 = dir1.clone(); + dir2.append("subsubdir"); + dir2.create(Ci.nsIFile.DIRECTORY_TYPE, 0o700); + + File.createFromNsIFile(tmpFile).then(function(file) { + sendAsyncMessage("entries.opened", { + data: [new Directory(tmpDir.path), file], + }); + }); +}); + +addMessageListener("entries.delete", function(e) { + tmpFile.remove(true); + tmpDir.remove(true); + sendAsyncMessage("entries.deleted"); +}); diff --git a/dom/filesystem/compat/tests/test_basic.html b/dom/filesystem/compat/tests/test_basic.html new file mode 100644 index 0000000000..4ad0c37d67 --- /dev/null +++ b/dom/filesystem/compat/tests/test_basic.html @@ -0,0 +1,549 @@ + + + + Test for Blink FileSystem API - subset + + + + + + + + + diff --git a/dom/filesystem/compat/tests/test_formSubmission.html b/dom/filesystem/compat/tests/test_formSubmission.html new file mode 100644 index 0000000000..2447e7a071 --- /dev/null +++ b/dom/filesystem/compat/tests/test_formSubmission.html @@ -0,0 +1,271 @@ + + + + Test for Directory form submission + + + + + + + + +
+
+ + + + diff --git a/dom/filesystem/compat/tests/test_no_dnd.html b/dom/filesystem/compat/tests/test_no_dnd.html new file mode 100644 index 0000000000..c49dd5d40f --- /dev/null +++ b/dom/filesystem/compat/tests/test_no_dnd.html @@ -0,0 +1,84 @@ + + + + Test for Blink FileSystem API - no DND == no webkitEntries + + + + + + + + -- cgit v1.2.3