Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / ManualTests / indexeddb-persists.html
blob86c157e8a0a2ab8169cec0b04fe8a28b61e0a51d
1 <html>
2 <body>
3 <p>This is a test that only applies to IndexedDB. <span id=enabled>Our test for whether you have it enabled seems to have failed.</span></p>
5 <p>Please follow these steps in order:</p>
7 <p>First, click <a href="javascript: setData()">here</a> to open a database and set some data within it.</p>
9 <p>Next, close the browser and then re-open this page.</p>
11 <p>Lastly, click <a href="javascript: verifyData()">here</a> to verify the data was there</p>
13 <p>Status: <span id=status>...</span></p>
15 <script>
17 if (!('indexedDB' in window))
18 document.getElementById("enabled").innerHTML = "<font color=red>Your build does NOT seem to have it enabled. So all code on this page is disabled.</font>";
19 else
20 document.getElementById("enabled").innerHTML = "<font color=green>Your build seems to have it enabled.</font>";
22 function status(str, color)
24 if (color)
25 str = "<font color='" + color + "'>" + str + "</font>";
26 document.getElementById("status").innerHTML = str;
29 function setData()
31 status("Something must have gone wrong (or we're still working)...", "red");
33 indexedDB.open("someDB", "some description").onsuccess = function() {
34 event.result.setVersion("some version").onsuccess = function() {
35 var db = event.source;
36 while (db.objectStoreNames.length)
37 db.removeObjectStore(db.objectStoreNames[0]);
38 db.createObjectStore("test").put("value", "key").onsuccess = function() {
39 status("Value set", "green");
45 function verifyData()
47 status("Something must have gone wrong (or we're still working)...", "red");
49 indexedDB.open("someDB", "some description").onsuccess = function() {
50 try {
51 var result = event.result.transaction([]).objectStore("test").get("key");
52 result.onsuccess = function() {
53 if (event.result == "value")
54 status("Value verified", "green");
55 else
56 status("Value incorrect!", "red");
58 result.onerror = function() {
59 status("An error occurred: " + event.code + " " + event.message, "red");
61 } catch (e) {
62 status("An exception occurred: " + e, "red");
67 </script>
68 </body>
69 </html>