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

Side by Side Diff: pkg/analyzer/lib/src/generated/testing/html_factory.dart

Issue 630513002: Uncomment and clean up all_the_rest.dart tests. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 2 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
OLDNEW
(Empty)
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
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.
4
5 // This code was auto-generated, is not intended to be edited, and is subject to
6 // significant change. Please see the README file for more information.
7
8 library engine.testing.html_factory;
9
10 import 'package:analyzer/src/generated/html.dart';
11
12 /**
13 * Utility methods to create HTML nodes.
14 */
15 class HtmlFactory {
16 static XmlAttributeNode attribute(String name, String value) {
17 Token nameToken = stringToken(name);
18 Token equalsToken = new Token.con1(TokenType.EQ, 0);
19 Token valueToken = stringToken(value);
20 return new XmlAttributeNode(nameToken, equalsToken, valueToken);
21 }
22
23 static Token gtToken() {
24 return new Token.con1(TokenType.GT, 0);
25 }
26
27 static Token ltToken() {
28 return new Token.con1(TokenType.LT, 0);
29 }
30
31 static Token ltsToken() {
32 return new Token.con1(TokenType.LT_SLASH, 0);
33 }
34
35 static HtmlScriptTagNode scriptTag(List<XmlAttributeNode> attributes) {
36 return new HtmlScriptTagNode(
37 ltToken(),
38 stringToken("script"),
39 attributes,
40 sgtToken(),
41 null,
42 null,
43 null,
44 null);
45 }
46
47 static HtmlScriptTagNode scriptTagWithContent(String contents,
48 List<XmlAttributeNode> attributes) {
49 Token attributeEnd = gtToken();
50 Token contentToken = stringToken(contents);
51 attributeEnd.setNext(contentToken);
52 Token contentEnd = ltsToken();
53 contentToken.setNext(contentEnd);
54 return new HtmlScriptTagNode(
55 ltToken(),
56 stringToken("script"),
57 attributes,
58 attributeEnd,
59 null,
60 contentEnd,
61 stringToken("script"),
62 gtToken());
63 }
64
65 static Token sgtToken() {
66 return new Token.con1(TokenType.SLASH_GT, 0);
67 }
68
69 static Token stringToken(String value) {
70 return new Token.con2(TokenType.STRING, 0, value);
71 }
72
73 static XmlTagNode tagNode(String name, List<XmlAttributeNode> attributes) {
74 return new XmlTagNode(
75 ltToken(),
76 stringToken(name),
77 attributes,
78 sgtToken(),
79 null,
80 null,
81 null,
82 null);
83 }
84 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/generated/resolver.dart ('k') | pkg/analyzer/test/generated/test_support.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698