WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
persistence test that should work but doesn't
persistence_layout_test.html (text/html), 2.15 KB, created by
Joshua Bell
on 2011-11-03 11:38:17 PDT
(
hide
)
Description:
persistence test that should work but doesn't
Filename:
MIME Type:
Creator:
Joshua Bell
Created:
2011-11-03 11:38:17 PDT
Size:
2.15 KB
patch
obsolete
><html> ><head> ><link rel="stylesheet" href="../../fast/js/resources/js-test-style.css"> ><script src="../../fast/js/resources/js-test-pre.js"></script> ><script src="resources/shared.js"></script> ></head> ><body> ><p id="description"></p> ><div id="console"></div> ><script> > >description("Test persistence across page loads"); > >function test() { > if (document.location.search === "?2") { > test2(); > } else { > test1(); > } >} > >function runPart2() { > window.location.href = window.location + '?2'; >} > >function openDatabase(callback) { > indexedDB = evalAndLog("indexedDB = window.indexedDB || window.webkitIndexedDB || window.mozIndexedDB;"); > shouldBeFalse("indexedDB == null"); > > var openreq = evalAndLog("indexedDB.open('db')"); > openreq.onerror = unexpectedErrorCallback; > openreq.onsuccess = function() { > callback(openreq.result); > }; >} > >function test1(db) { > if (window.layoutTestController) { > layoutTestController.waitUntilDone(); > } > > debug("Part 1 - open and create stores"); > openDatabase(function(db) { > window.db = db; > var setverreq = evalAndLog("db.setVersion('1')"); > setverreq.onerror = unexpectedErrorCallback; > setverreq.onsuccess = function() { > var trans = setverreq.result; > evalAndLog("db.createObjectStore('store1')"); > evalAndLog("db.createObjectStore('store2')"); > evalAndLog("db.createObjectStore('store3')"); > debug(""); > trans.oncomplete = function () { > window.db.close(); > window.db = null; > runPart2(); > }; > }; > }); >} > >function test2(db) { > debug("Part 2 - open and verify stores"); > openDatabase(function(db) { > window.db = db; > shouldBeEqualToString("db.version", "1"); > shouldBeTrue("db.objectStoreNames.contains('store1')"); > shouldBeTrue("db.objectStoreNames.contains('store2')"); > shouldBeTrue("db.objectStoreNames.contains('store3')"); > debug(""); > > if (window.layoutTestController) { > layoutTestController.notifyDone(); > } > }); >} > >test(); > ></script> ></body> ></html>
<html> <head> <link rel="stylesheet" href="../../fast/js/resources/js-test-style.css"> <script src="../../fast/js/resources/js-test-pre.js"></script> <script src="resources/shared.js"></script> </head> <body> <p id="description"></p> <div id="console"></div> <script> description("Test persistence across page loads"); function test() { if (document.location.search === "?2") { test2(); } else { test1(); } } function runPart2() { window.location.href = window.location + '?2'; } function openDatabase(callback) { indexedDB = evalAndLog("indexedDB = window.indexedDB || window.webkitIndexedDB || window.mozIndexedDB;"); shouldBeFalse("indexedDB == null"); var openreq = evalAndLog("indexedDB.open('db')"); openreq.onerror = unexpectedErrorCallback; openreq.onsuccess = function() { callback(openreq.result); }; } function test1(db) { if (window.layoutTestController) { layoutTestController.waitUntilDone(); } debug("Part 1 - open and create stores"); openDatabase(function(db) { window.db = db; var setverreq = evalAndLog("db.setVersion('1')"); setverreq.onerror = unexpectedErrorCallback; setverreq.onsuccess = function() { var trans = setverreq.result; evalAndLog("db.createObjectStore('store1')"); evalAndLog("db.createObjectStore('store2')"); evalAndLog("db.createObjectStore('store3')"); debug(""); trans.oncomplete = function () { window.db.close(); window.db = null; runPart2(); }; }; }); } function test2(db) { debug("Part 2 - open and verify stores"); openDatabase(function(db) { window.db = db; shouldBeEqualToString("db.version", "1"); shouldBeTrue("db.objectStoreNames.contains('store1')"); shouldBeTrue("db.objectStoreNames.contains('store2')"); shouldBeTrue("db.objectStoreNames.contains('store3')"); debug(""); if (window.layoutTestController) { layoutTestController.notifyDone(); } }); } test(); </script> </body> </html>
View Attachment As Raw
Actions:
View
Attachments on
bug 71491
: 113531