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

Unified Diff: pkg/analyzer/test/src/context/mock_sdk.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 | « pkg/analyzer/test/src/context/builder_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/src/context/mock_sdk.dart
diff --git a/pkg/analyzer/test/src/context/mock_sdk.dart b/pkg/analyzer/test/src/context/mock_sdk.dart
index 4916d30402828179a8f8b769ae201a107a4244ea..acfe6e6b2da06b4d4e1b8c048835dd237185c7f1 100644
--- a/pkg/analyzer/test/src/context/mock_sdk.dart
+++ b/pkg/analyzer/test/src/context/mock_sdk.dart
@@ -20,7 +20,9 @@ const Map<String, LibraryInfo> libraries = const {
"collection": const LibraryInfo("collection/collection.dart"),
"convert": const LibraryInfo("convert/convert.dart"),
"core": const LibraryInfo("core/core.dart"),
- "html": const LibraryInfo("html/dartium/html_dartium.dart"),
+ "html": const LibraryInfo(
+ "html/dartium/html_dartium.dart",
+ dart2jsPath: "html/dart2js/html_dart2js.dart"),
"math": const LibraryInfo("math/math.dart"),
"_foreign_helper": const LibraryInfo("_internal/js_runtime/lib/foreign_helper.dart"),
};
@@ -265,7 +267,15 @@ JS(String typeDescription, String codeTemplate,
{}
''');
-const _MockSdkLibrary _LIB_HTML = const _MockSdkLibrary(
+const _MockSdkLibrary _LIB_HTML_DART2JS = const _MockSdkLibrary(
+ 'dart:html',
+ '$sdkRoot/lib/html/dart2js/html_dart2js.dart',
+ '''
+library dart.html;
+class HtmlElement {}
+''');
+
+const _MockSdkLibrary _LIB_HTML_DARTIUM = const _MockSdkLibrary(
'dart:html',
'$sdkRoot/lib/html/dartium/html_dartium.dart',
'''
@@ -303,7 +313,8 @@ const List<SdkLibrary> _LIBRARIES = const [
_LIB_CONVERT,
_LIB_FOREIGN_HELPER,
_LIB_MATH,
- _LIB_HTML,
+ _LIB_HTML_DART2JS,
+ _LIB_HTML_DARTIUM,
];
class MockSdk implements DartSdk {
@@ -351,8 +362,8 @@ class MockSdk implements DartSdk {
});
}
provider.newFile(
- provider
- .convertPath('/_internal/sdk_library_metadata/lib/libraries.dart'),
+ provider.convertPath(
+ '$sdkRoot/lib/_internal/sdk_library_metadata/lib/libraries.dart'),
librariesContent);
}
« no previous file with comments | « pkg/analyzer/test/src/context/builder_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698