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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/inspector-unit/inspector-unit-test.js

Issue 2392433003: DevTools: Catch async errors in unit tests (Closed)
Patch Set: Style Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/inspector-unit/test-failure.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/http/tests/inspector-unit/inspector-unit-test.js
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector-unit/inspector-unit-test.js b/third_party/WebKit/LayoutTests/http/tests/inspector-unit/inspector-unit-test.js
index 5c656b18d64615f8cca4b62c34841be992d96131..ccda7a9536991c889b8d9c187d28e8a693aa5846 100644
--- a/third_party/WebKit/LayoutTests/http/tests/inspector-unit/inspector-unit-test.js
+++ b/third_party/WebKit/LayoutTests/http/tests/inspector-unit/inspector-unit-test.js
@@ -56,6 +56,13 @@ var UnitTest = {};
console.log(text);
}
+ function completeTestOnError(message, source, lineno, colno, error)
+ {
+ UnitTest.addResult("TEST ENDED IN ERROR: " + error.stack);
+ UnitTest.completeTest();
+ }
+ window.onerror = completeTestOnError;
+
Runtime.startApplication("/inspector-unit/inspector-unit-test").then(runTest);
function runTest()
@@ -84,11 +91,6 @@ var UnitTest = {};
WebInspector.inspectorView.showInitialPanel();
rootView.attachToDocument(document);
- try {
- test();
- } catch (e) {
- UnitTest.addResult("TEST ENDED IN ERROR: " + e.stack);
- UnitTest.completeTest();
- }
+ test();
}
})();
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/inspector-unit/test-failure.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698