Index: tests/html/js_typed_interop_side_cast_test.dart |
diff --git a/tests/html/fontface_test.dart b/tests/html/js_typed_interop_side_cast_test.dart |
similarity index 50% |
copy from tests/html/fontface_test.dart |
copy to tests/html/js_typed_interop_side_cast_test.dart |
index 8247a8a268e7e5c28401c3aed9a42b625ae7c77a..fb2bae789997a17574c070b6cfaa5520d3d62637 100644 |
--- a/tests/html/fontface_test.dart |
+++ b/tests/html/js_typed_interop_side_cast_test.dart |
@@ -2,21 +2,33 @@ |
// 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 fontface_test; |
+library js_typed_interop_anonymous2_test; |
+import 'dart:html'; |
+import 'dart:js' as js; |
+ |
+import 'package:js/js.dart'; |
import 'package:unittest/unittest.dart'; |
import 'package:unittest/html_config.dart'; |
-import 'dart:html'; |
+@JS() @anonymous |
+class A { |
+ external int get x; |
+ external factory A({int x}); |
+} |
+ |
+@JS() @anonymous |
+class B { |
+ external int get x; |
+ external factory B({int x}); |
+} |
main() { |
useHtmlConfiguration(); |
- test("Creation with parameters", () { |
- var font = |
- new FontFace('Ahem', 'url(Ahem.ttf)', {'variant': 'small-caps'}); |
- expect(font is FontFace, isTrue); |
- expect(font.family, 'Ahem'); |
- expect(font.variant, 'small-caps'); |
+ test('side-casts are allowed', () { |
+ var a = new A(x: 3); |
+ B b = a; |
+ expect(b.x, equals(3)); |
}); |
} |