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

Unified Diff: tests/lib_strong/html/js_typed_interop_lazy_test.dart

Issue 2789663005: Fix type checks and display for JS interop types. (Closed)
Patch Set: Code review comment fixes. Created 3 years, 9 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 | « tests/lib_strong/html/debugger_test_golden.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/lib_strong/html/js_typed_interop_lazy_test.dart
diff --git a/tests/lib_strong/html/js_typed_interop_lazy_test.dart b/tests/lib_strong/html/js_typed_interop_lazy_test.dart
index 97af07fcf14ce6b32334aa48f8a8100280b722bb..dd99960a8bd4a775a2c4855503346f5eb9259156 100644
--- a/tests/lib_strong/html/js_typed_interop_lazy_test.dart
+++ b/tests/lib_strong/html/js_typed_interop_lazy_test.dart
@@ -46,6 +46,12 @@ class FooImpl extends Foo<LazyClass> {
LazyClass get obj => new LazyClass(100);
}
+class ExampleGenericClass<T> {
+ String add(T foo) {
+ return foo.toString();
+ }
+}
+
main() {
group('lazy property', () {
test('simple', () {
@@ -109,6 +115,29 @@ baz.LazyClass = function LazyClass(a) {
expect(<AnonClass>[] is! List<LazyClass>, isTrue);
expect(<int>[] is! List<LazyClass>, isTrue);
expect(<LazyClass>[] is List<LazyClass>, isTrue);
+
+ var listLazyClass = <LazyClass>[];
+ Object instanceLazyObject = l;
+ expect(() => listLazyClass.add(42 as dynamic), throws);
+ // Regression test for bug where this call failed.
+ listLazyClass.add(instanceLazyObject);
+ listLazyClass.add(null);
+
+ dynamic listLazyClassDynamic = listLazyClass;
+ expect(() => listLazyClassDynamic.add(42), throws);
+ // Regression test for bug where this call failed.
+ listLazyClassDynamic.add(instanceLazyObject);
+ listLazyClassDynamic.add(null);
+
+ var genericClass = new ExampleGenericClass<LazyClass>();
+ genericClass.add(instanceLazyObject);
+ expect(() => genericClass.add(42 as dynamic), throws);
+ genericClass.add(null);
+
+ dynamic genericClassDynamic = genericClass;
+ genericClassDynamic.add(instanceLazyObject);
+ expect(() => genericClassDynamic.add(42), throws);
+ genericClassDynamic.add(null);
});
});
}
« no previous file with comments | « tests/lib_strong/html/debugger_test_golden.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698