Bug 1816170 - Disable perftest-on-autoland cron. r=aglavic
[gecko.git] / dom / indexedDB / test / leaving_page_iframe.html
blob4ed299df33104357206f4aac0eec0f759e3043ff
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script>
5 var db;
6 function startDBWork() {
7 indexedDB.open(parent.location, 1).onupgradeneeded = function(e) {
8 db = e.target.result;
9 if (db.objectStoreNames.contains("mystore")) {
10 db.deleteObjectStore("mystore");
12 var store = db.createObjectStore("mystore");
13 store.add({ hello: "world" }, 42);
14 e.target.onsuccess = madeMod;
18 function madeMod() {
19 var trans = db.transaction(["mystore"], "readwrite");
20 var store = trans.
21 objectStore("mystore");
22 trans.oncomplete = function() {
23 parent.postMessage("didcommit", "*");
26 store.put({ hello: "officer" }, 42).onsuccess = function(e) {
27 // Make this transaction run until the end of time or until the page is
28 // navigated away, whichever comes first.
29 function doGet() {
30 store.get(42).onsuccess = doGet;
32 doGet();
33 document.location = "about:blank";
36 </script>
37 </head>
38 <body onload="startDBWork();">
39 This is page one.
40 </body>
41 </html>