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

Side by Side 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, 2 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/bindings/modules/v8/V8BindingForModules.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <title>IndexedDB: Reading cursor value after advancing past range.</title>
3 <script src="../../resources/testharness.js"></script>
4 <script src="../../resources/testharnessreport.js"></script>
5 <script>
6
7 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.
8 var delete_request = indexedDB.deleteDatabase(dbName);
9 delete_request.onerror = function() {
10 assert_unreached('deleteDatabase should not fail');
11 };
12 delete_request.onsuccess = function(e) {
13 var req = indexedDB.open(dbName, dbVersion);
14 req.onsuccess = onsuccess;
15 req.onerror = function() {
16 assert_unreached('open should not fail');
17 };
18 req.onupgradeneeded = function(evt) {
19 var connection = evt.target.result;
20 store = connection.createObjectStore('store', null);
21 for (var i = 0; i < 10; ++i)
22 store.put(i, i);
23 };
24 };
25 }
26
27 // A regression test for http://crbug.com/487711
28 doSetup(location.pathname + '-afterCursorAdvance', 1, function(evt) {
29 var connection = evt.target.result;
30 async_test(function(t) {
31 var transaction = connection.transaction('store', 'readonly');
32 var store = transaction.objectStore('store');
33 var req = store.openCursor();
34 var last_cursor;
35 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.
36 var cursor = evt.target.result;
37 if (cursor) {
38 last_cursor = cursor;
39 cursor.continue();
40 } else {
41 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.
42 t.done();
43 }
44 };
45 req.onerror = function() {
jsbell 2015/09/30 20:34:06 ditto
cmumford 2015/09/30 21:59:43 Done.
46 assert_unreached('open should not fail');
47 };
48 }, 'afterCursorAdvance');
49 });
50
51 </script>
52
OLDNEW
« 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