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

Unified Diff: tests/html/js_typed_interop_side_cast_test.dart

Issue 1457383003: Alternative fix for the js-interop crash. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 1 month 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
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));
});
}

Powered by Google App Engine
This is Rietveld 408576698