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

Unified Diff: LayoutTests/storage/indexeddb/idbcursor_continueprimarykey.html

Issue 1160853004: IndexedDB: continuePrimaryKey() on object store cursor should throw (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: eschew assert_true Created 5 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Source/modules/indexeddb/IDBCursor.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/storage/indexeddb/idbcursor_continueprimarykey.html
diff --git a/LayoutTests/storage/indexeddb/idbcursor_continueprimarykey.html b/LayoutTests/storage/indexeddb/idbcursor_continueprimarykey.html
new file mode 100644
index 0000000000000000000000000000000000000000..186ac4d697c608254cd38ca90942fde363e15f49
--- /dev/null
+++ b/LayoutTests/storage/indexeddb/idbcursor_continueprimarykey.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<title>IndexedDB: IDBCursor continuePrimaryKey() method</title>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<script>
+
+async_test(function(t) {
+ var dbname = document.location + '-' + t.name;
+ var del = indexedDB.deleteDatabase(dbname);
+ del.onerror = t.unreached_func('deleteDatabase should succeed');
+ var open = indexedDB.open(dbname);
+ open.onerror = t.unreached_func('open should succeed');
+
+ open.onupgradeneeded = t.step_func(function() {
+ var db = open.result;
+ var store = db.createObjectStore('store');
+ store.put('a', 1).onerror = t.unreached_func('put should not fail');
+ var request = store.openCursor();
+ request.onerror = t.unreached_func('openCursor should not fail');
+ request.onsuccess = function() {
+ var cursor = request.result;
+ assert_class_string(cursor, 'IDBCursorWithValue',
+ 'result should be a cursor');
+
+ assert_throws('InvalidAccessError', function() {
+ cursor.continuePrimaryKey(2, 2);
+ }, 'continuePrimaryKey() should throw if source is not an index');
+ };
+ });
+
+ open.onsuccess = t.step_func(function() {
+ var db = open.result;
+ db.close();
+ t.done();
+ });
+
+}, 'IDBCursor continuePrimaryKey() on object store cursor');
+
+</script>
« no previous file with comments | « no previous file | Source/modules/indexeddb/IDBCursor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698