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

Side by Side Diff: tests/compiler/dart2js/zero_termination_test.dart

Issue 2345083003: dart2js: run dartfmt on tests (Closed)
Patch Set: revert another multipart test Created 4 years, 3 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
« no previous file with comments | « tests/compiler/dart2js/world_test.dart ('k') | tests/compiler/dart2js_extra/10216a_test.dart » ('j') | 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) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 4
5 // A regression test for issue 22667. 5 // A regression test for issue 22667.
6 // 6 //
7 // Makes sure that we don't print a '\0' character for files that are not 7 // Makes sure that we don't print a '\0' character for files that are not
8 // properly new-line terminated. 8 // properly new-line terminated.
9 library zero_termination_test; 9 library zero_termination_test;
10 10
(...skipping 14 matching lines...) Expand all
25 response.statusCode = HttpStatus.NOT_FOUND; 25 response.statusCode = HttpStatus.NOT_FOUND;
26 response.close(); 26 response.close();
27 } 27 }
28 28
29 Future handleRequest(HttpRequest request) { 29 Future handleRequest(HttpRequest request) {
30 final String path = request.uri.path.substring(1); 30 final String path = request.uri.path.substring(1);
31 final Uri requestPath = pathOfData.resolve(path); 31 final Uri requestPath = pathOfData.resolve(path);
32 final File file = new File(requestPath.toFilePath()); 32 final File file = new File(requestPath.toFilePath());
33 return file.exists().then((bool found) { 33 return file.exists().then((bool found) {
34 if (found) { 34 if (found) {
35 file.openRead() 35 file.openRead().pipe(request.response).catchError((e) {
36 .pipe(request.response) 36 _sendNotFound(request.response);
37 .catchError((e) { _sendNotFound(request.response); }); 37 });
38 } else { 38 } else {
39 _sendNotFound(request.response); 39 _sendNotFound(request.response);
40 } 40 }
41 }); 41 });
42 } 42 }
43 43
44 void cleanup() { 44 void cleanup() {
45 File outFile = new File(outFilePath); 45 File outFile = new File(outFilePath);
46 if (outFile.existsSync()) { 46 if (outFile.existsSync()) {
47 outFile.deleteSync(); 47 outFile.deleteSync();
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 try { 79 try {
80 await cleanup(); 80 await cleanup();
81 check(await launchDart2Js(args, noStdoutEncoding: true)); 81 check(await launchDart2Js(args, noStdoutEncoding: true));
82 } finally { 82 } finally {
83 await server.close(); 83 await server.close();
84 await cleanup(); 84 await cleanup();
85 } 85 }
86 } 86 }
87 87
88 Future testHttp() { 88 Future testHttp() {
89 return HttpServer.bind(InternetAddress.LOOPBACK_IP_V4, 0) 89 return HttpServer
90 .bind(InternetAddress.LOOPBACK_IP_V4, 0)
90 .then((HttpServer server) => serverRunning(server)); 91 .then((HttpServer server) => serverRunning(server));
91 } 92 }
92 93
93 runTests() async { 94 runTests() async {
94 tempDir = Directory.systemTemp.createTempSync('directory_test'); 95 tempDir = Directory.systemTemp.createTempSync('directory_test');
95 outFilePath = path.join(tempDir.path, "out.js"); 96 outFilePath = path.join(tempDir.path, "out.js");
96 97
97 try { 98 try {
98 await testFile(); 99 await testFile();
99 await testHttp(); 100 await testHttp();
100 } finally { 101 } finally {
101 await tempDir.delete(recursive:true); 102 await tempDir.delete(recursive: true);
102 } 103 }
103 } 104 }
104 105
105 main() { 106 main() {
106 asyncStart(); 107 asyncStart();
107 runTests().whenComplete(asyncEnd); 108 runTests().whenComplete(asyncEnd);
108 } 109 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/world_test.dart ('k') | tests/compiler/dart2js_extra/10216a_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698