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

Side by Side Diff: pkg/third_party/html5lib/test/support.dart

Issue 52573002: Remove uses of Options from pkg, samples, tests, and third_party directories. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Edit comment Created 7 years, 1 month 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 | « pkg/third_party/html5lib/test/run_all.dart ('k') | pkg/watcher/example/watch.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 /** Support code for the tests in this directory. */ 1 /** Support code for the tests in this directory. */
2 library support; 2 library support;
3 3
4 import 'dart:async'; 4 import 'dart:async';
5 import 'dart:io'; 5 import 'dart:io';
6 import 'dart:collection'; 6 import 'dart:collection';
7 import 'package:path/path.dart' as path; 7 import 'package:path/path.dart' as path;
8 import 'package:html5lib/src/treebuilder.dart'; 8 import 'package:html5lib/src/treebuilder.dart';
9 import 'package:html5lib/dom.dart'; 9 import 'package:html5lib/dom.dart';
10 import 'package:html5lib/dom_parsing.dart'; 10 import 'package:html5lib/dom_parsing.dart';
11 11
12 typedef TreeBuilder TreeBuilderFactory(bool namespaceHTMLElements); 12 typedef TreeBuilder TreeBuilderFactory(bool namespaceHTMLElements);
13 13
14 Map _treeTypes; 14 Map _treeTypes;
15 Map<String, TreeBuilderFactory> get treeTypes { 15 Map<String, TreeBuilderFactory> get treeTypes {
16 if (_treeTypes == null) { 16 if (_treeTypes == null) {
17 // TODO(jmesserly): add DOM here once it's implemented 17 // TODO(jmesserly): add DOM here once it's implemented
18 _treeTypes = { "simpletree": (useNs) => new TreeBuilder(useNs) }; 18 _treeTypes = { "simpletree": (useNs) => new TreeBuilder(useNs) };
19 } 19 }
20 return _treeTypes; 20 return _treeTypes;
21 } 21 }
22 22
23 final testDataDir = path.join(path.dirname(new Options().script), 'data'); 23 final testDataDir = path.join(path.dirname(Platform.script), 'data');
24 24
25 Iterable<String> getDataFiles(String subdirectory) { 25 Iterable<String> getDataFiles(String subdirectory) {
26 var dir = new Directory(path.join(testDataDir, subdirectory)); 26 var dir = new Directory(path.join(testDataDir, subdirectory));
27 return dir.listSync().where((f) => f is File).map((f) => f.path); 27 return dir.listSync().where((f) => f is File).map((f) => f.path);
28 } 28 }
29 29
30 // TODO(jmesserly): make this class simpler. We could probably split on 30 // TODO(jmesserly): make this class simpler. We could probably split on
31 // "\n#" instead of newline and remove a lot of code. 31 // "\n#" instead of newline and remove a lot of code.
32 class TestData extends IterableBase<Map> { 32 class TestData extends IterableBase<Map> {
33 final String _text; 33 final String _text;
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 key = "${attr.prefix} ${attr.name}"; 159 key = "${attr.prefix} ${attr.name}";
160 } 160 }
161 _newline(); 161 _newline();
162 _str.write('$key="$v"'); 162 _str.write('$key="$v"');
163 } 163 }
164 indent -= 2; 164 indent -= 2;
165 } 165 }
166 visitChildren(node); 166 visitChildren(node);
167 } 167 }
168 } 168 }
OLDNEW
« no previous file with comments | « pkg/third_party/html5lib/test/run_all.dart ('k') | pkg/watcher/example/watch.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698