From 5f8de423f190bbb79a62f804151bc24824fa32d8 Mon Sep 17 00:00:00 2001 From: "Matt A. Tobin" Date: Fri, 2 Feb 2018 04:16:08 -0500 Subject: Add m-esr52 at 52.6.0 --- 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 | 494 +++++++++++++++++++++ .../compat/tests/test_formSubmission.html | 267 +++++++++++ dom/filesystem/compat/tests/test_no_dnd.html | 85 ++++ 6 files changed, 908 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 000000000..2b6eafb55 --- /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 000000000..3b13ba431 --- /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 000000000..8083214c9 --- /dev/null +++ b/dom/filesystem/compat/tests/script_entries.js @@ -0,0 +1,47 @@ +var { classes: Cc, interfaces: Ci, utils: Cu } = Components; +Cu.importGlobalProperties(["File", "Directory"]); + +var tmpFile, tmpDir; + +addMessageListener("entries.open", function (e) { + tmpFile = Cc["@mozilla.org/file/directory_service;1"] + .getService(Ci.nsIDirectoryService) + .QueryInterface(Ci.nsIProperties) + .get('TmpD', Ci.nsIFile) + tmpFile.append('file.txt'); + tmpFile.createUnique(Components.interfaces.nsIFile.FILE_TYPE, 0o600); + + tmpDir = Cc["@mozilla.org/file/directory_service;1"] + .getService(Ci.nsIDirectoryService) + .QueryInterface(Ci.nsIProperties) + .get('TmpD', Ci.nsIFile) + + tmpDir.append('dir-test'); + tmpDir.createUnique(Components.interfaces.nsIFile.DIRECTORY_TYPE, 0o700); + + var file1 = tmpDir.clone(); + file1.append('foo.txt'); + file1.create(Components.interfaces.nsIFile.NORMAL_FILE_TYPE, 0o600); + + var dir1 = tmpDir.clone(); + dir1.append('subdir'); + dir1.create(Components.interfaces.nsIFile.DIRECTORY_TYPE, 0o700); + + var file2 = dir1.clone(); + file2.append('bar..txt'); // Note the double .. + file2.create(Components.interfaces.nsIFile.NORMAL_FILE_TYPE, 0o600); + + var dir2 = dir1.clone(); + dir2.append('subsubdir'); + dir2.create(Components.interfaces.nsIFile.DIRECTORY_TYPE, 0o700); + + sendAsyncMessage("entries.opened", { + data: [ new Directory(tmpDir.path), File.createFromNsIFile(tmpFile) ] + }); +}); + +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 000000000..85a7418d5 --- /dev/null +++ b/dom/filesystem/compat/tests/test_basic.html @@ -0,0 +1,494 @@ + + + + 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 000000000..0c04b8bf1 --- /dev/null +++ b/dom/filesystem/compat/tests/test_formSubmission.html @@ -0,0 +1,267 @@ + + + + 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 000000000..a78ac108f --- /dev/null +++ b/dom/filesystem/compat/tests/test_no_dnd.html @@ -0,0 +1,85 @@ + + + + Test for Blink FileSystem API - no DND == no webkitEntries + + + + + + + + -- cgit v1.2.3