summaryrefslogtreecommitdiffstats
path: root/dom/base/test/browser_bug1307747.js
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /dom/base/test/browser_bug1307747.js
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloadUXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip
Add m-esr52 at 52.6.0
Diffstat (limited to 'dom/base/test/browser_bug1307747.js')
-rw-r--r--dom/base/test/browser_bug1307747.js32
1 files changed, 32 insertions, 0 deletions
diff --git a/dom/base/test/browser_bug1307747.js b/dom/base/test/browser_bug1307747.js
new file mode 100644
index 000000000..8d1448cc2
--- /dev/null
+++ b/dom/base/test/browser_bug1307747.js
@@ -0,0 +1,32 @@
+/* -*- Mode: javascript; tab-width: 2; indent-tabs-mode: nil; js-indent-level: 2 -*- */
+
+var {Promise: promise} = Cu.import("resource://gre/modules/Promise.jsm", {});
+
+const BASE_URI = "http://mochi.test:8888/browser/dom/base/test/empty.html";
+
+add_task(function* test_initialize() {
+ let tab = yield BrowserTestUtils.openNewForegroundTab(gBrowser, BASE_URI);
+ let browser = gBrowser.getBrowserForTab(tab);
+
+ let blob = yield ContentTask.spawn(browser, null, function() {
+ let blob = new Blob([new Array(1024*1024).join('123456789ABCDEF')]);
+ return blob;
+ });
+
+ ok(blob, "We have a blob!");
+ is(blob.size, new Array(1024*1024).join('123456789ABCDEF').length, "The size matches");
+
+ let status = yield ContentTask.spawn(browser, blob, function(blob) {
+ return new Promise(resolve => {
+ let fr = new content.FileReader();
+ fr.readAsText(blob);
+ fr.onloadend = function() {
+ resolve(fr.result == new Array(1024*1024).join('123456789ABCDEF'));
+ }
+ });
+ });
+
+ ok(status, "Data match!");
+
+ yield BrowserTestUtils.removeTab(tab);
+});