summaryrefslogtreecommitdiffstats
path: root/dom/fs/test/crashtests/sw1844619.js
diff options
context:
space:
mode:
Diffstat (limited to 'dom/fs/test/crashtests/sw1844619.js')
-rw-r--r--dom/fs/test/crashtests/sw1844619.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/dom/fs/test/crashtests/sw1844619.js b/dom/fs/test/crashtests/sw1844619.js
new file mode 100644
index 0000000000..dd221844f2
--- /dev/null
+++ b/dom/fs/test/crashtests/sw1844619.js
@@ -0,0 +1,21 @@
+async function timeout (cmd) {
+ const timer = new Promise((resolve, reject) => {
+ const id = setTimeout(() => {
+ clearTimeout(id)
+ reject(new Error('Promise timed out!'))
+ }, 750)
+ })
+ return Promise.race([cmd, timer])
+}
+
+(async () => {
+ const root = await navigator.storage.getDirectory()
+ const blob = new Blob(['A'])
+ const sub = await root.getDirectoryHandle('a', { 'create': true })
+ const file = await root.getFileHandle('b', { 'create': true })
+ await file.move(sub)
+ const stream = await file.createWritable({})
+ await stream.write(blob)
+ const sub2 = await root.getDirectoryHandle('a', {})
+ await sub2.move(root, 'X')
+})()