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

Unified Diff: tests/compiler/dart2js/kernel/impact_test.dart

Issue 2681123004: Handle Native("...") annotations in KernelBehaviorBuilder. (Closed)
Patch Set: Created 3 years, 10 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/compiler/lib/src/patch_parser.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/compiler/dart2js/kernel/impact_test.dart
diff --git a/tests/compiler/dart2js/kernel/impact_test.dart b/tests/compiler/dart2js/kernel/impact_test.dart
index 6c2e97f4f866ed7b1a9d9851944ae783b309c07b..89bee6244a8bfbb10ac8e467fe05023d6ea975fd 100644
--- a/tests/compiler/dart2js/kernel/impact_test.dart
+++ b/tests/compiler/dart2js/kernel/impact_test.dart
@@ -183,6 +183,7 @@ main() {
testNativeMethod();
testNativeMethodCreates();
testNativeMethodReturns();
+ testNativeField(null);
}
testEmpty() {}
@@ -616,8 +617,18 @@ testNativeMethod() native;
testNativeMethodCreates() native;
@Returns('String|Null|JSArray')
testNativeMethodReturns() native;
+
+@Native("NativeClass")
+class NativeClass {
+ @annotation_Creates_SerializedScriptValue
+ final Object field;
+
+ factory NativeClass._() { throw new UnsupportedError("Not supported"); }
+}
+testNativeField(NativeClass c) => c.field;
''',
'sdk/tests/compiler/dart2js_native/helper.dart': '''
+import 'dart:_js_helper';
class Class {
const Class.generative();
factory Class.fact() => null;
@@ -632,7 +643,12 @@ class GenericClass<X, Y> {
}
typedef Typedef();
typedef X GenericTypedef<X, Y>(Y y);
-''',
+
+const String _serializedScriptValue =
+ 'num|String|bool|'
+ 'JSExtendableArray|=Object';
+const annotation_Creates_SerializedScriptValue =
+ const Creates(_serializedScriptValue);''',
};
main(List<String> args) {
@@ -657,14 +673,10 @@ main(List<String> args) {
checkLibrary(compiler, kernelElementAdapter, compiler.mainApp,
fullTest: fullTest);
- if (fullTest) {
- // TODO(johnniwinther): Handle all libraries for `!fullTest`.
- compiler.libraryLoader.libraries.forEach((LibraryElement library) {
- if (library == compiler.mainApp) return;
- checkLibrary(compiler, kernelElementAdapter, library,
- fullTest: fullTest);
- });
- }
+ compiler.libraryLoader.libraries.forEach((LibraryElement library) {
+ if (library == compiler.mainApp) return;
+ checkLibrary(compiler, kernelElementAdapter, library, fullTest: fullTest);
+ });
});
}
@@ -689,33 +701,8 @@ void checkLibrary(Compiler compiler, KernelElementAdapter kernelElementAdapter,
void checkElement(Compiler compiler, KernelElementAdapter kernelElementAdapter,
AstElement element,
{bool fullTest: false}) {
- if (!fullTest) {
- if (element.library.isPlatformLibrary) {
- // TODO(johnniwinther): Enqueue these elements for `!fullTest`.
- // Test only selected elements in web-related platform libraries since
- // this unittest otherwise takes too long to run.
- switch (element.library.canonicalUri.path) {
- case 'html':
- if ('$element' ==
- 'function(_ValidatingTreeSanitizer#_sanitizeUntrustedElement)') {
- break;
- }
- return;
- case 'web_gl':
- if ('$element' ==
- 'function(RenderingContext#getFramebufferAttachmentParameter)') {
- break;
- }
- return;
- case 'indexed_db':
- if ('$element' == 'field(ObjectStore#keyPath)') {
- break;
- }
- return;
- case 'web_audio':
- return;
- }
- }
+ if (!fullTest && element.library.isPlatformLibrary) {
+ return;
}
if (element.isConstructor) {
ConstructorElement constructor = element;
« no previous file with comments | « pkg/compiler/lib/src/patch_parser.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698