summaryrefslogtreecommitdiffstats
path: root/toolkit/components/thumbnails/test/browser_thumbnails_bg_no_alert.js
diff options
context:
space:
mode:
Diffstat (limited to 'toolkit/components/thumbnails/test/browser_thumbnails_bg_no_alert.js')
-rw-r--r--toolkit/components/thumbnails/test/browser_thumbnails_bg_no_alert.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/toolkit/components/thumbnails/test/browser_thumbnails_bg_no_alert.js b/toolkit/components/thumbnails/test/browser_thumbnails_bg_no_alert.js
new file mode 100644
index 0000000000..e0dc7f353c
--- /dev/null
+++ b/toolkit/components/thumbnails/test/browser_thumbnails_bg_no_alert.js
@@ -0,0 +1,16 @@
+/* Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/publicdomain/zero/1.0/ */
+
+add_task(async function thumbnails_bg_no_alert() {
+ let url =
+ "data:text/html,<script>try { alert('yo!'); } catch (e) {}</script>";
+ ok(!thumbnailExists(url), "Thumbnail file should not already exist.");
+
+ let [capturedURL] = await bgCapture(url);
+ is(capturedURL, url, "Captured URL should be URL passed to capture.");
+ ok(
+ thumbnailExists(url),
+ "Thumbnail file should exist even though it alerted."
+ );
+ removeThumbnail(url);
+});