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

Unified Diff: lib/unittest/test_controller.js

Issue 10836241: Move unittest from lib to pkg. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 4 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 | « lib/unittest/test_case.dart ('k') | lib/unittest/unittest.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/unittest/test_controller.js
===================================================================
--- lib/unittest/test_controller.js (revision 10655)
+++ lib/unittest/test_controller.js (working copy)
@@ -1,75 +0,0 @@
-// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-/**
- * Test controller logic - used by unit test harness to embed tests in
- * DumpRenderTree.
- */
-
-if (navigator.webkitStartDart) {
- navigator.webkitStartDart();
-}
-
-function processMessage(msg) {
- if (window.layoutTestController) {
- if (msg == 'unittest-suite-done') {
- window.layoutTestController.notifyDone();
- } else if (msg == 'unittest-suite-wait-for-done') {
- window.layoutTestController.startedDartTest = true;
- }
- }
-}
-
-function onReceive(e) {
- processMessage(e.data);
-}
-
-if (window.layoutTestController) {
- window.layoutTestController.dumpAsText();
- window.layoutTestController.waitUntilDone();
-}
-window.addEventListener("message", onReceive, false);
-
-function showErrorAndExit(message) {
- if (message) {
- var element = document.createElement('pre');
- element.innerHTML = message;
- document.body.appendChild(element);
- }
- if (window.layoutTestController) {
- window.layoutTestController.notifyDone();
- }
-}
-
-function onLoad(e) {
- // needed for dartium compilation errors.
- if (window.compilationError) {
- showErrorAndExit(window.compilationError);
- }
-}
-
-window.addEventListener("DOMContentLoaded", onLoad, false);
-
-// If nobody intercepts the error, finish the test.
-window.addEventListener("error", function(e) {
- // needed for dartium compilation errors.
- showErrorAndExit(e && e.message);
-}, false);
-
-document.onreadystatechange = function() {
- if (document.readyState != "loaded") return;
- // If 'startedDartTest' is not set, that means that the test did not have
- // a chance to load. This will happen when a load error occurs in the VM.
- // Give the machine time to start up.
- setTimeout(function() {
- // A window.postMessage might have been enqueued after this timeout.
- // Just sleep another time to give the browser the time to process the
- // posted message.
- setTimeout(function() {
- if (layoutTestController && !layoutTestController.startedDartTest) {
- layoutTestController.notifyDone();
- }
- }, 0);
- }, 50);
-};
« no previous file with comments | « lib/unittest/test_case.dart ('k') | lib/unittest/unittest.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698