OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 window.indexedDB = window.indexedDB || window.webkitIndexedDB; | |
6 | |
7 function test() { | 5 function test() { |
8 | 6 |
9 var DBNAME = 'multiEntry-crash-test'; | 7 var DBNAME = 'multiEntry-crash-test'; |
10 var request = indexedDB.deleteDatabase(DBNAME); | 8 var request = indexedDB.deleteDatabase(DBNAME); |
11 request.onsuccess = function (e) { | 9 request.onsuccess = function (e) { |
12 request = indexedDB.open(DBNAME, 1); | 10 request = indexedDB.open(DBNAME, 1); |
13 request.onerror = unexpectedErrorCallback; | 11 request.onerror = unexpectedErrorCallback; |
14 request.onblocked = unexpectedBlockedCallback; | 12 request.onblocked = unexpectedBlockedCallback; |
15 request.onupgradeneeded = function (e) { | 13 request.onupgradeneeded = function (e) { |
16 var store = db.createObjectStore('storeName'); | 14 var store = db.createObjectStore('storeName'); |
17 window.index1 = store.createIndex('index1Name', 'prop1'); | 15 window.index1 = store.createIndex('index1Name', 'prop1'); |
18 window.index2 = store.createIndex( | 16 window.index2 = store.createIndex( |
19 'index2Name', 'prop2', {multiEntry: true}); | 17 'index2Name', 'prop2', {multiEntry: true}); |
20 shouldBeFalse("window.index1.multiEntry"); | 18 shouldBeFalse("window.index1.multiEntry"); |
21 shouldBeTrue("window.index2.multiEntry"); | 19 shouldBeTrue("window.index2.multiEntry"); |
22 done(); | 20 done(); |
23 }; | 21 }; |
24 }; | 22 }; |
25 } | 23 } |
OLD | NEW |