diff options
author | jorlow@chromium.org <jorlow@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-15 23:51:09 +0000 |
---|---|---|
committer | jorlow@chromium.org <jorlow@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-15 23:51:09 +0000 |
commit | ada043062ea6fa6704af914f6f3dbb318efd88ce (patch) | |
tree | d0321d403db01ae7effe202d945cfb4539e44cd8 | |
parent | 6f3b4338bc9e1bfc9e184aa5d1e6ccb636e7d1d0 (diff) | |
download | chromium_src-ada043062ea6fa6704af914f6f3dbb318efd88ce.zip chromium_src-ada043062ea6fa6704af914f6f3dbb318efd88ce.tar.gz chromium_src-ada043062ea6fa6704af914f6f3dbb318efd88ce.tar.bz2 |
Re-enable all the IndexedDB browser tests and update them to handle
http://trac.webkit.org/changeset/78525
BUG=70773
TEST=This
Review URL: http://codereview.chromium.org/6525010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@75030 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/in_process_webkit/indexed_db_browsertest.cc | 29 | ||||
-rw-r--r-- | chrome/test/data/indexeddb/cursor_test.js | 40 | ||||
-rw-r--r-- | chrome/test/data/indexeddb/database_test.js | 14 | ||||
-rw-r--r-- | chrome/test/data/indexeddb/index_test.js | 73 | ||||
-rw-r--r-- | chrome/test/data/indexeddb/key_path_test.js | 36 | ||||
-rw-r--r-- | chrome/test/data/indexeddb/object_store_test.js | 72 | ||||
-rw-r--r-- | chrome/test/data/indexeddb/transaction_get_test.js | 36 | ||||
-rw-r--r-- | chrome/test/data/indexeddb/transaction_run_forever.js | 16 | ||||
-rw-r--r-- | chrome/test/data/indexeddb/transaction_test.js | 20 |
9 files changed, 169 insertions, 167 deletions
diff --git a/chrome/browser/in_process_webkit/indexed_db_browsertest.cc b/chrome/browser/in_process_webkit/indexed_db_browsertest.cc index c0320f7..44daa9c 100644 --- a/chrome/browser/in_process_webkit/indexed_db_browsertest.cc +++ b/chrome/browser/in_process_webkit/indexed_db_browsertest.cc @@ -48,40 +48,41 @@ class IndexedDBBrowserTest : public InProcessBrowserTest { } }; -IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTest, DISABLED_CursorTest) { +// TODO(jorlow): As of Feb 14, 2011 I'm re-enabling these tests because we have +// fixed a couple known sources of flake and I'm hoping they +// were the cause of problems. If you see these turn red again, +// please don't hesitate to re-disable and mark them against bug +// http://code.google.com/p/chromium/issues/detail?id=70773 + +IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTest, CursorTest) { SimpleTest(testUrl(FilePath(FILE_PATH_LITERAL("cursor_test.html")))); } -// http://code.google.com/p/chromium/issues/detail?id=70773 -IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTest, DISABLED_IndexTest) { +IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTest, IndexTest) { SimpleTest(testUrl(FilePath(FILE_PATH_LITERAL("index_test.html")))); } -// http://code.google.com/p/chromium/issues/detail?id=70773 -IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTest, DISABLED_KeyPathTest) { +IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTest, KeyPathTest) { SimpleTest(testUrl(FilePath(FILE_PATH_LITERAL("key_path_test.html")))); } -IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTest, DISABLED_TransactionGetTest) { +IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTest, TransactionGetTest) { SimpleTest(testUrl(FilePath(FILE_PATH_LITERAL("transaction_get_test.html")))); } -// http://code.google.com/p/chromium/issues/detail?id=70773 -IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTest, DISABLED_ObjectStoreTest) { +IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTest, ObjectStoreTest) { SimpleTest(testUrl(FilePath(FILE_PATH_LITERAL("object_store_test.html")))); } -IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTest, DISABLED_DatabaseTest) { +IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTest, DatabaseTest) { SimpleTest(testUrl(FilePath(FILE_PATH_LITERAL("database_test.html")))); } -// http://code.google.com/p/chromium/issues/detail?id=70773 -IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTest, DISABLED_TransactionTest) { +IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTest, TransactionTest) { SimpleTest(testUrl(FilePath(FILE_PATH_LITERAL("transaction_test.html")))); } -// http://code.google.com/p/chromium/issues/detail?id=70773 -IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTest, DISABLED_DoesntHangTest) { +IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTest, DoesntHangTest) { SimpleTest(testUrl(FilePath( FILE_PATH_LITERAL("transaction_run_forever.html")))); ui_test_utils::CrashTab(browser()->GetSelectedTabContents()); @@ -90,7 +91,7 @@ IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTest, DISABLED_DoesntHangTest) { // In proc browser test is needed here because ClearLocalState indirectly calls // WebKit's isMainThread through WebSecurityOrigin->SecurityOrigin. -IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTest, DISABLED_ClearLocalState) { +IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTest, ClearLocalState) { // Create test files. ScopedTempDir temp_dir; ASSERT_TRUE(temp_dir.CreateUniqueTempDir()); diff --git a/chrome/test/data/indexeddb/cursor_test.js b/chrome/test/data/indexeddb/cursor_test.js index c759e02..a49c6a2 100644 --- a/chrome/test/data/indexeddb/cursor_test.js +++ b/chrome/test/data/indexeddb/cursor_test.js @@ -12,14 +12,14 @@ function openEmptyCursor() { debug('Opening an empty cursor.'); keyRange = webkitIDBKeyRange.lowerBound('InexistentKey'); - result = objectStore.openCursor(keyRange); - result.onsuccess = emptyCursorSuccess; - result.onerror = unexpectedErrorCallback; + request = objectStore.openCursor(keyRange); + request.onsuccess = emptyCursorSuccess; + request.onerror = unexpectedErrorCallback; } function cursorSuccess() { - var cursor = event.result; + var cursor = event.target.result; if (cursor === null) { debug('Cursor reached end of range.'); openEmptyCursor(); @@ -27,9 +27,9 @@ function cursorSuccess() } debug('Cursor opened successfully.'); - shouldBe("event.result.direction", "0"); - shouldBe("event.result.key", "3.14"); - shouldBe("event.result.value", "'myValue'"); + shouldBe("event.target.result.direction", "0"); + shouldBe("event.target.result.key", "3.14"); + shouldBe("event.target.result.value", "'myValue'"); cursor.continue(); } @@ -38,9 +38,9 @@ function openCursor(objectStore) { debug('Opening cursor'); var keyRange = webkitIDBKeyRange.lowerBound(3.12); - var result = objectStore.openCursor(keyRange); - result.onsuccess = cursorSuccess; - result.onerror = unexpectedErrorCallback; + var request = objectStore.openCursor(keyRange); + request.onsuccess = cursorSuccess; + request.onerror = unexpectedErrorCallback; } function dataAddedSuccess() @@ -54,24 +54,24 @@ function populateObjectStore() debug('Populating object store'); deleteAllObjectStores(db); window.objectStore = db.createObjectStore('test'); - var result = objectStore.add('myValue', 3.14); - result.onsuccess = dataAddedSuccess; - result.onerror = unexpectedErrorCallback; + var request = objectStore.add('myValue', 3.14); + request.onsuccess = dataAddedSuccess; + request.onerror = unexpectedErrorCallback; } function setVersion() { debug('setVersion'); - window.db = event.result; - var result = db.setVersion('new version'); - result.onsuccess = populateObjectStore; - result.onerror = unexpectedErrorCallback; + window.db = event.target.result; + var request = db.setVersion('new version'); + request.onsuccess = populateObjectStore; + request.onerror = unexpectedErrorCallback; } function test() { debug('Connecting to indexedDB'); - var result = webkitIndexedDB.open('name'); - result.onsuccess = setVersion; - result.onerror = unexpectedErrorCallback; + var request = webkitIndexedDB.open('name'); + request.onsuccess = setVersion; + request.onerror = unexpectedErrorCallback; } diff --git a/chrome/test/data/indexeddb/database_test.js b/chrome/test/data/indexeddb/database_test.js index ca6d1fd..472e1f50 100644 --- a/chrome/test/data/indexeddb/database_test.js +++ b/chrome/test/data/indexeddb/database_test.js @@ -25,10 +25,10 @@ function populateObjectStore() function setVersion() { debug('setVersion'); - window.db = event.result; - var result = db.setVersion('1.0'); - result.onsuccess = populateObjectStore; - result.onerror = unexpectedErrorCallback; + window.db = event.target.result; + var request = db.setVersion('1.0'); + request.onsuccess = populateObjectStore; + request.onerror = unexpectedErrorCallback; } function test() @@ -41,7 +41,7 @@ function test() } debug('Connecting to indexedDB'); - var result = indexedDB.open('name'); - result.onsuccess = setVersion; - result.onerror = unexpectedErrorCallback; + var request = indexedDB.open('name'); + request.onsuccess = setVersion; + request.onerror = unexpectedErrorCallback; } diff --git a/chrome/test/data/indexeddb/index_test.js b/chrome/test/data/indexeddb/index_test.js index 37c67a1..09566d7 100644 --- a/chrome/test/data/indexeddb/index_test.js +++ b/chrome/test/data/indexeddb/index_test.js @@ -4,7 +4,7 @@ function onCursor() { - var cursor = event.result; + var cursor = event.target.result; if (cursor === null) { debug('Reached end of object cursor.'); if (!gotObjectThroughCursor) { @@ -16,8 +16,8 @@ function onCursor() } debug('Got object through cursor.'); - shouldBe('event.result.key', '55'); - shouldBe('event.result.value.aValue', '"foo"'); + shouldBe('event.target.result.key', '55'); + shouldBe('event.target.result.value.aValue', '"foo"'); gotObjectThroughCursor = true; cursor.continue(); @@ -25,7 +25,7 @@ function onCursor() function onKeyCursor() { - var cursor = event.result; + var cursor = event.target.result; if (cursor === null) { debug('Reached end of key cursor.'); if (!gotKeyThroughCursor) { @@ -33,16 +33,16 @@ function onKeyCursor() return; } - var result = index.openCursor(IDBKeyRange.only(55)); - result.onsuccess = onCursor; - result.onerror = unexpectedErrorCallback; + var request = index.openCursor(IDBKeyRange.only(55)); + request.onsuccess = onCursor; + request.onerror = unexpectedErrorCallback; gotObjectThroughCursor = false; return; } debug('Got key through cursor.'); - shouldBe('event.result.key', '55'); - shouldBe('event.result.value', '1'); + shouldBe('event.target.result.key', '55'); + shouldBe('event.target.result.value', '1'); gotKeyThroughCursor = true; cursor.continue(); @@ -52,41 +52,41 @@ function getSuccess() { debug('Successfully got object through key in index.'); - shouldBe('event.result.aKey', '55'); - shouldBe('event.result.aValue', '"foo"'); + shouldBe('event.target.result.aKey', '55'); + shouldBe('event.target.result.aValue', '"foo"'); - var result = index.openKeyCursor(IDBKeyRange.only(55)); - result.onsuccess = onKeyCursor; - result.onerror = unexpectedErrorCallback; + var request = index.openKeyCursor(IDBKeyRange.only(55)); + request.onsuccess = onKeyCursor; + request.onerror = unexpectedErrorCallback; gotKeyThroughCursor = false; } function getKeySuccess() { debug('Successfully got key.'); - shouldBe('event.result', '1'); + shouldBe('event.target.result', '1'); - var result = index.get(55); - result.onsuccess = getSuccess; - result.onerror = unexpectedErrorCallback; + var request = index.get(55); + request.onsuccess = getSuccess; + request.onerror = unexpectedErrorCallback; } function moreDataAdded() { debug('Successfully added more data.'); - var result = index.getKey(55); - result.onsuccess = getKeySuccess; - result.onerror = unexpectedErrorCallback; + var request = index.getKey(55); + request.onsuccess = getKeySuccess; + request.onerror = unexpectedErrorCallback; } function indexErrorExpected() { debug('Existing index triggered on error as expected.'); - var result = objectStore.put({'aKey': 55, 'aValue': 'foo'}, 1); - result.onsuccess = moreDataAdded; - result.onerror = unexpectedErrorCallback; + var request = objectStore.put({'aKey': 55, 'aValue': 'foo'}, 1); + request.onsuccess = moreDataAdded; + request.onerror = unexpectedErrorCallback; } function indexSuccess() @@ -99,7 +99,7 @@ function indexSuccess() shouldBe("index.unique", "true"); try { - result = objectStore.createIndex('myIndex', 'aKey', {unique: true}); + request = objectStore.createIndex('myIndex', 'aKey', {unique: true}); fail('Re-creating an index must throw an exception'); } catch (e) { indexErrorExpected(); @@ -110,8 +110,7 @@ function createIndex(expect_error) { debug('Creating an index.'); try { - result = objectStore.createIndex('myIndex', 'aKey', {unique: true}); - window.index = result; + window.index = objectStore.createIndex('myIndex', 'aKey', {unique: true}); indexSuccess(); } catch (e) { unexpectedErrorCallback(); @@ -130,18 +129,18 @@ function populateObjectStore() deleteAllObjectStores(db); window.objectStore = db.createObjectStore('test'); var myValue = {'aKey': 21, 'aValue': '!42'}; - var result = objectStore.add(myValue, 0); - result.onsuccess = dataAddedSuccess; - result.onerror = unexpectedErrorCallback; + var request = objectStore.add(myValue, 0); + request.onsuccess = dataAddedSuccess; + request.onerror = unexpectedErrorCallback; } function setVersion() { debug('setVersion'); - window.db = event.result; - var result = db.setVersion('new version'); - result.onsuccess = populateObjectStore; - result.onerror = unexpectedErrorCallback; + window.db = event.target.result; + var request = db.setVersion('new version'); + request.onsuccess = populateObjectStore; + request.onerror = unexpectedErrorCallback; } function test() @@ -154,7 +153,7 @@ function test() } debug('Connecting to indexedDB'); - var result = indexedDB.open('name'); - result.onsuccess = setVersion; - result.onerror = unexpectedErrorCallback; + var request = indexedDB.open('name'); + request.onsuccess = setVersion; + request.onerror = unexpectedErrorCallback; } diff --git a/chrome/test/data/indexeddb/key_path_test.js b/chrome/test/data/indexeddb/key_path_test.js index 8abda7d..47927fa 100644 --- a/chrome/test/data/indexeddb/key_path_test.js +++ b/chrome/test/data/indexeddb/key_path_test.js @@ -7,10 +7,10 @@ function cursorSuccess() { debug("Cursor opened successfully.") // FIXME: check that we can iterate the cursor. - shouldBe("event.result.direction", "0"); - shouldBe("event.result.key", "'myKey' + count"); - shouldBe("event.result.value.keyPath", "'myKey' + count"); - shouldBe("event.result.value.value", "'myValue' + count"); + shouldBe("event.target.result.direction", "0"); + shouldBe("event.target.result.key", "'myKey' + count"); + shouldBe("event.target.result.value.keyPath", "'myKey' + count"); + shouldBe("event.target.result.value.value", "'myValue' + count"); if (++count >= 5) done(); else @@ -21,22 +21,22 @@ function openCursor() { debug("Opening cursor #" + count); keyRange = webkitIDBKeyRange.lowerBound("myKey" + count); - result = objectStore.openCursor(keyRange); - result.onsuccess = cursorSuccess; - result.onerror = unexpectedErrorCallback; + request = objectStore.openCursor(keyRange); + request.onsuccess = cursorSuccess; + request.onerror = unexpectedErrorCallback; } function populateObjectStore() { debug("Populating object store #" + count); obj = {'keyPath': 'myKey' + count, 'value': 'myValue' + count}; - result = objectStore.add(obj); - result.onerror = unexpectedErrorCallback; + request = objectStore.add(obj); + request.onerror = unexpectedErrorCallback; if (++count >= 5) { count = 0; - result.onsuccess = openCursor; + request.onsuccess = openCursor; } else { - result.onsuccess = populateObjectStore; + request.onsuccess = populateObjectStore; } } @@ -52,19 +52,19 @@ function createObjectStore() function setVersion() { debug('setVersion'); - window.db = event.result; - var result = db.setVersion('new version'); - result.onsuccess = createObjectStore; - result.onerror = unexpectedErrorCallback; + window.db = event.target.result; + var request = db.setVersion('new version'); + request.onsuccess = createObjectStore; + request.onerror = unexpectedErrorCallback; } function test() { debug("Test IndexedDB's KeyPath."); debug("Opening IndexedDB"); - result = webkitIndexedDB.open('name'); - result.onsuccess = setVersion; - result.onerror = unexpectedErrorCallback; + request = webkitIndexedDB.open('name'); + request.onsuccess = setVersion; + request.onerror = unexpectedErrorCallback; } var successfullyParsed = true; diff --git a/chrome/test/data/indexeddb/object_store_test.js b/chrome/test/data/indexeddb/object_store_test.js index 1f6405f..b398b0c 100644 --- a/chrome/test/data/indexeddb/object_store_test.js +++ b/chrome/test/data/indexeddb/object_store_test.js @@ -8,14 +8,14 @@ function getByDateSuccess() { debug('Data retrieved by date key'); - shouldBe("event.result", "'foo'"); + shouldBe("event.target.result", "'foo'"); done(); } function recordNotFound() { debug('Removed data can no longer be found'); - shouldBe("event.result", "undefined"); + shouldBe("event.target.result", "undefined"); debug('Retrieving an index'); shouldBe("objectStore.index('fname_index').name", "'fname_index'"); @@ -27,50 +27,51 @@ function recordNotFound() fail(e); } - var result = transaction.objectStore('stuff').get(testDate); - result.onsuccess = getByDateSuccess; - result.onerror = unexpectedErrorCallback; + var request = transaction.objectStore('stuff').get(testDate); + request.onsuccess = getByDateSuccess; + request.onerror = unexpectedErrorCallback; } function removeSuccess() { debug('Data removed'); - var result = objectStore.get(1); - result.onsuccess = recordNotFound; - result.onerror = unexpectedSuccessCallback; + var request = objectStore.get(1); + request.onsuccess = recordNotFound; + request.onerror = unexpectedSuccessCallback; } function getSuccess() { debug('Data retrieved'); - shouldBe("event.result.fname", "'John'"); - shouldBe("event.result.lname", "'Doe'"); - shouldBe("event.result.id", "1"); + shouldBe("event.target.result.fname", "'John'"); + shouldBe("event.target.result.lname", "'Doe'"); + shouldBe("event.target.result.id", "1"); - var result = objectStore.delete(1); - result.onsuccess = removeSuccess; - result.onerror = unexpectedErrorCallback; + var request = objectStore.delete(1); + request.onsuccess = removeSuccess; + request.onerror = unexpectedErrorCallback; } function moreDataAddedSuccess() { debug('More data added'); - var result = objectStore.get(1); - result.onsuccess = getSuccess; - result.onerror = unexpectedErrorCallback; + var request = objectStore.get(1); + request.onsuccess = getSuccess; + request.onerror = unexpectedErrorCallback; } function addWithSameKeyFailed() { debug('Adding a record with same key failed'); - shouldBe("event.code", "webkitIDBDatabaseException.CONSTRAINT_ERR"); + shouldBe("event.target.errorCode", "webkitIDBDatabaseException.CONSTRAINT_ERR"); + event.preventDefault(); - var result = transaction.objectStore('stuff').add('foo', testDate); - result.onsuccess = moreDataAddedSuccess; - result.onerror = unexpectedErrorCallback; + var request = transaction.objectStore('stuff').add('foo', testDate); + request.onsuccess = moreDataAddedSuccess; + request.onerror = unexpectedErrorCallback; } function dataAddedSuccess() @@ -78,14 +79,15 @@ function dataAddedSuccess() debug('Data added'); debug('Try to add employee with same id'); - var result = objectStore.add({fname: "Tom", lname: "Jones", id: 1}); - result.onsuccess = unexpectedSuccessCallback; - result.onerror = addWithSameKeyFailed; + var request = objectStore.add({fname: "Tom", lname: "Jones", id: 1}); + request.onsuccess = unexpectedSuccessCallback; + request.onerror = addWithSameKeyFailed; } function populateObjectStore() { - window.transaction = event.result; + window.transaction = event.target.result; + transaction.onabort = unexpectedAbortCallback; debug('Populating object store'); deleteAllObjectStores(db); db.createObjectStore('stuff'); @@ -99,24 +101,24 @@ function populateObjectStore() shouldBe("objectStore.indexNames[0]", "'fname_index'"); shouldBe("objectStore.indexNames[1]", "'lname_index'"); - var result = objectStore.add({fname: "John", lname: "Doe", id: 1}); - result.onsuccess = dataAddedSuccess; - result.onerror = unexpectedErrorCallback; + var request = objectStore.add({fname: "John", lname: "Doe", id: 1}); + request.onsuccess = dataAddedSuccess; + request.onerror = unexpectedErrorCallback; } function setVersion() { debug('setVersion'); - window.db = event.result; - var result = db.setVersion('1.0'); - result.onsuccess = populateObjectStore; - result.onerror = unexpectedErrorCallback; + window.db = event.target.result; + var request = db.setVersion('1.0'); + request.onsuccess = populateObjectStore; + request.onerror = unexpectedErrorCallback; } function test() { debug('Connecting to indexedDB'); - var result = webkitIndexedDB.open('name'); - result.onsuccess = setVersion; - result.onerror = unexpectedErrorCallback; + var request = webkitIndexedDB.open('name'); + request.onsuccess = setVersion; + request.onerror = unexpectedErrorCallback; } diff --git a/chrome/test/data/indexeddb/transaction_get_test.js b/chrome/test/data/indexeddb/transaction_get_test.js index 7435478..5319750 100644 --- a/chrome/test/data/indexeddb/transaction_get_test.js +++ b/chrome/test/data/indexeddb/transaction_get_test.js @@ -16,13 +16,13 @@ function afterCommit() function nonExistingKey() { - shouldBe("event.result", "undefined"); + shouldBe("event.target.result", "undefined"); window.setTimeout('afterCommit()', 0); } function gotValue() { - value = event.result; + value = event.target.result; shouldBeEqualToString('value', 'myValue'); } @@ -33,35 +33,35 @@ function startTransaction() //transaction.onabort = unexpectedErrorCallback; store = transaction.objectStore('storeName'); shouldBeEqualToString("store.name", "storeName"); - result = store.get('myKey'); - result.onsuccess = gotValue; - result.onerror = unexpectedErrorCallback; + request = store.get('myKey'); + request.onsuccess = gotValue; + request.onerror = unexpectedErrorCallback; - var emptyResult = store.get('nonExistingKey'); - emptyResult.onsuccess = nonExistingKey; - emptyResult.onerror = unexpectedErrorCallback; + var emptyRequest = store.get('nonExistingKey'); + emptyRequest.onsuccess = nonExistingKey; + emptyRequest.onerror = unexpectedErrorCallback; } function populateObjectStore() { deleteAllObjectStores(db); window.objectStore = db.createObjectStore('storeName'); - var result = objectStore.add('myValue', 'myKey'); - result.onsuccess = startTransaction; - result.onerror = unexpectedErrorCallback; + var request = objectStore.add('myValue', 'myKey'); + request.onsuccess = startTransaction; + request.onerror = unexpectedErrorCallback; } function setVersion() { - window.db = event.result; - var result = db.setVersion('new version'); - result.onsuccess = populateObjectStore; - result.onerror = unexpectedErrorCallback; + window.db = event.target.result; + var request = db.setVersion('new version'); + request.onsuccess = populateObjectStore; + request.onerror = unexpectedErrorCallback; } function test() { - result = webkitIndexedDB.open('name'); - result.onsuccess = setVersion; - result.onerror = unexpectedErrorCallback; + request = webkitIndexedDB.open('name'); + request.onsuccess = setVersion; + request.onerror = unexpectedErrorCallback; } diff --git a/chrome/test/data/indexeddb/transaction_run_forever.js b/chrome/test/data/indexeddb/transaction_run_forever.js index 72e6a2f..74042b2 100644 --- a/chrome/test/data/indexeddb/transaction_run_forever.js +++ b/chrome/test/data/indexeddb/transaction_run_forever.js @@ -46,7 +46,7 @@ function onSetVersionComplete() function onSetVersion() { // We are now in a set version transaction. - var setVersionTransaction = event.result; + var setVersionTransaction = event.target.result; setVersionTransaction.oncomplete = onSetVersionComplete; setVersionTransaction.onerror = unexpectedErrorCallback; @@ -57,10 +57,10 @@ function onSetVersion() function setVersion() { - window.db = event.result; - var result = db.setVersion('1.0'); - result.onsuccess = onSetVersion; - result.onerror = unexpectedErrorCallback; + window.db = event.target.result; + var request = db.setVersion('1.0'); + request.onsuccess = onSetVersion; + request.onerror = unexpectedErrorCallback; } function test() @@ -73,7 +73,7 @@ function test() } debug('Connecting to indexedDB.'); - var result = indexedDB.open('name'); - result.onsuccess = setVersion; - result.onerror = unexpectedErrorCallback; + var request = indexedDB.open('name'); + request.onsuccess = setVersion; + request.onerror = unexpectedErrorCallback; } diff --git a/chrome/test/data/indexeddb/transaction_test.js b/chrome/test/data/indexeddb/transaction_test.js index 541e96d..434cc99 100644 --- a/chrome/test/data/indexeddb/transaction_test.js +++ b/chrome/test/data/indexeddb/transaction_test.js @@ -16,7 +16,7 @@ function finalTransactionAborted() function employeeNotFound() { debug('Employee not found.'); - shouldBe("event.result", "undefined"); + shouldBe("event.target.result", "undefined"); } function newTransactionAborted() @@ -60,21 +60,21 @@ function onSetVersionComplete() function onSetVersion() { // We are now in a set version transaction. - var setVersionTransaction = event.result; + var setVersionTransaction = event.target.result; setVersionTransaction.oncomplete = onSetVersionComplete; setVersionTransaction.onerror = unexpectedErrorCallback; debug('Creating object store.'); deleteAllObjectStores(db); - var objectStore = db.createObjectStore('employees', {keyPath: 'id'}); + db.createObjectStore('employees', {keyPath: 'id'}); } function setVersion() { - window.db = event.result; - var result = db.setVersion('1.0'); - result.onsuccess = onSetVersion; - result.onerror = unexpectedErrorCallback; + window.db = event.target.result; + var request = db.setVersion('1.0'); + request.onsuccess = onSetVersion; + request.onerror = unexpectedErrorCallback; } function test() @@ -87,7 +87,7 @@ function test() } debug('Connecting to indexedDB.'); - var result = indexedDB.open('name'); - result.onsuccess = setVersion; - result.onerror = unexpectedErrorCallback; + var request = indexedDB.open('name'); + request.onsuccess = setVersion; + request.onerror = unexpectedErrorCallback; } |