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

Side by Side Diff: tools/testing/dart/browser_controller.dart

Issue 23005022: Catch race condition where we are shutting down a browser and that browser is sending back results. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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 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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 library browser; 4 library browser;
5 5
6 import "dart:async"; 6 import "dart:async";
7 import "dart:core"; 7 import "dart:core";
8 import "dart:io"; 8 import "dart:io";
9 9
10 import 'android.dart'; 10 import 'android.dart';
(...skipping 636 matching lines...) Expand 10 before | Expand all | Expand 10 after
647 647
648 var timedOut = []; 648 var timedOut = [];
649 649
650 void handleResults(String browserId, String output, int testId) { 650 void handleResults(String browserId, String output, int testId) {
651 var status = browserStatus[browserId]; 651 var status = browserStatus[browserId];
652 if (testCache.containsKey(testId)) { 652 if (testCache.containsKey(testId)) {
653 doubleReportingTests.add(testId); 653 doubleReportingTests.add(testId);
654 return; 654 return;
655 } 655 }
656 656
657 if (status.timeout) { 657 if (status == null || status.timeout) {
658 // We don't do anything, this browser is currently being killed and 658 // We don't do anything, this browser is currently being killed and
659 // replaced. 659 // replaced. The browser here can be null if we decided to kill the
660 // browser.
660 } else if (status.currentTest != null) { 661 } else if (status.currentTest != null) {
661 status.currentTest.timeoutTimer.cancel(); 662 status.currentTest.timeoutTimer.cancel();
662 status.currentTest.stopwatch.stop(); 663 status.currentTest.stopwatch.stop();
663 664
664 if (status.currentTest.id != testId) { 665 if (status.currentTest.id != testId) {
665 print("Expected test id ${status.currentTest.id} for" 666 print("Expected test id ${status.currentTest.id} for"
666 "${status.currentTest.url}"); 667 "${status.currentTest.url}");
667 print("Got test id ${testId}"); 668 print("Got test id ${testId}");
668 print("Last test id was ${status.lastTest.id} for " 669 print("Last test id was ${status.lastTest.id} for "
669 "${status.currentTest.url}"); 670 "${status.currentTest.url}");
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after
1072 </head> 1073 </head>
1073 <body onload="startTesting()"> 1074 <body onload="startTesting()">
1074 Dart test driver, number of tests: <div id="number"></div> 1075 Dart test driver, number of tests: <div id="number"></div>
1075 <iframe id="embedded_iframe"></iframe> 1076 <iframe id="embedded_iframe"></iframe>
1076 </body> 1077 </body>
1077 </html> 1078 </html>
1078 """; 1079 """;
1079 return driverContent; 1080 return driverContent;
1080 } 1081 }
1081 } 1082 }
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