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

Unified Diff: third_party/WebKit/LayoutTests/storage/indexeddb/cursor-after-range-bug.html

Issue 1369773004: IndexedDB: Fix null ptr crash in IDBCursor::value(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Reverted null ptr check removal Created 5 years, 3 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 | third_party/WebKit/Source/modules/indexeddb/IDBCursor.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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>
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/indexeddb/IDBCursor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698