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

Side by Side Diff: pkg/unittest/test_controller.js

Issue 11339039: Add additional test harness error handling to test_controller. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 /** 5 /**
6 * Test controller logic - used by unit test harness to embed tests in 6 * Test controller logic - used by unit test harness to embed tests in
7 * DumpRenderTree. 7 * DumpRenderTree.
8 */ 8 */
9 9
10 // Clear the console before every test run - this is Firebug specific code.
11 if (typeof console == "object" && typeof console.clear == "function") {
12 console.clear();
13 }
14 // Set window onerror to make sure that we catch test harness errors across all
15 // browsers.
16 window.onerror = function (message, url, lineNumber) {
Siggi Cherem (dart-lang) 2012/10/30 17:36:53 could this be problematic in non-firefox browsers?
ricow1 2012/10/31 10:17:53 This is not firefox only: http://www.w3.org/wiki/D
17 showErrorAndExit("\n\n" + url + ":" + lineNumber + ":\n" + message + "\n\n");
18 window.postMessage('unittest-suite-external-error', '*');
19 };
20
10 if (navigator.webkitStartDart) { 21 if (navigator.webkitStartDart) {
11 navigator.webkitStartDart(); 22 navigator.webkitStartDart();
12 } 23 }
13 24
14 // testRunner is provided by DRT or WebKit's layout tests. 25 // testRunner is provided by DRT or WebKit's layout tests.
15 // It is not available in selenium tests. 26 // It is not available in selenium tests.
16 var testRunner = window.testRunner || window.layoutTestController; 27 var testRunner = window.testRunner || window.layoutTestController;
17 28
18 var waitForDone = false; 29 var waitForDone = false;
19 30
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 function dartMainRunner(main) { 123 function dartMainRunner(main) {
113 window.postMessage('dart-calling-main', '*'); 124 window.postMessage('dart-calling-main', '*');
114 try { 125 try {
115 main(); 126 main();
116 } catch (e) { 127 } catch (e) {
117 window.postMessage('unittest-suite-fail', '*'); 128 window.postMessage('unittest-suite-fail', '*');
118 return; 129 return;
119 } 130 }
120 window.postMessage('dart-main-done', '*'); 131 window.postMessage('dart-main-done', '*');
121 } 132 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698