dom/indexedDB/test/test_blob_worker_crash.html

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

michael@0 1 <!--
michael@0 2 Any copyright is dedicated to the Public Domain.
michael@0 3 http://creativecommons.org/publicdomain/zero/1.0/
michael@0 4 -->
michael@0 5 <html>
michael@0 6 <head>
michael@0 7 <title>Indexed Database Blob Worker Crash Test</title>
michael@0 8
michael@0 9 <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
michael@0 10 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
michael@0 11
michael@0 12 <script type="text/javascript;version=1.7">
michael@0 13 /*
michael@0 14 * This tests ensures that if the last live reference to a Blob is on the
michael@0 15 * worker and the database has already been shutdown, that there is no crash
michael@0 16 * when the owning page gets cleaned up which causes the termination of the
michael@0 17 * worker which in turn garbage collects during its shutdown.
michael@0 18 *
michael@0 19 * We do the IndexedDB stuff in the iframe so we can kill it as part of our
michael@0 20 * test. Doing it out here is no good.
michael@0 21 */
michael@0 22
michael@0 23 function testSteps()
michael@0 24 {
michael@0 25 info("Open iframe, wait for it to do its IndexedDB stuff.");
michael@0 26
michael@0 27 let iframe = document.getElementById("iframe1");
michael@0 28 window.addEventListener("message", grabEventAndContinueHandler, false);
michael@0 29 // Put it in a different origin to be safe
michael@0 30 //allowUnlimitedQuota("http://example.org/");
michael@0 31 iframe.src = //"http://example.org" +
michael@0 32 window.location.pathname.replace(
michael@0 33 "test_blob_worker_crash.html",
michael@0 34 "blob_worker_crash_iframe.html");
michael@0 35
michael@0 36 let event = yield unexpectedSuccessHandler;
michael@0 37 is(event.data.result, "ready", "worker initialized correctly");
michael@0 38
michael@0 39 info("Trigger a GC to clean-up the iframe's main-thread IndexedDB");
michael@0 40 scheduleGC();
michael@0 41 yield undefined;
michael@0 42
michael@0 43 info("Kill the iframe, forget about it, trigger a GC.");
michael@0 44 iframe.parentNode.removeChild(iframe);
michael@0 45 iframe = null;
michael@0 46 scheduleGC();
michael@0 47 yield undefined;
michael@0 48
michael@0 49 info("If we are still alive, then we win!");
michael@0 50 ok('Did not crash / trigger an assert!');
michael@0 51
michael@0 52 finishTest();
michael@0 53 yield undefined;
michael@0 54 }
michael@0 55 </script>
michael@0 56 <script type="text/javascript;version=1.7" src="helpers.js"></script>
michael@0 57
michael@0 58 </head>
michael@0 59
michael@0 60 <body onload="runTest();"></body>
michael@0 61 <iframe id="iframe1"></iframe>
michael@0 62 </html>

mercurial