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

Side by Side Diff: pkg/analyzer/test/generated/all_the_rest.dart

Issue 667463004: Code clean-up (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 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 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. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 // This code was auto-generated, is not intended to be edited, and is subject to 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. 6 // significant change. Please see the README file for more information.
7 7
8 library engine.all_the_rest_test; 8 library engine.all_the_rest_test;
9 9
10 import 'dart:collection'; 10 import 'dart:collection';
(...skipping 3019 matching lines...) Expand 10 before | Expand all | Expand 10 after
3030 * Finds an [Element] with the given names inside of the given root [Element]. 3030 * Finds an [Element] with the given names inside of the given root [Element].
3031 * 3031 *
3032 * TODO(scheglov) maybe move this method to Element 3032 * TODO(scheglov) maybe move this method to Element
3033 * 3033 *
3034 * @param root the root [Element] to start searching from 3034 * @param root the root [Element] to start searching from
3035 * @param kind the kind of the [Element] to find, if `null` then any kind 3035 * @param kind the kind of the [Element] to find, if `null` then any kind
3036 * @param name the name of an [Element] to find 3036 * @param name the name of an [Element] to find
3037 * @return the found [Element] or `null` if not found 3037 * @return the found [Element] or `null` if not found
3038 */ 3038 */
3039 static Element findElement(Element root, ElementKind kind, String name) { 3039 static Element findElement(Element root, ElementKind kind, String name) {
3040 List<Element> result = [null]; 3040 _AngularTest_findElement visitor = new _AngularTest_findElement(kind, name);
3041 root.accept(new _AngularTest_findElement(kind, name, result)); 3041 root.accept(visitor);
3042 return result[0]; 3042 return visitor.result;
3043 } 3043 }
3044 3044
3045 /** 3045 /**
3046 * Finds an [Element] with the given names inside of the given root [Element]. 3046 * Finds an [Element] with the given names inside of the given root [Element].
3047 * 3047 *
3048 * @param root the root [Element] to start searching from 3048 * @param root the root [Element] to start searching from
3049 * @param name the name of an [Element] to find 3049 * @param name the name of an [Element] to find
3050 * @return the found [Element] or `null` if not found 3050 * @return the found [Element] or `null` if not found
3051 */ 3051 */
3052 static Element findElement2(Element root, String name) { 3052 static Element findElement2(Element root, String name) {
(...skipping 7505 matching lines...) Expand 10 before | Expand all | Expand 10 after
10558 } on IllegalArgumentException catch (exception) { 10558 } on IllegalArgumentException catch (exception) {
10559 } 10559 }
10560 } 10560 }
10561 void test_fromEncoding_valid() { 10561 void test_fromEncoding_valid() {
10562 String encoding = "file:///does/not/exist.dart"; 10562 String encoding = "file:///does/not/exist.dart";
10563 SourceFactory factory = new SourceFactory( 10563 SourceFactory factory = new SourceFactory(
10564 [new UriResolver_SourceFactoryTest_test_fromEncoding_valid(encoding)]); 10564 [new UriResolver_SourceFactoryTest_test_fromEncoding_valid(encoding)]);
10565 JUnitTestCase.assertNotNull(factory.fromEncoding(encoding)); 10565 JUnitTestCase.assertNotNull(factory.fromEncoding(encoding));
10566 } 10566 }
10567 void test_resolveUri_absolute() { 10567 void test_resolveUri_absolute() {
10568 List<bool> invoked = [false]; 10568 UriResolver_absolute resolver = new UriResolver_absolute();
10569 SourceFactory factory = 10569 SourceFactory factory =
10570 new SourceFactory([new UriResolver_absolute(invoked)]); 10570 new SourceFactory([resolver]);
10571 factory.resolveUri(null, "dart:core"); 10571 factory.resolveUri(null, "dart:core");
10572 JUnitTestCase.assertTrue(invoked[0]); 10572 JUnitTestCase.assertTrue(resolver.invoked);
10573 } 10573 }
10574 void test_resolveUri_nonAbsolute_absolute() { 10574 void test_resolveUri_nonAbsolute_absolute() {
10575 SourceFactory factory = 10575 SourceFactory factory =
10576 new SourceFactory([new UriResolver_nonAbsolute_absolute()]); 10576 new SourceFactory([new UriResolver_nonAbsolute_absolute()]);
10577 String absolutePath = "/does/not/matter.dart"; 10577 String absolutePath = "/does/not/matter.dart";
10578 Source containingSource = 10578 Source containingSource =
10579 new FileBasedSource.con1(FileUtilities2.createFile("/does/not/exist.dart ")); 10579 new FileBasedSource.con1(FileUtilities2.createFile("/does/not/exist.dart "));
10580 Source result = factory.resolveUri(containingSource, absolutePath); 10580 Source result = factory.resolveUri(containingSource, absolutePath);
10581 JUnitTestCase.assertEquals( 10581 JUnitTestCase.assertEquals(
10582 FileUtilities2.createFile(absolutePath).getAbsolutePath(), 10582 FileUtilities2.createFile(absolutePath).getAbsolutePath(),
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
10697 Source resolveAbsolute(Uri uri) { 10697 Source resolveAbsolute(Uri uri) {
10698 if (uri.toString() == encoding) { 10698 if (uri.toString() == encoding) {
10699 return new TestSource(); 10699 return new TestSource();
10700 } 10700 }
10701 return null; 10701 return null;
10702 } 10702 }
10703 } 10703 }
10704 10704
10705 10705
10706 class UriResolver_absolute extends UriResolver { 10706 class UriResolver_absolute extends UriResolver {
10707 List<bool> invoked; 10707 bool invoked = false;
10708 10708
10709 UriResolver_absolute(this.invoked); 10709 UriResolver_absolute();
10710 10710
10711 @override 10711 @override
10712 Source resolveAbsolute(Uri uri) { 10712 Source resolveAbsolute(Uri uri) {
10713 invoked[0] = true; 10713 invoked = true;
10714 return null; 10714 return null;
10715 } 10715 }
10716 } 10716 }
10717 10717
10718 10718
10719 class UriResolver_nonAbsolute_absolute extends UriResolver { 10719 class UriResolver_nonAbsolute_absolute extends UriResolver {
10720 @override 10720 @override
10721 Source resolveAbsolute(Uri uri) { 10721 Source resolveAbsolute(Uri uri) {
10722 return new FileBasedSource.con2(uri, new JavaFile.fromUri(uri)); 10722 return new FileBasedSource.con2(uri, new JavaFile.fromUri(uri));
10723 } 10723 }
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after
11041 class XmlValidator_Tag { 11041 class XmlValidator_Tag {
11042 final String _tag; 11042 final String _tag;
11043 final XmlValidator_Attributes _attributes; 11043 final XmlValidator_Attributes _attributes;
11044 final String _content; 11044 final String _content;
11045 final List<XmlValidator_Tag> _children; 11045 final List<XmlValidator_Tag> _children;
11046 XmlValidator_Tag(this._tag, this._attributes, this._content, this._children); 11046 XmlValidator_Tag(this._tag, this._attributes, this._content, this._children);
11047 } 11047 }
11048 11048
11049 11049
11050 class _AngularTest_findElement extends GeneralizingElementVisitor<Object> { 11050 class _AngularTest_findElement extends GeneralizingElementVisitor<Object> {
11051 ElementKind kind; 11051 final ElementKind kind;
11052 11052
11053 String name; 11053 final String name;
11054 11054
11055 List<Element> result; 11055 Element result;
11056 11056
11057 _AngularTest_findElement(this.kind, this.name, this.result); 11057 _AngularTest_findElement(this.kind, this.name);
11058 11058
11059 @override 11059 @override
11060 Object visitElement(Element element) { 11060 Object visitElement(Element element) {
11061 if ((kind == null || element.kind == kind) && name == element.name) { 11061 if ((kind == null || element.kind == kind) && name == element.name) {
11062 result[0] = element; 11062 result = element;
11063 } 11063 }
11064 return super.visitElement(element); 11064 return super.visitElement(element);
11065 } 11065 }
11066 } 11066 }
11067 11067
11068 11068
11069 class _ExpectedScript { 11069 class _ExpectedScript {
11070 String _expectedExternalScriptName; 11070 String _expectedExternalScriptName;
11071 HtmlUnitBuilderTest_ExpectedLibrary _expectedLibrary; 11071 HtmlUnitBuilderTest_ExpectedLibrary _expectedLibrary;
11072 _ExpectedScript.con1(HtmlUnitBuilderTest_ExpectedLibrary expectedLibrary) { 11072 _ExpectedScript.con1(HtmlUnitBuilderTest_ExpectedLibrary expectedLibrary) {
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
11106 } else { 11106 } else {
11107 JUnitTestCase.assertNotNullMsg("script ${scriptIndex}", scriptSource); 11107 JUnitTestCase.assertNotNullMsg("script ${scriptIndex}", scriptSource);
11108 String actualExternalScriptName = scriptSource.shortName; 11108 String actualExternalScriptName = scriptSource.shortName;
11109 JUnitTestCase.assertEqualsMsg( 11109 JUnitTestCase.assertEqualsMsg(
11110 "script ${scriptIndex}", 11110 "script ${scriptIndex}",
11111 _expectedExternalScriptName, 11111 _expectedExternalScriptName,
11112 actualExternalScriptName); 11112 actualExternalScriptName);
11113 } 11113 }
11114 } 11114 }
11115 } 11115 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/generated/resolver.dart ('k') | pkg/analyzer/test/generated/engine_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698