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

Unified 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 side-by-side diff with in-line comments
Download patch
« 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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/generated/testing/html_factory.dart
diff --git a/pkg/analyzer/lib/src/generated/testing/html_factory.dart b/pkg/analyzer/lib/src/generated/testing/html_factory.dart
new file mode 100644
index 0000000000000000000000000000000000000000..514ceaa82102b9794894f50a9046c5dac41df258
--- /dev/null
+++ b/pkg/analyzer/lib/src/generated/testing/html_factory.dart
@@ -0,0 +1,84 @@
+// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// This code was auto-generated, is not intended to be edited, and is subject to
+// significant change. Please see the README file for more information.
+
+library engine.testing.html_factory;
+
+import 'package:analyzer/src/generated/html.dart';
+
+/**
+ * Utility methods to create HTML nodes.
+ */
+class HtmlFactory {
+ static XmlAttributeNode attribute(String name, String value) {
+ Token nameToken = stringToken(name);
+ Token equalsToken = new Token.con1(TokenType.EQ, 0);
+ Token valueToken = stringToken(value);
+ return new XmlAttributeNode(nameToken, equalsToken, valueToken);
+ }
+
+ static Token gtToken() {
+ return new Token.con1(TokenType.GT, 0);
+ }
+
+ static Token ltToken() {
+ return new Token.con1(TokenType.LT, 0);
+ }
+
+ static Token ltsToken() {
+ return new Token.con1(TokenType.LT_SLASH, 0);
+ }
+
+ static HtmlScriptTagNode scriptTag(List<XmlAttributeNode> attributes) {
+ return new HtmlScriptTagNode(
+ ltToken(),
+ stringToken("script"),
+ attributes,
+ sgtToken(),
+ null,
+ null,
+ null,
+ null);
+ }
+
+ static HtmlScriptTagNode scriptTagWithContent(String contents,
+ List<XmlAttributeNode> attributes) {
+ Token attributeEnd = gtToken();
+ Token contentToken = stringToken(contents);
+ attributeEnd.setNext(contentToken);
+ Token contentEnd = ltsToken();
+ contentToken.setNext(contentEnd);
+ return new HtmlScriptTagNode(
+ ltToken(),
+ stringToken("script"),
+ attributes,
+ attributeEnd,
+ null,
+ contentEnd,
+ stringToken("script"),
+ gtToken());
+ }
+
+ static Token sgtToken() {
+ return new Token.con1(TokenType.SLASH_GT, 0);
+ }
+
+ static Token stringToken(String value) {
+ return new Token.con2(TokenType.STRING, 0, value);
+ }
+
+ static XmlTagNode tagNode(String name, List<XmlAttributeNode> attributes) {
+ return new XmlTagNode(
+ ltToken(),
+ stringToken(name),
+ attributes,
+ sgtToken(),
+ null,
+ null,
+ null,
+ null);
+ }
+}
« 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