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

Unified Diff: packages/analyzer/test/src/summary/prelinker_test.dart

Issue 2990843002: Removed fixed dependencies (Closed)
Patch Set: Created 3 years, 5 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: packages/analyzer/test/src/summary/prelinker_test.dart
diff --git a/packages/analyzer/test/src/summary/prelinker_test.dart b/packages/analyzer/test/src/summary/prelinker_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..bfed9f2b6c7bc6743c98ad23f51918ab1281fdd7
--- /dev/null
+++ b/packages/analyzer/test/src/summary/prelinker_test.dart
@@ -0,0 +1,56 @@
+// Copyright (c) 2016, 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.
+
+library analyzer.test.src.summary.prelinker_test;
+
+import 'package:analyzer/src/generated/utilities_dart.dart';
+import 'package:analyzer/src/summary/idl.dart';
+import 'package:analyzer/src/summary/prelink.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
+import 'package:unittest/unittest.dart';
+
+import 'summarize_ast_test.dart';
+import 'summary_common.dart';
+
+main() {
+ groupSep = ' | ';
+ defineReflectiveTests(PrelinkerTest);
+}
+
+/**
+ * Override of [SummaryTest] which verifies the correctness of the prelinker by
+ * creating summaries from the element model, discarding their prelinked
+ * information, and then recreating it using the prelinker.
+ */
+@reflectiveTest
+class PrelinkerTest extends LinkedSummarizeAstTest {
+ @override
+ bool get skipFullyLinkedData => true;
+
+ @override
+ bool get strongMode => false;
+
+ @override
+ void serializeLibraryText(String text, {bool allowErrors: false}) {
+ super.serializeLibraryText(text, allowErrors: allowErrors);
+
+ UnlinkedUnit getPart(String relativeUri) {
+ String absoluteUri =
+ resolveRelativeUri(linkerInputs.testDartUri, Uri.parse(relativeUri))
+ .toString();
+ return linkerInputs.getUnit(absoluteUri);
+ }
+
+ UnlinkedPublicNamespace getImport(String relativeUri) {
+ return getPart(relativeUri)?.publicNamespace;
+ }
+
+ linked = new LinkedLibrary.fromBuffer(prelink(
+ linkerInputs.unlinkedDefiningUnit,
+ getPart,
+ getImport,
+ (String declaredVariable) => null).toBuffer());
+ validateLinkedLibrary(linked);
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698