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

Unified Diff: test_sources/non_transformed/web/generated_code_test.dart

Issue 615913004: Add @jsify annotation. Support automatically proxying Lists and Maps to Dart in Proxies. Support co… (Closed) Base URL: https://github.com/dart-lang/js-interop.git@master
Patch Set: Created 6 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
« lib/src/mirrors.dart ('K') | « test_sources/non_transformed/lib/library2.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test_sources/non_transformed/web/generated_code_test.dart
diff --git a/test_sources/non_transformed/web/generated_code_test.dart b/test_sources/non_transformed/web/generated_code_test.dart
index caad5d7dcdce846097d269ed2ee731d9027db95f..5beeecf3185b23ec02a7a4018d72bfbb27114b2a 100644
--- a/test_sources/non_transformed/web/generated_code_test.dart
+++ b/test_sources/non_transformed/web/generated_code_test.dart
@@ -116,6 +116,61 @@ main() {
expect(foo.bar, bar);
});
+ test('should return Lists', () {
+ var library2 = new l2.Library2();
+ var l = library2.createList('1', 'b', 'z');
+ expect(l, ['1', 'b', 'z']);
+ });
+
+ test('should accept Lists', () {
+ var library2 = new l2.Library2();
+ var s = library2.joinList(['1', 'b', 'z']);
+ expect(s, '1, b, z');
+ });
+
+ test('should return Lists of proxies', () {
+ var library2 = new l2.Library2();
+ var a = new t.JsFoo('a');
+ var b = new t.JsFoo('b');
+ var c = new t.JsFoo('c');
+
+ var l = library2.createList(a, b, c);
+ expect(l[0], same(a));
+ expect(l[1], same(b));
+ expect(l[2], same(c));
+ });
+
+ test('should accept Lists of Proxies', () {
+ var library2 = new l2.Library2();
+ var a = new t.JsFoo('a');
+ var b = new t.JsFoo('b');
+ var c = new t.JsFoo('c');
+
+ var s = library2.joinList([a, b, c]);
+ expect(s, 'a, b, c');
+ });
+
+ test('should return Maps', () {
+ var library2 = new l2.Library2();
+ var m = library2.createMap('a', 1, 'z', 26);
+ expect(m, {'a': 1, 'z': 26});
+ });
+
+ test('should accept Maps', () {
+ var library2 = new l2.Library2();
+ var s = library2.joinMap({'a': 1, 'z': 26});
+ expect(s, 'a: 1, z: 26');
+ });
+
+ test('should return Maps of proxies', () {
+ var library2 = new l2.Library2();
+ var a = new t.JsFoo('a');
+ var b = new t.JsFoo('b');
+ var m = library2.createMap('a', a, 'b', b);
+ expect(m['a'], same(a));
+ expect(m['b'], same(b));
+ });
+
test('should accept exported object as arguments', () {
var foo = new t.JsFoo('red');
var bar = new t.ExportMe.named('blue');
« lib/src/mirrors.dart ('K') | « test_sources/non_transformed/lib/library2.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698