source: trunk/LayoutTests/storage/indexeddb/create-object-store-options.html @ 99258

Revision 99258, 2.0 KB checked in by arv@chromium.org, 3 years ago (diff)

JS Test Harness: Remove successfullyParsed from more tests
https://bugs.webkit.org/show_bug.cgi?id=71533

Reviewed by Ojan Vafai.

  • LayoutTests/*: Remove successfullyParsed
  • Property svn:eol-style set to LF
Line 
1<html>
2<head>
3<script src="../../fast/js/resources/js-test-pre.js"></script>
4<script src="resources/shared.js"></script>
5</head>
6<body>
7<p id="description"></p>
8<div id="console"></div>
9<script>
10
11description("Test IndexedDB's createObjectStore's various options");
12if (window.layoutTestController)
13    layoutTestController.waitUntilDone();
14
15function test()
16{
17    shouldBeTrue("'webkitIndexedDB' in window");
18    shouldBeFalse("webkitIndexedDB == null");
19
20    request = evalAndLog("webkitIndexedDB.open('create-object-store-options', 'description')");
21    request.onsuccess = openSuccess;
22    request.onerror = unexpectedErrorCallback;
23}
24
25function openSuccess()
26{
27    db = evalAndLog("db = event.target.result");
28
29    request = evalAndLog("request = db.setVersion('version 1')");
30    request.onsuccess = cleanDatabase;
31    request.onerror = unexpectedErrorCallback;
32}
33
34function cleanDatabase()
35{
36    deleteAllObjectStores(db);
37
38    evalAndLog("db.createObjectStore('a', {keyPath: 'a'})");
39    evalAndLog("db.createObjectStore('b')");
40
41    debug("db.createObjectStore('c', {autoIncrement: true});");
42    db.createObjectStore('c', {autoIncrement: true});
43
44    trans = evalAndLog("trans = db.transaction(['a', 'b'], webkitIDBTransaction.READ_WRITE)");
45    shouldBe("trans.mode", "webkitIDBTransaction.READ_WRITE");
46
47    req = evalAndLog("trans.objectStore('a').put({'a': 0})");
48    req.onsuccess = putB;
49    req.onerror = unexpectedErrorCallback;
50}
51
52function putB()
53{
54    req = evalAndLog("trans.objectStore('b').put({'a': 0}, 0)");  // OOPS
55    req.onsuccess = getA;
56    req.onerror = unexpectedErrorCallback;
57}
58
59function getA()
60{
61    req = evalAndLog("trans.objectStore('a').get(0)");
62    req.onsuccess = getB;
63    req.onerror = unexpectedErrorCallback;
64}
65
66function getB()
67{
68    shouldBe("event.target.result.a", "{a: 0}");
69
70    req = evalAndLog("trans.objectStore('b').get(0)");
71    req.onsuccess = checkB;
72    req.onerror = unexpectedErrorCallback;
73}
74
75function checkB()
76{
77    shouldBe("event.target.result.a", "{a: 0}");
78
79    done();
80}
81
82
83test();
84
85</script>
86</body>
87</html>
Note: See TracBrowser for help on using the repository browser.