Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(59)

Side by Side Diff: content/test/data/indexeddb/key_path_test.js

Issue 401893002: IndexedDB: Stop using webkit-prefixed versions of APIs in tests (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More webkitIndexedDB foo and update webkitErrorMessage use too Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 5
6 function cursorSuccess() 6 function cursorSuccess()
7 { 7 {
8 debug("Cursor opened successfully.") 8 debug("Cursor opened successfully.");
9 // FIXME: check that we can iterate the cursor. 9 // FIXME: check that we can iterate the cursor.
10 shouldBe("event.target.result.direction", "'next'"); 10 shouldBe("event.target.result.direction", "'next'");
11 shouldBe("event.target.result.key", "'myKey' + count"); 11 shouldBe("event.target.result.key", "'myKey' + count");
12 shouldBe("event.target.result.value.keyPath", "'myKey' + count"); 12 shouldBe("event.target.result.value.keyPath", "'myKey' + count");
13 shouldBe("event.target.result.value.value", "'myValue' + count"); 13 shouldBe("event.target.result.value.value", "'myValue' + count");
14 if (++count >= 5) 14 if (++count >= 5)
15 done(); 15 done();
16 else 16 else
17 openCursor(); 17 openCursor();
18 } 18 }
19 19
20 function openCursor() 20 function openCursor()
21 { 21 {
22 debug("Opening cursor #" + count); 22 debug("Opening cursor #" + count);
23 keyRange = webkitIDBKeyRange.lowerBound("myKey" + count); 23 keyRange = IDBKeyRange.lowerBound("myKey" + count);
24 request = objectStore.openCursor(keyRange); 24 request = objectStore.openCursor(keyRange);
25 request.onsuccess = cursorSuccess; 25 request.onsuccess = cursorSuccess;
26 request.onerror = unexpectedErrorCallback; 26 request.onerror = unexpectedErrorCallback;
27 } 27 }
28 28
29 function populateObjectStore() 29 function populateObjectStore()
30 { 30 {
31 debug("Populating object store #" + count); 31 debug("Populating object store #" + count);
32 obj = {'keyPath': 'myKey' + count, 'value': 'myValue' + count}; 32 obj = {'keyPath': 'myKey' + count, 'value': 'myValue' + count};
33 request = objectStore.add(obj); 33 request = objectStore.add(obj);
(...skipping 12 matching lines...) Expand all
46 db = event.target.result; 46 db = event.target.result;
47 window.objectStore = db.createObjectStore('test', {keyPath: 'keyPath'}); 47 window.objectStore = db.createObjectStore('test', {keyPath: 'keyPath'});
48 count = 0; 48 count = 0;
49 populateObjectStore(); 49 populateObjectStore();
50 } 50 }
51 51
52 function test() 52 function test()
53 { 53 {
54 indexedDBTest(createObjectStore); 54 indexedDBTest(createObjectStore);
55 } 55 }
OLDNEW
« no previous file with comments | « content/test/data/indexeddb/database_callbacks_first.html ('k') | content/test/data/indexeddb/key_types_test.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698