Copy new JS Interop test from dev_compiler test suite.

The test was added in the issue #2394103002.

R=vsm@google.com

Review URL: https://codereview.chromium.org/2402163002 .
This commit is contained in:
Nicholas Shahan 2016-10-12 10:15:34 -07:00
parent ba2c6e397c
commit 2a51e46153

View file

@ -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', () {