fune/dom/indexedDB/test/test_blob_worker_crash.html
Brian Grinstead 0d460e3432 Bug 1544322 - Part 2.2 - Remove the [type] attribute for one-liner <script> tags loading files in /tests/SimpleTest/ in dom/ r=bzbarsky
This is split from the previous changeset since if we include dom/ the file size is too
large for phabricator to handle.

This is an autogenerated commit to handle scripts loading mochitest harness files, in
the simple case where the script src is on the same line as the tag.

This was generated with https://bug1544322.bmoattachments.org/attachment.cgi?id=9058170
using the `--part 2` argument.

Differential Revision: https://phabricator.services.mozilla.com/D27457

--HG--
extra : moz-landing-system : lando
2019-04-16 03:53:28 +00:00

61 lines
1.9 KiB
HTML

<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<html>
<head>
<title>Indexed Database Blob Worker Crash Test</title>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="text/javascript">
/* import-globals-from helpers.js */
/*
* This tests ensures that if the last live reference to a Blob is on the
* worker and the database has already been shutdown, that there is no crash
* when the owning page gets cleaned up which causes the termination of the
* worker which in turn garbage collects during its shutdown.
*
* We do the IndexedDB stuff in the iframe so we can kill it as part of our
* test. Doing it out here is no good.
*/
function* testSteps()
{
info("Open iframe, wait for it to do its IndexedDB stuff.");
let iframe = document.getElementById("iframe1");
window.addEventListener("message", grabEventAndContinueHandler);
// Put it in a different origin to be safe
iframe.src = // "http://example.org" +
window.location.pathname.replace(
"test_blob_worker_crash.html",
"blob_worker_crash_iframe.html");
let event = yield unexpectedSuccessHandler;
is(event.data.result, "ready", "worker initialized correctly");
info("Trigger a GC to clean-up the iframe's main-thread IndexedDB");
scheduleGC();
yield undefined;
info("Kill the iframe, forget about it, trigger a GC.");
iframe.remove();
iframe = null;
scheduleGC();
yield undefined;
info("If we are still alive, then we win!");
ok("Did not crash / trigger an assert!");
finishTest();
}
</script>
<script type="text/javascript" src="helpers.js"></script>
</head>
<body onload="runTest();"></body>
<iframe id="iframe1"></iframe>
</html>