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

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

Issue 16844010: Use request.response.done instead of getting future from close() (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 6 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 784 matching lines...) Expand 10 before | Expand all | Expand 10 after
795 return HttpServer.bind(local_ip, 0).then((createdReportServer) { 795 return HttpServer.bind(local_ip, 0).then((createdReportServer) {
796 errorReportingServer = createdReportServer; 796 errorReportingServer = createdReportServer;
797 void errorReportingHandler(HttpRequest request) { 797 void errorReportingHandler(HttpRequest request) {
798 StringBuffer buffer = new StringBuffer(); 798 StringBuffer buffer = new StringBuffer();
799 request.transform(new StringDecoder()).listen((data) { 799 request.transform(new StringDecoder()).listen((data) {
800 buffer.write(data); 800 buffer.write(data);
801 }, onDone: () { 801 }, onDone: () {
802 String back = buffer.toString(); 802 String back = buffer.toString();
803 request.response.headers.set("Access-Control-Allow-Origin", "*"); 803 request.response.headers.set("Access-Control-Allow-Origin", "*");
804 804
805 request.response.close().catchError((error) { 805 request.response.done.catchError((error) {
806 DebugLogger.error("Error getting error from browser" 806 DebugLogger.error("Error getting error from browser"
807 "on uri ${request.uri.path}: $error"); 807 "on uri ${request.uri.path}: $error");
808 }); 808 });
809 request.response.close();
809 DebugLogger.error("Error from browser on : " 810 DebugLogger.error("Error from browser on : "
810 "${request.uri.path}, data: $back"); 811 "${request.uri.path}, data: $back");
811 }, onError: (error) { print(error); }); 812 }, onError: (error) { print(error); });
812 } 813 }
813 errorReportingServer.listen(errorReportingHandler, 814 errorReportingServer.listen(errorReportingHandler,
814 onError: errorHandler); 815 onError: errorHandler);
815 return true; 816 return true;
816 }); 817 });
817 }); 818 });
818 } 819 }
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
988 </head> 989 </head>
989 <body onload="startTesting()"> 990 <body onload="startTesting()">
990 Dart test driver, number of tests: <div id="number"></div> 991 Dart test driver, number of tests: <div id="number"></div>
991 <iframe id="embedded_iframe"></iframe> 992 <iframe id="embedded_iframe"></iframe>
992 </body> 993 </body>
993 </html> 994 </html>
994 """; 995 """;
995 return driverContent; 996 return driverContent;
996 } 997 }
997 } 998 }
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