2011-01-28 00:47:36 +03:00
|
|
|
<!--
|
|
|
|
Any copyright is dedicated to the Public Domain.
|
|
|
|
http://creativecommons.org/publicdomain/zero/1.0/
|
|
|
|
-->
|
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<title>Indexed Database Leaving Page Test</title>
|
|
|
|
|
|
|
|
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
|
|
|
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
|
|
|
</head>
|
|
|
|
|
|
|
|
<body onload="runTest();">
|
|
|
|
<iframe id="inner"></iframe>
|
|
|
|
<a id="a" href="leaving_page_iframe.html"></a>
|
|
|
|
|
|
|
|
<script type="text/javascript;version=1.7">
|
2012-06-01 21:21:12 +04:00
|
|
|
if (!SpecialPowers.isMainProcess()) {
|
|
|
|
window.runTest = function() {
|
|
|
|
todo(false, "Figure out this test for child processes!");
|
|
|
|
finishTest();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-01-28 00:47:36 +03:00
|
|
|
onmessage = function(e) {
|
|
|
|
ok(false, "gotmessage: " + e.data);
|
|
|
|
}
|
2012-06-01 21:21:12 +04:00
|
|
|
|
2011-01-28 00:47:36 +03:00
|
|
|
function testSteps()
|
|
|
|
{
|
|
|
|
var iframe = $("inner");
|
|
|
|
iframe.src = "leaving_page_iframe.html";
|
|
|
|
iframe.onload = continueToNextStep;
|
2013-07-11 01:52:35 +04:00
|
|
|
yield undefined;
|
2011-01-28 00:47:36 +03:00
|
|
|
is(iframe.contentWindow.location.href, $("a").href,
|
|
|
|
"should navigate to iframe page");
|
2013-07-11 01:52:35 +04:00
|
|
|
yield undefined;
|
2011-01-28 00:47:36 +03:00
|
|
|
is(iframe.contentWindow.location.href, "about:blank",
|
|
|
|
"should nagivate to about:blank");
|
|
|
|
|
2012-06-29 20:48:35 +04:00
|
|
|
let request = indexedDB.open(location, 1);
|
2011-01-28 00:47:36 +03:00
|
|
|
request.onsuccess = grabEventAndContinueHandler;
|
2013-07-11 01:52:35 +04:00
|
|
|
let event = yield undefined;
|
2011-01-28 00:47:36 +03:00
|
|
|
|
|
|
|
let db = event.target.result;
|
|
|
|
db.transaction(["mystore"]).objectStore("mystore").get(42).onsuccess =
|
|
|
|
grabEventAndContinueHandler;
|
2013-07-11 01:52:35 +04:00
|
|
|
event = yield undefined;
|
2011-01-28 00:47:36 +03:00
|
|
|
is(event.target.result.hello, "world", "second modification rolled back");
|
|
|
|
|
|
|
|
finishTest();
|
2013-07-11 01:52:35 +04:00
|
|
|
yield undefined;
|
2011-01-28 00:47:36 +03:00
|
|
|
}
|
|
|
|
</script>
|
|
|
|
<script type="text/javascript;version=1.7" src="helpers.js"></script>
|
|
|
|
</html>
|