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

Unified Diff: editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/NonErrorResolverTest.java

Issue 262253002: Add flag to AnalysisOptions to be able to disable deferred loading. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: rebase with bleeding_edge, updated status files not to break build Created 6 years, 7 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
Index: editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/NonErrorResolverTest.java
diff --git a/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/NonErrorResolverTest.java b/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/NonErrorResolverTest.java
index 3f0bf6a63a0eed0b3cdbdc890b0a2e51f4bf8efa..b65b8ae0d5c33c2f8848bc14e93e8aa4085084b8 100644
--- a/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/NonErrorResolverTest.java
+++ b/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/NonErrorResolverTest.java
@@ -23,6 +23,58 @@ import com.google.dart.engine.parser.ParserErrorCode;
import com.google.dart.engine.source.Source;
public class NonErrorResolverTest extends ResolverTestCase {
+ public void fail_constDeferredClass_new() throws Exception {
+ addNamedSource("/lib1.dart", createSource(//
+ "library lib1;",
+ "class A {",
+ " const A.b();",
+ "}"));
+ Source source = addSource(createSource(//
+ "library root;",
+ "import 'lib1.dart' deferred as a;",
+ "main() {",
+ " new a.A.b();",
+ "}"));
+ resolve(source);
+ assertErrors(source);
+ verify(source);
+ }
+
+ public void fail_loadLibraryDefined() throws Exception {
+ addNamedSource("/lib.dart", createSource(//
+ "library lib;",
+ "foo() => 22;"));
+ Source source = addSource(createSource(//
+ "import 'lib.dart' deferred as other;",
+ "main() {",
+ " other.loadLibrary().then((_) => other.foo());",
+ "}"));
+ resolve(source);
+ assertNoErrors(source);
+ verify(source);
+ }
+
+ public void fail_sharedDeferredPrefix() throws Exception {
+ addNamedSource("/lib1.dart", createSource(//
+ "library lib1;",
+ "f1() {}"));
+ addNamedSource("/lib2.dart", createSource(//
+ "library lib2;",
+ "f2() {}"));
+ addNamedSource("/lib3.dart", createSource(//
+ "library lib3;",
+ "f3() {}"));
+ Source source = addSource(createSource(//
+ "library root;",
+ "import 'lib1.dart' deferred as lib1;",
+ "import 'lib2.dart' as lib;",
+ "import 'lib3.dart' as lib;",
+ "main() { lib1.f1(); lib.f2(); lib.f3(); }"));
+ resolve(source);
+ assertNoErrors(source);
+ verify(source);
+ }
+
public void test_ambiguousExport() throws Exception {
Source source = addSource(createSource(//
"library L;",
@@ -559,23 +611,6 @@ public class NonErrorResolverTest extends ResolverTestCase {
verify(source);
}
- public void test_constDeferredClass_new() throws Exception {
- addNamedSource("/lib1.dart", createSource(//
- "library lib1;",
- "class A {",
- " const A.b();",
- "}"));
- Source source = addSource(createSource(//
- "library root;",
- "import 'lib1.dart' deferred as a;",
- "main() {",
- " new a.A.b();",
- "}"));
- resolve(source);
- assertErrors(source);
- verify(source);
- }
-
public void test_constEval_functionTypeLiteral() throws Exception {
Source source = addSource(createSource(//
"typedef F();",
@@ -2187,20 +2222,6 @@ public class NonErrorResolverTest extends ResolverTestCase {
verify(source);
}
- public void test_loadLibraryDefined() throws Exception {
- addNamedSource("/lib.dart", createSource(//
- "library lib;",
- "foo() => 22;"));
- Source source = addSource(createSource(//
- "import 'lib.dart' deferred as other;",
- "main() {",
- " other.loadLibrary().then((_) => other.foo());",
- "}"));
- resolve(source);
- assertNoErrors(source);
- verify(source);
- }
-
public void test_mapKeyTypeNotAssignable() throws Exception {
Source source = addSource(createSource(//
"var v = <String, int > {'a' : 1};"));
@@ -3496,27 +3517,6 @@ public class NonErrorResolverTest extends ResolverTestCase {
verify(source);
}
- public void test_sharedDeferredPrefix() throws Exception {
- addNamedSource("/lib1.dart", createSource(//
- "library lib1;",
- "f1() {}"));
- addNamedSource("/lib2.dart", createSource(//
- "library lib2;",
- "f2() {}"));
- addNamedSource("/lib3.dart", createSource(//
- "library lib3;",
- "f3() {}"));
- Source source = addSource(createSource(//
- "library root;",
- "import 'lib1.dart' deferred as lib1;",
- "import 'lib2.dart' as lib;",
- "import 'lib3.dart' as lib;",
- "main() { lib1.f1(); lib.f2(); lib.f3(); }"));
- resolve(source);
- assertNoErrors(source);
- verify(source);
- }
-
public void test_staticAccessToInstanceMember_annotation() throws Exception {
Source source = addSource(createSource(//
"class A {",

Powered by Google App Engine
This is Rietveld 408576698