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

Side by Side Diff: tests/standalone/io/skipping_dart2js_compilations_test.dart

Issue 12609004: Change all File APIs to make the mode and encoding arguments named (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed review comments and changed other use places Created 7 years, 9 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 | « tests/standalone/io/file_write_as_test.dart ('k') | utils/lib/file_system_vm.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) 2012, 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 4
5 /* 5 /*
6 * This test makes sure that the "skipping Dart2Js compilations if the output is 6 * This test makes sure that the "skipping Dart2Js compilations if the output is
7 * already up to date" feature does work as it should. 7 * already up to date" feature does work as it should.
8 * Therefore this test ensures that compilations are only skipped if the last 8 * Therefore this test ensures that compilations are only skipped if the last
9 * modified date of the output of a dart2js compilation is newer than 9 * modified date of the output of a dart2js compilation is newer than
10 * - the the dart application to compile (including it's dependencies) 10 * - the the dart application to compile (including it's dependencies)
11 * - the dart2js snapshot 11 * - the dart2js snapshot
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 return suite.TestUtils.absolutePath(new Path(tempDir.path) 97 return suite.TestUtils.absolutePath(new Path(tempDir.path)
98 .append('test_dart2js.snapshot')); 98 .append('test_dart2js.snapshot'));
99 } 99 }
100 100
101 void touchFile(File file) { 101 void touchFile(File file) {
102 _writeToFile(file, _readFile(file)); 102 _writeToFile(file, _readFile(file));
103 } 103 }
104 104
105 void _writeToFile(File file, String content) { 105 void _writeToFile(File file, String content) {
106 if (content != null) { 106 if (content != null) {
107 var fd = new File(file.fullPathSync()).openSync(FileMode.WRITE); 107 var fd = new File(file.fullPathSync()).openSync(mode: FileMode.WRITE);
108 fd.writeStringSync(content); 108 fd.writeStringSync(content);
109 fd.closeSync(); 109 fd.closeSync();
110 } 110 }
111 } 111 }
112 112
113 String _readFile(File file) { 113 String _readFile(File file) {
114 return file.readAsStringSync(); 114 return file.readAsStringSync();
115 } 115 }
116 116
117 File _createFile(Path path) { 117 File _createFile(Path path) {
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 cleanup(); 240 cleanup();
241 throw error; 241 throw error;
242 }).then((_) { 242 }).then((_) {
243 cleanup(); 243 cleanup();
244 }); 244 });
245 } 245 }
246 // We need to wait some time to make sure that the files we 'touch' get a 246 // We need to wait some time to make sure that the files we 'touch' get a
247 // bigger timestamp than the old ones 247 // bigger timestamp than the old ones
248 new Timer(new Duration(seconds: 1), touchFilesAndRunTests); 248 new Timer(new Duration(seconds: 1), touchFilesAndRunTests);
249 } 249 }
OLDNEW
« no previous file with comments | « tests/standalone/io/file_write_as_test.dart ('k') | utils/lib/file_system_vm.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698