Index: third_party/WebKit/LayoutTests/storage/indexeddb/cursor-after-range-bug.html |
diff --git a/third_party/WebKit/LayoutTests/storage/indexeddb/cursor-after-range-bug.html b/third_party/WebKit/LayoutTests/storage/indexeddb/cursor-after-range-bug.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..2742af9466a755445a1a7e8ff45ce7c470c354bb |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/storage/indexeddb/cursor-after-range-bug.html |
@@ -0,0 +1,37 @@ |
+<!DOCTYPE html> |
+<title>IndexedDB: Reading cursor value after advancing past range</title> |
+<script src="../../resources/testharness.js"></script> |
+<script src="../../resources/testharnessreport.js"></script> |
+<script src="resources/testharness-helpers.js"></script> |
+<script> |
+ |
+// A regression test for http://crbug.com/487711 |
+indexeddb_test( |
+ function(t, db) { |
+ var store = db.createObjectStore('store'); |
+ for (var i = 0; i < 10; ++i) |
+ store.put(i, i); |
+ }, |
+ function(t, db) { |
+ var transaction = db.transaction('store', 'readonly'); |
+ var store = transaction.objectStore('store'); |
+ var req = store.openCursor(); |
+ var last_cursor; |
+ req.onsuccess = t.step_func(function(evt) { |
+ var cursor = evt.target.result; |
+ if (cursor) { |
+ last_cursor = cursor; |
+ cursor.continue(); |
+ } else { |
+ assert_equals(last_cursor.value, undefined); |
+ t.done(); |
+ } |
+ }); |
+ req.onerror = t.step_func(function() { |
+ assert_unreached('open should not fail'); |
+ }); |
+ }, |
+ 'Access to cursor value after final advance should be undefined' |
+); |
+ |
+</script> |