From 3ae9a492a099828dae8c9103dfdf3924876e6679 Mon Sep 17 00:00:00 2001 From: Andrea Marchesini Date: Wed, 22 Jul 2015 17:04:54 +0100 Subject: [PATCH] Bug 1185381 - Make FileList clonable - patch 4 - tests, r=smaug --- dom/base/test/iframe_cloning_fileList.html | 10 +++ dom/base/test/mochitest.ini | 2 + dom/base/test/script_cloning_fileList.js | 15 ++++ dom/base/test/test_cloning_fileList.html | 85 ++++++++++++++++++++++ 4 files changed, 112 insertions(+) create mode 100644 dom/base/test/iframe_cloning_fileList.html create mode 100644 dom/base/test/script_cloning_fileList.js create mode 100644 dom/base/test/test_cloning_fileList.html diff --git a/dom/base/test/iframe_cloning_fileList.html b/dom/base/test/iframe_cloning_fileList.html new file mode 100644 index 00000000000..68c67085d82 --- /dev/null +++ b/dom/base/test/iframe_cloning_fileList.html @@ -0,0 +1,10 @@ + + + + + + diff --git a/dom/base/test/mochitest.ini b/dom/base/test/mochitest.ini index 943d02a83d9..4f8dfffc097 100644 --- a/dom/base/test/mochitest.ini +++ b/dom/base/test/mochitest.ini @@ -800,3 +800,5 @@ skip-if = buildapp == 'mulet' || buildapp == 'b2g' [test_file_negative_date.html] [test_nonascii_blob_url.html] [test_window_element_enumeration.html] +[test_cloning_fileList.html] +support-files = script_cloning_fileList.js iframe_cloning_fileList.html diff --git a/dom/base/test/script_cloning_fileList.js b/dom/base/test/script_cloning_fileList.js new file mode 100644 index 00000000000..8c8af4289ac --- /dev/null +++ b/dom/base/test/script_cloning_fileList.js @@ -0,0 +1,15 @@ +const { classes: Cc, interfaces: Ci, utils: Cu } = Components; +Cu.importGlobalProperties(["File"]); + +let testFile = Cc["@mozilla.org/file/directory_service;1"] + .getService(Ci.nsIDirectoryService) + .QueryInterface(Ci.nsIProperties) + .get("ProfD", Ci.nsIFile); +testFile.append("prefs.js"); + +addMessageListener("file.open", function () { + sendAsyncMessage("file.opened", { + file: new File(testFile) + }); +}); + diff --git a/dom/base/test/test_cloning_fileList.html b/dom/base/test/test_cloning_fileList.html new file mode 100644 index 00000000000..613dfc6198d --- /dev/null +++ b/dom/base/test/test_cloning_fileList.html @@ -0,0 +1,85 @@ + + + + Test for cloning FileList + + + + + +

+ +

+
+
+
+ +