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

Unified Diff: pkg/analyzer/test/src/context/builder_test.dart

Issue 2408633003: Tweaks for MockSdk and test ContextBuilder.findSdk() and dart:html. (Closed)
Patch Set: Created 4 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 | « no previous file | pkg/analyzer/test/src/context/mock_sdk.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/src/context/builder_test.dart
diff --git a/pkg/analyzer/test/src/context/builder_test.dart b/pkg/analyzer/test/src/context/builder_test.dart
index b63b83d1ca82fcaf5a268b4cbaa4a8a806ee44de..32c8937a6b88b3a186af538a61d148506486e053 100644
--- a/pkg/analyzer/test/src/context/builder_test.dart
+++ b/pkg/analyzer/test/src/context/builder_test.dart
@@ -96,7 +96,7 @@ const Map<String, LibraryInfo> libraries = const {
resourceProvider = new MemoryResourceProvider();
pathContext = resourceProvider.pathContext;
new MockSdk(resourceProvider: resourceProvider);
- sdkManager = new DartSdkManager('/', false, (_) {
+ sdkManager = new DartSdkManager('/sdk', false, (_) {
fail('Should not be used to create an SDK');
});
contentCache = new ContentCache();
@@ -484,6 +484,29 @@ b:${pathContext.toUri(packageB)}
expect(sdk, isNotNull);
}
+ void test_findSdk_noPackageMap_html_spec() {
+ DartSdk sdk = builder.findSdk(null, new AnalysisOptionsImpl());
+ expect(sdk, isNotNull);
+ Source htmlSource = sdk.mapDartUri('dart:html');
+ expect(
+ htmlSource.fullName,
+ resourceProvider
+ .convertPath('/sdk/lib/html/dartium/html_dartium.dart'));
+ expect(htmlSource.exists(), isTrue);
+ }
+
+ void test_findSdk_noPackageMap_html_strong() {
+ DartSdk sdk =
+ builder.findSdk(null, new AnalysisOptionsImpl()..strongMode = true);
+ expect(sdk, isNotNull);
+ Source htmlSource = sdk.mapDartUri('dart:html');
+ expect(
+ htmlSource.fullName,
+ resourceProvider
+ .convertPath('/sdk/lib/html/dart2js/html_dart2js.dart'));
+ expect(htmlSource.exists(), isTrue);
+ }
+
void test_getAnalysisOptions_default_noOverrides() {
AnalysisOptionsImpl defaultOptions = new AnalysisOptionsImpl();
defaultOptions.enableGenericMethods = true;
« no previous file with comments | « no previous file | pkg/analyzer/test/src/context/mock_sdk.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698