dom/indexedDB/test/bfcache_iframe1.html

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     1 <!DOCTYPE html>
     2 <html>
     3 <head>
     4   <script>
     5   var request = indexedDB.open(parent.location, 1);
     6   request.onupgradeneeded = function(e) {
     7     var db = e.target.result;
     8     // This should never be called
     9     db.onversionchange = function(e) {
    10       db.transaction(["mystore"]).objectStore("mystore").put({ hello: "fail" }, 42);
    11     }
    12     var trans = e.target.transaction;
    13     if (db.objectStoreNames.contains("mystore")) {
    14       db.deleteObjectStore("mystore");
    15     }
    16     var store = db.createObjectStore("mystore");
    17     store.add({ hello: "world" }, 42);
    18     trans.oncomplete = function() {
    19       parent.postMessage("go", "http://mochi.test:8888");
    20     }
    21   };
    22   </script>
    23 </head>
    24 <body>
    25   This is page one.
    26 </body>
    27 </html>

mercurial