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

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

Issue 23539003: Turn on Polymer TodoMVC tests on Dart buildbots (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 3 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 // 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 * conent shell. 7 * conent shell.
8 */ 8 */
9 9
10 // Clear the console before every test run - this is Firebug specific code. 10 // Clear the console before every test run - this is Firebug specific code.
11 if (typeof console == "object" && typeof console.clear == "function") { 11 if (typeof console == "object" && typeof console.clear == "function") {
12 console.clear(); 12 console.clear();
13 } 13 }
14 // Set window onerror to make sure that we catch test harness errors across all 14 // Set window onerror to make sure that we catch test harness errors across all
15 // browsers. 15 // browsers.
16 window.onerror = function (message, url, lineNumber) { 16 window.onerror = function (message, url, lineNumber) {
17 if (url) { 17 if (url) {
18 showErrorAndExit( 18 showErrorAndExit(
19 "\n\n" + url + ":" + lineNumber + ":\n" + message + "\n\n"); 19 "\n\n" + url + ":" + lineNumber + ":\n" + message + "\n\n");
20 } else { 20 } else {
21 showErrorAndExit(message); 21 showErrorAndExit(message);
22 } 22 }
23 window.postMessage('unittest-suite-external-error', '*'); 23 window.postMessage('unittest-suite-external-error', '*');
24 }; 24 };
25 25
26 if (navigator.webkitStartDart) { 26 // Start Dartium/content_shell, unless we are waiting for HTML Imports to load.
27 if (navigator.webkitStartDart && !window.HTMLImports) {
kustermann 2013/08/30 15:34:43 Please elaborate here a bit (in particular mention
Jennifer Messerly 2013/08/30 18:07:36 Attempted to clarify: // Start Dartium/content_sh
27 navigator.webkitStartDart(); 28 navigator.webkitStartDart();
28 } 29 }
29 30
30 // testRunner is provided by content shell. 31 // testRunner is provided by content shell.
31 // It is not available in selenium tests. 32 // It is not available in selenium tests.
32 var testRunner = window.testRunner || window.layoutTestController; 33 var testRunner = window.testRunner || window.layoutTestController;
33 34
34 var waitForDone = false; 35 var waitForDone = false;
35 36
36 // Returns the driving window object if available 37 // Returns the driving window object if available
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 try { 165 try {
165 main(); 166 main();
166 } catch (e) { 167 } catch (e) {
167 dartPrint(e); 168 dartPrint(e);
168 if (e.stack) dartPrint(e.stack); 169 if (e.stack) dartPrint(e.stack);
169 window.postMessage('unittest-suite-fail', '*'); 170 window.postMessage('unittest-suite-fail', '*');
170 return; 171 return;
171 } 172 }
172 window.postMessage('dart-main-done', '*'); 173 window.postMessage('dart-main-done', '*');
173 } 174 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698