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

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

Issue 23480032: remove use of deprecatedFutureValue from html5lib (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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 | 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 library tokenizer_test; 1 library tokenizer_test;
2 2
3 // Note: mirrors used to match the getattr usage in the original test 3 // Note: mirrors used to match the getattr usage in the original test
4 import 'dart:async'; 4 import 'dart:async';
5 import 'dart:convert'; 5 import 'dart:convert';
6 import 'dart:io'; 6 import 'dart:io';
7 import 'dart:mirrors'; 7 import 'dart:mirrors';
8 import 'package:path/path.dart' as pathos; 8 import 'package:path/path.dart' as pathos;
9 import 'package:unittest/unittest.dart'; 9 import 'package:unittest/unittest.dart';
10 import 'package:html5lib/src/char_encodings.dart'; 10 import 'package:html5lib/src/char_encodings.dart';
(...skipping 15 matching lines...) Expand all
26 26
27 List parse(String str) { 27 List parse(String str) {
28 // Note: we need to pass bytes to the tokenizer if we want it to handle BOM. 28 // Note: we need to pass bytes to the tokenizer if we want it to handle BOM.
29 var bytes = codepointsToUtf8(toCodepoints(str)); 29 var bytes = codepointsToUtf8(toCodepoints(str));
30 var tokenizer = new HtmlTokenizer(bytes, encoding: 'utf-8'); 30 var tokenizer = new HtmlTokenizer(bytes, encoding: 'utf-8');
31 outputTokens = []; 31 outputTokens = [];
32 32
33 // Note: we can't get a closure of the state method. However, we can 33 // Note: we can't get a closure of the state method. However, we can
34 // create a new closure to invoke it via mirrors. 34 // create a new closure to invoke it via mirrors.
35 var mtok = reflect(tokenizer); 35 var mtok = reflect(tokenizer);
36 tokenizer.state = () => deprecatedFutureValue( 36 tokenizer.state = () =>
37 mtok.invokeAsync(new Symbol(_state), const [])).reflectee; 37 mtok.invoke(new Symbol(_state), const []).reflectee;
38 38
39 if (_lastStartTag != null) { 39 if (_lastStartTag != null) {
40 tokenizer.currentToken = new StartTagToken(_lastStartTag); 40 tokenizer.currentToken = new StartTagToken(_lastStartTag);
41 } 41 }
42 42
43 while (tokenizer.moveNext()) { 43 while (tokenizer.moveNext()) {
44 var token = tokenizer.current; 44 var token = tokenizer.current;
45 switch (token.kind) { 45 switch (token.kind) {
46 case TokenKind.characters: 46 case TokenKind.characters:
47 processCharacters(token); 47 processCharacters(token);
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 for (var initialState in testInfo["initialStates"]) { 261 for (var initialState in testInfo["initialStates"]) {
262 test(testInfo["description"], () { 262 test(testInfo["description"], () {
263 testInfo["initialState"] = camelCase(initialState); 263 testInfo["initialState"] = camelCase(initialState);
264 runTokenizerTest(testInfo); 264 runTokenizerTest(testInfo);
265 }); 265 });
266 } 266 }
267 } 267 }
268 }); 268 });
269 } 269 }
270 } 270 }
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