| OLD | NEW |
| 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:convert" show UTF8, JSON; | 7 import "dart:convert" show UTF8, JSON; |
| 8 import "dart:core"; | 8 import "dart:core"; |
| 9 import "dart:io"; | 9 import "dart:io"; |
| 10 import "dart:math" show min; | 10 import "dart:math" show min; |
| (...skipping 1444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1455 print("URI ${request.uri}"); | 1455 print("URI ${request.uri}"); |
| 1456 print("textResponse $textResponse"); | 1456 print("textResponse $textResponse"); |
| 1457 throw "Error returning content to browser: $error"; | 1457 throw "Error returning content to browser: $error"; |
| 1458 }); | 1458 }); |
| 1459 } | 1459 } |
| 1460 }); | 1460 }); |
| 1461 textResponse.then((String text) async { | 1461 textResponse.then((String text) async { |
| 1462 request.response.write(text); | 1462 request.response.write(text); |
| 1463 await request.listen(null).asFuture(); | 1463 await request.listen(null).asFuture(); |
| 1464 // Ignoring the returned closure as it returns the 'done' future | 1464 // Ignoring the returned closure as it returns the 'done' future |
| 1465 // which alread has catchError installed above. | 1465 // which already has catchError installed above. |
| 1466 request.response.close(); | 1466 request.response.close(); |
| 1467 }); | 1467 }); |
| 1468 } | 1468 } |
| 1469 | 1469 |
| 1470 server.addHandler(driverPath, sendPageHandler); | 1470 server.addHandler(driverPath, sendPageHandler); |
| 1471 server.addHandler(nextTestPath, sendPageHandler); | 1471 server.addHandler(nextTestPath, sendPageHandler); |
| 1472 } | 1472 } |
| 1473 | 1473 |
| 1474 void handleReport(HttpRequest request, String browserId, var testId, | 1474 void handleReport(HttpRequest request, String browserId, var testId, |
| 1475 {bool isStatusUpdate}) { | 1475 {bool isStatusUpdate}) { |
| (...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1937 'exit code: ${result.exitCode}\n' | 1937 'exit code: ${result.exitCode}\n' |
| 1938 'stdout: ${result.stdout}\n' | 1938 'stdout: ${result.stdout}\n' |
| 1939 'stderr: ${result.stderr}'); | 1939 'stderr: ${result.stderr}'); |
| 1940 } else { | 1940 } else { |
| 1941 print('[$message] Successfully uploaded screenshot to $storageUrl'); | 1941 print('[$message] Successfully uploaded screenshot to $storageUrl'); |
| 1942 } | 1942 } |
| 1943 new File(screenshotFile).deleteSync(); | 1943 new File(screenshotFile).deleteSync(); |
| 1944 } | 1944 } |
| 1945 print('--------------------------------------------------------------------'); | 1945 print('--------------------------------------------------------------------'); |
| 1946 } | 1946 } |
| OLD | NEW |