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

Side by Side Diff: LayoutTests/storage/indexeddb/resources/transaction-error.js

Issue 243523003: Fire window.onerror for uncaught IndexedDB errors (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Include error name Created 6 years, 8 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 | Annotate | Revision Log
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 IDBTransaction.error cases."); 6 description("Test IDBTransaction.error cases.");
7 7
8 indexedDBTest(prepareDatabase, startTest); 8 indexedDBTest(prepareDatabase, startTest);
9 function prepareDatabase() 9 function prepareDatabase()
10 { 10 {
(...skipping 28 matching lines...) Expand all
39 } 39 }
40 40
41 function testErrorFromRequest() 41 function testErrorFromRequest()
42 { 42 {
43 debug(""); 43 debug("");
44 debug("If the transaction is aborted due to a request error that is not prev ented, IDBTransaction.error should match:"); 44 debug("If the transaction is aborted due to a request error that is not prev ented, IDBTransaction.error should match:");
45 evalAndLog("trans = db.transaction('storeName', 'readwrite')"); 45 evalAndLog("trans = db.transaction('storeName', 'readwrite')");
46 evalAndLog("request = trans.objectStore('storeName').add('value2', 'key')"); 46 evalAndLog("request = trans.objectStore('storeName').add('value2', 'key')");
47 request.onsuccess = unexpectedSuccessCallback; 47 request.onsuccess = unexpectedSuccessCallback;
48 request.onerror = function() { 48 request.onerror = function() {
49 expectError();
49 shouldBe("request.error.name", "'ConstraintError'"); 50 shouldBe("request.error.name", "'ConstraintError'");
50 evalAndLog("request_error = request.error"); 51 evalAndLog("request_error = request.error");
51 }; 52 };
52 trans.oncomplete = unexpectedCompleteCallback; 53 trans.oncomplete = unexpectedCompleteCallback;
53 trans.onabort = function() { 54 trans.onabort = function() {
54 debug("Transaction received abort event."); 55 debug("Transaction received abort event.");
55 shouldBeNonNull("trans.error"); 56 shouldBeNonNull("trans.error");
56 debug("trans.error.message = " + trans.error.message); 57 debug("trans.error.message = " + trans.error.message);
57 shouldBeNonNull("trans.error.message"); 58 shouldBeNonNull("trans.error.message");
58 shouldBe("trans.error", "request_error"); 59 shouldBe("trans.error", "request_error");
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 debug("trans.error.message = " + trans.error.message); 121 debug("trans.error.message = " + trans.error.message);
121 shouldBeNonNull("trans.error.message"); 122 shouldBeNonNull("trans.error.message");
122 debug("Note: This fails because of http://wkb.ug/37327"); 123 debug("Note: This fails because of http://wkb.ug/37327");
123 shouldNotBe("trans.error.message.indexOf(indexName)", "-1"); 124 shouldNotBe("trans.error.message.indexOf(indexName)", "-1");
124 debug(""); 125 debug("");
125 finishJSTest(); 126 finishJSTest();
126 }; 127 };
127 }; 128 };
128 }; 129 };
129 } 130 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698