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

Side by Side Diff: tools/html_json_doc/test/html_json_doc_test.dart

Issue 11878015: Default constructor for dart:io Path now handles native Windows paths. Path() now does the same as… (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Don't change tools/version.dart until the binaries are updated. Created 7 years, 11 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 | « tools/html_json_doc/lib/json_to_html.dart ('k') | utils/apidoc/apidoc.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 import '../../../pkg/unittest/lib/unittest.dart'; 1 import '../../../pkg/unittest/lib/unittest.dart';
2 import '../lib/html_to_json.dart' as html_to_json; 2 import '../lib/html_to_json.dart' as html_to_json;
3 import '../lib/json_to_html.dart' as json_to_html; 3 import '../lib/json_to_html.dart' as json_to_html;
4 import 'dart:json'; 4 import 'dart:json';
5 import 'dart:io'; 5 import 'dart:io';
6 6
7 void main() { 7 void main() {
8 var scriptPath = new Path(new Options().script).directoryPath.toString(); 8 var scriptPath = new Path(new Options().script).directoryPath.toString();
9 9
10 test('HTML Doc to JSON', () { 10 test('HTML Doc to JSON', () {
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 }; 74 };
75 } 75 }
76 76
77 Future _copyFiles(Path fromDir, Path toDir) { 77 Future _copyFiles(Path fromDir, Path toDir) {
78 // First copy the files into a new place to keep the old files. 78 // First copy the files into a new place to keep the old files.
79 final completer = new Completer(); 79 final completer = new Completer();
80 final htmlDir = new Directory.fromPath(fromDir); 80 final htmlDir = new Directory.fromPath(fromDir);
81 final lister = htmlDir.list(recursive: false); 81 final lister = htmlDir.list(recursive: false);
82 82
83 lister.onFile = (String path) { 83 lister.onFile = (String path) {
84 final name = new Path.fromNative(path).filename; 84 final name = new Path(path).filename;
85 85
86 // Ignore private classes. 86 // Ignore private classes.
87 if (name.startsWith('_')) return; 87 if (name.startsWith('_')) return;
88 88
89 // Ignore non-dart files. 89 // Ignore non-dart files.
90 if (!name.endsWith('.dart')) return; 90 if (!name.endsWith('.dart')) return;
91 91
92 File file = new File(path); 92 File file = new File(path);
93 File newFile = new File.fromPath(toDir.append(name)); 93 File newFile = new File.fromPath(toDir.append(name));
94 94
95 var outputStream = newFile.openOutputStream(); 95 var outputStream = newFile.openOutputStream();
96 outputStream.writeString(file.readAsStringSync()); 96 outputStream.writeString(file.readAsStringSync());
97 }; 97 };
98 98
99 lister.onDone = (_) { 99 lister.onDone = (_) {
100 completer.complete(null); 100 completer.complete(null);
101 }; 101 };
102 return completer.future; 102 return completer.future;
103 } 103 }
OLDNEW
« no previous file with comments | « tools/html_json_doc/lib/json_to_html.dart ('k') | utils/apidoc/apidoc.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698