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

Unified Diff: tests/html/js_typed_interop_test.dart

Issue 2402163002: Copy new JS Interop test from dev_compiler test suite. (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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/html/js_typed_interop_test.dart
diff --git a/tests/html/js_typed_interop_test.dart b/tests/html/js_typed_interop_test.dart
index 960c0ccf453521c4f8999ef37dfc3b4a07c722aa..bbbd8677305a5907f0f502dac82aac544a314f8e 100644
--- a/tests/html/js_typed_interop_test.dart
+++ b/tests/html/js_typed_interop_test.dart
@@ -80,7 +80,7 @@ _injectJs() {
_getA: function() { return this._a;}
};
- var selection = ["a", "b", "c", foo, bar];
+ var selection = ["a", "b", "c", foo, bar];
function returnNumArgs() { return arguments.length; };
function returnLastArg() { return arguments[arguments.length-1]; };
@@ -144,6 +144,14 @@ class _ClassWithConstructor {
external get b;
}
+@JS('ClassWithConstructor')
+class ClassWithFactory {
+ external factory ClassWithFactory(aParam, bParam);
+ external getA();
+ external get a;
+ external get b;
+}
+
@JS()
class JS$_PrivateClass {
external JS$_PrivateClass(aParam, bParam);
@@ -324,6 +332,12 @@ main() {
expect(o.b, equals("bar"));
expect(o.getA(), equals("foo"));
});
+ test('external factory', () {
+ var o = new ClassWithFactory("foo", "bar");
+ expect(o.a, equals("foo"));
+ expect(o.b, equals("bar"));
+ expect(o.getA(), equals("foo"));
+ });
});
group('private class', () {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698