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

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: Added regression layout test. 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/bindings/modules/v8/V8BindingForModules.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..d391ae8a198d581fd72de61a22ddd41cb1c661b0
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/storage/indexeddb/cursor-after-range-bug.html
@@ -0,0 +1,52 @@
+<!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>
+
+function doSetup(dbName, dbVersion, onsuccess) {
jsbell 2015/09/30 20:34:06 You should make this all part of the async_test, o
cmumford 2015/09/30 21:59:43 Done.
+ var delete_request = indexedDB.deleteDatabase(dbName);
+ delete_request.onerror = function() {
+ assert_unreached('deleteDatabase should not fail');
+ };
+ delete_request.onsuccess = function(e) {
+ var req = indexedDB.open(dbName, dbVersion);
+ req.onsuccess = onsuccess;
+ req.onerror = function() {
+ assert_unreached('open should not fail');
+ };
+ req.onupgradeneeded = function(evt) {
+ var connection = evt.target.result;
+ store = connection.createObjectStore('store', null);
+ for (var i = 0; i < 10; ++i)
+ store.put(i, i);
+ };
+ };
+}
+
+// A regression test for http://crbug.com/487711
+doSetup(location.pathname + '-afterCursorAdvance', 1, function(evt) {
+ var connection = evt.target.result;
+ async_test(function(t) {
+ var transaction = connection.transaction('store', 'readonly');
+ var store = transaction.objectStore('store');
+ var req = store.openCursor();
+ var last_cursor;
+ req.onsuccess = function(evt) {
jsbell 2015/09/30 20:34:06 Callbacks need to be wrapped in t.step_func, e.g.
cmumford 2015/09/30 21:59:43 Done.
+ var cursor = evt.target.result;
+ if (cursor) {
+ last_cursor = cursor;
+ cursor.continue();
+ } else {
+ assert_equals(last_cursor.value, undefined);
jsbell 2015/09/30 20:34:06 Cool - that does match the spec. :) I wasn't sure.
cmumford 2015/09/30 21:59:43 Acknowledged.
+ t.done();
+ }
+ };
+ req.onerror = function() {
jsbell 2015/09/30 20:34:06 ditto
cmumford 2015/09/30 21:59:43 Done.
+ assert_unreached('open should not fail');
+ };
+ }, 'afterCursorAdvance');
+});
+
+</script>
+
« no previous file with comments | « no previous file | third_party/WebKit/Source/bindings/modules/v8/V8BindingForModules.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698