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

Side by Side Diff: LayoutTests/storage/indexeddb/resources/exception-in-event-aborts.js

Issue 59903016: LayoutTests/resources/js-test.js onerror tweak. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Removed setTimeout from js-tests changes. Created 7 years, 1 month 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
OLDNEW
1 if (this.importScripts) { 1 if (this.importScripts) {
2 importScripts('../../../resources/js-test.js'); 2 importScripts('../../../resources/js-test.js');
3 importScripts('shared.js'); 3 importScripts('shared.js');
4 } 4 }
5 5
6 description("Test exceptions in IDBRequest handlers cause aborts."); 6 description("Test exceptions in IDBRequest handlers cause aborts.");
7 7
8 indexedDBTest(prepareDatabase, startTest); 8 indexedDBTest(prepareDatabase, startTest);
9 function prepareDatabase() 9 function prepareDatabase()
10 { 10 {
(...skipping 14 matching lines...) Expand all
25 request = evalAndLog("store.add({x: 'value2', y: 'zzz2'}, 'key2')"); 25 request = evalAndLog("store.add({x: 'value2', y: 'zzz2'}, 'key2')");
26 trans.addEventListener('success', causeException, true); 26 trans.addEventListener('success', causeException, true);
27 request.onerror = unexpectedErrorCallback; 27 request.onerror = unexpectedErrorCallback;
28 } 28 }
29 29
30 function causeException() 30 function causeException()
31 { 31 {
32 debug(""); 32 debug("");
33 evalAndLog("event.preventDefault()"); 33 evalAndLog("event.preventDefault()");
34 debug("Throwing"); 34 debug("Throwing");
35 expectError();
35 throw "this exception is expected"; 36 throw "this exception is expected";
36 } 37 }
37 38
38 function transactionAborted1() 39 function transactionAborted1()
39 { 40 {
40 debug(""); 41 debug("");
41 shouldHaveHadError("this exception is expected"); 42 shouldHaveHadError("this exception is expected");
42 testPassed("The transaction was aborted."); 43 testPassed("The transaction was aborted.");
43 trans = evalAndLog("trans = db.transaction(['storeName'], 'readwrite')"); 44 trans = evalAndLog("trans = db.transaction(['storeName'], 'readwrite')");
44 evalAndLog("trans.onabort = transactionAborted2"); 45 evalAndLog("trans.onabort = transactionAborted2");
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 request.onerror = unexpectedErrorCallback; 89 request.onerror = unexpectedErrorCallback;
89 } 90 }
90 91
91 function transactionCompleted2() 92 function transactionCompleted2()
92 { 93 {
93 debug(""); 94 debug("");
94 testPassed("The transaction completed."); 95 testPassed("The transaction completed.");
95 debug(""); 96 debug("");
96 finishJSTest(); 97 finishJSTest();
97 } 98 }
OLDNEW
« no previous file with comments | « LayoutTests/storage/indexeddb/exception-in-event-aborts-expected.txt ('k') | LayoutTests/svg/dom/SVGViewSpec-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698