OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013, the Dart project authors. | 2 * Copyright (c) 2013, the Dart project authors. |
3 * | 3 * |
4 * Licensed under the Eclipse Public License v1.0 (the "License"); you may not u
se this file except | 4 * Licensed under the Eclipse Public License v1.0 (the "License"); you may not u
se this file except |
5 * in compliance with the License. You may obtain a copy of the License at | 5 * in compliance with the License. You may obtain a copy of the License at |
6 * | 6 * |
7 * http://www.eclipse.org/legal/epl-v10.html | 7 * http://www.eclipse.org/legal/epl-v10.html |
8 * | 8 * |
9 * Unless required by applicable law or agreed to in writing, software distribut
ed under the License | 9 * Unless required by applicable law or agreed to in writing, software distribut
ed under the License |
10 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY K
IND, either express | 10 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY K
IND, either express |
11 * or implied. See the License for the specific language governing permissions a
nd limitations under | 11 * or implied. See the License for the specific language governing permissions a
nd limitations under |
12 * the License. | 12 * the License. |
13 */ | 13 */ |
14 package com.google.dart.engine.internal.html; | 14 package com.google.dart.engine.internal.html; |
15 | 15 |
16 import com.google.dart.engine.EngineTestCase; | 16 import com.google.dart.engine.EngineTestCase; |
| 17 import com.google.dart.engine.error.GatheringErrorListener; |
17 import com.google.dart.engine.html.parser.HtmlParseResult; | 18 import com.google.dart.engine.html.parser.HtmlParseResult; |
18 import com.google.dart.engine.html.parser.HtmlParser; | 19 import com.google.dart.engine.html.parser.HtmlParser; |
19 import com.google.dart.engine.html.scanner.HtmlScanResult; | 20 import com.google.dart.engine.html.scanner.HtmlScanResult; |
20 import com.google.dart.engine.html.scanner.HtmlScanner; | 21 import com.google.dart.engine.html.scanner.HtmlScanner; |
21 import com.google.dart.engine.source.SourceFactory; | 22 import com.google.dart.engine.source.SourceFactory; |
22 import com.google.dart.engine.source.TestSource; | 23 import com.google.dart.engine.source.TestSource; |
23 | 24 |
24 import static com.google.dart.engine.utilities.io.FileUtilities2.createFile; | 25 import static com.google.dart.engine.utilities.io.FileUtilities2.createFile; |
25 | 26 |
26 public class HtmlTagInfoBuilderTest extends EngineTestCase { | 27 public class HtmlTagInfoBuilderTest extends EngineTestCase { |
(...skipping 19 matching lines...) Expand all Loading... |
46 | 47 |
47 private HtmlParseResult parse(String contents) throws Exception { | 48 private HtmlParseResult parse(String contents) throws Exception { |
48 SourceFactory factory = new SourceFactory(); | 49 SourceFactory factory = new SourceFactory(); |
49 TestSource source = new TestSource( | 50 TestSource source = new TestSource( |
50 factory.getContentCache(), | 51 factory.getContentCache(), |
51 createFile("/test.dart"), | 52 createFile("/test.dart"), |
52 contents); | 53 contents); |
53 HtmlScanner scanner = new HtmlScanner(source); | 54 HtmlScanner scanner = new HtmlScanner(source); |
54 source.getContents(scanner); | 55 source.getContents(scanner); |
55 HtmlScanResult scanResult = scanner.getResult(); | 56 HtmlScanResult scanResult = scanner.getResult(); |
56 HtmlParseResult result = new HtmlParser(source).parse(scanResult); | 57 GatheringErrorListener errorListener = new GatheringErrorListener(); |
| 58 HtmlParseResult result = new HtmlParser(source, errorListener).parse(scanRes
ult); |
| 59 errorListener.assertNoErrors(); |
57 return result; | 60 return result; |
58 } | 61 } |
59 } | 62 } |
OLD | NEW |