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

Unified Diff: tests/html/js_typed_interop_test.dart

Issue 1688433006: cpsir: implementation of jsinterop in cps ir (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 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
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 14d931f0d69ec46d16ee00151d29406804ad76fe..efe6723a367021da3ee93433c7c8e75fe4f91a80 100644
--- a/tests/html/js_typed_interop_test.dart
+++ b/tests/html/js_typed_interop_test.dart
@@ -124,7 +124,9 @@ class Foo {
external callClosureWithArg1(Function closure, arg1);
external callClosureWithArg2(Function closure, arg1, arg2);
external Bar getBar();
- external static num multiplyDefault2(num a, [num b]);
+
+ // Note: the default value `3` will not be provided to JS.
+ external static num multiplyDefault2(num a, [num b = 3]);
Jacob 2016/02/11 17:54:33 instead of adding this test here, add this as a la
Siggi Cherem (dart-lang) 2016/02/11 21:16:53 I got the test out on a separate file, however, I'
}
@anonymous
@@ -277,14 +279,26 @@ main() {
});
});
- group('static method', () {
- test('call from dart', () {
+ group('static_method_call', () {
+ test('call directly from dart', () {
expect(Foo.multiplyDefault2(6, 7), equals(42));
expect(Foo.multiplyDefault2(6), equals(12));
+ });
+ });
+
+ // Note: these extra groups are added to be able to mark each test
+ // individually in status files. This should be split as separate test files.
+ group('static_method_tearoff_1', () {
+ test('call tearoff from dart', () {
MultiplyWithDefault tearOffMethod = Foo.multiplyDefault2;
expect(tearOffMethod(6, 6), equals(36));
+ });
+ });
+
+ group('static_method_tearoff_2', () {
+ test('call tearoff from dart', () {
+ MultiplyWithDefault tearOffMethod = Foo.multiplyDefault2;
expect(tearOffMethod(6), equals(12));
- Function untypedTearOff = Foo.multiplyDefault2;
});
});
« pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart ('K') | « tests/html/html.status ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698