| 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 LineSplitter, UTF8; | 7 import "dart:convert" show LineSplitter, UTF8; |
| 8 import "dart:core"; | 8 import "dart:core"; |
| 9 import "dart:io"; | 9 import "dart:io"; |
| 10 | 10 |
| (...skipping 1290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1301 var browserId = request.uri.path.substring(startedPath.length + 1); | 1301 var browserId = request.uri.path.substring(startedPath.length + 1); |
| 1302 var testId = | 1302 var testId = |
| 1303 int.parse(request.uri.queryParameters["id"].split("=")[1]); | 1303 int.parse(request.uri.queryParameters["id"].split("=")[1]); |
| 1304 handleStarted(request, browserId, testId); | 1304 handleStarted(request, browserId, testId); |
| 1305 return; | 1305 return; |
| 1306 } | 1306 } |
| 1307 var textResponse = ""; | 1307 var textResponse = ""; |
| 1308 if (request.uri.path.startsWith(driverPath)) { | 1308 if (request.uri.path.startsWith(driverPath)) { |
| 1309 var browserId = request.uri.path.substring(driverPath.length + 1); | 1309 var browserId = request.uri.path.substring(driverPath.length + 1); |
| 1310 textResponse = getDriverPage(browserId); | 1310 textResponse = getDriverPage(browserId); |
| 1311 request.response.headers.set('Content-Type', 'text/html'); |
| 1311 } else if (request.uri.path.startsWith(nextTestPath)) { | 1312 } else if (request.uri.path.startsWith(nextTestPath)) { |
| 1312 var browserId = request.uri.path.substring(nextTestPath.length + 1); | 1313 var browserId = request.uri.path.substring(nextTestPath.length + 1); |
| 1313 textResponse = getNextTest(browserId); | 1314 textResponse = getNextTest(browserId); |
| 1315 request.response.headers.set('Content-Type', 'text/plain'); |
| 1314 } else { | 1316 } else { |
| 1315 // /favicon.ico requests | 1317 // /favicon.ico requests |
| 1316 } | 1318 } |
| 1317 request.response.write(textResponse); | 1319 request.response.write(textResponse); |
| 1318 request.listen((_) {}, onDone: request.response.close); | 1320 request.listen((_) {}, onDone: request.response.close); |
| 1319 request.response.done.catchError((error) { | 1321 request.response.done.catchError((error) { |
| 1320 if (!underTermination) { | 1322 if (!underTermination) { |
| 1321 print("URI ${request.uri}"); | 1323 print("URI ${request.uri}"); |
| 1322 print("Textresponse $textResponse"); | 1324 print("Textresponse $textResponse"); |
| 1323 throw "Error returning content to browser: $error"; | 1325 throw "Error returning content to browser: $error"; |
| (...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1602 Dart test driver, number of tests: <div id="number"></div><br> | 1604 Dart test driver, number of tests: <div id="number"></div><br> |
| 1603 Currently executing: <div id="currently_executing"></div><br> | 1605 Currently executing: <div id="currently_executing"></div><br> |
| 1604 Unhandled error: <div id="unhandled_error"></div> | 1606 Unhandled error: <div id="unhandled_error"></div> |
| 1605 <iframe id="embedded_iframe"></iframe> | 1607 <iframe id="embedded_iframe"></iframe> |
| 1606 </body> | 1608 </body> |
| 1607 </html> | 1609 </html> |
| 1608 """; | 1610 """; |
| 1609 return driverContent; | 1611 return driverContent; |
| 1610 } | 1612 } |
| 1611 } | 1613 } |
| OLD | NEW |