Test for interceptor convention closurized methods

R=ahe@google.com

Review URL: https://codereview.chromium.org//119683004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31316 260f80e4-7a28-3924-810f-c04153c831b5
diff --git a/tests/compiler/dart2js_native/bound_closure_test.dart b/tests/compiler/dart2js_native/bound_closure_test.dart
new file mode 100644
index 0000000..59dc306
--- /dev/null
+++ b/tests/compiler/dart2js_native/bound_closure_test.dart
@@ -0,0 +1,83 @@
+// Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
+// 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.
+
+import "package:expect/expect.dart";
+
+// Test calling convention of property extraction closures.
+
+class AA {
+  bar(a, [b = 'A']) => 'AA.bar($a, $b)';   // bar is plain dart convention.
+  foo(a, [b = 'A']) => 'AA.foo($a, $b)';   // foo has interceptor convention.
+}
+
+class BB native "BB" {
+  foo(a, [b = 'B']) native;
+}
+
+class CC extends BB native "CC" {
+  foo(a, [b = 'C']) native;
+
+  get superfoo => super.foo;
+}
+
+makeBB() native;
+makeCC() native;
+inscrutable(a) native;
+
+void setup() native r"""
+function BB() {}
+BB.prototype.foo = function(u, v) {
+  return 'BB.foo(' + u + ', ' + v + ')';
+};
+
+function CC() {}
+CC.prototype.foo = function(u, v) {
+  return 'CC.foo(' + u + ', ' + v + ')';
+};
+
+makeBB = function(){return new BB;};
+makeCC = function(){return new CC;};
+inscrutable = function(a){return a;};
+""";
+
+
+main() {
+  setup();
+  var a = inscrutable(new AA());
+  var b = inscrutable(makeBB());
+  var c = inscrutable(makeCC);
+
+  Expect.equals('AA.bar(1, A)', inscrutable(a).bar(1));
+  Expect.equals('AA.bar(2, 3)', inscrutable(a).bar(2, 3));
+
+  Expect.equals('AA.foo(1, A)', inscrutable(a).foo(1));
+  Expect.equals('AA.foo(2, 3)', inscrutable(a).foo(2, 3));
+
+  Expect.equals('BB.foo(1, B)', inscrutable(b).foo(1));
+  Expect.equals('BB.foo(2, 3)', inscrutable(b).foo(2, 3));
+
+  Expect.equals('CC.foo(1, C)', inscrutable(c).foo(1));
+  Expect.equals('CC.foo(2, 3)', inscrutable(c).foo(2, 3));
+
+  var abar = inscrutable(a).bar;
+  var afoo = inscrutable(a).foo;
+  var bfoo = inscrutable(b).foo;
+  var cfoo = inscrutable(c).foo;
+  var csfoo = inscrutable(c).superfoo;
+
+  Expect.equals('AA.bar(1, A)', abar(1));
+  Expect.equals('AA.bar(2, 3)', abar(2, 3));
+
+  Expect.equals('AA.foo(1, A)', afoo(1));
+  Expect.equals('AA.foo(2, 3)', afoo(2, 3));
+
+  Expect.equals('BB.foo(1, B)', bfoo(1));
+  Expect.equals('BB.foo(2, 3)', bfoo(2, 3));
+
+  Expect.equals('CC.foo(1, C)', cfoo(1));
+  Expect.equals('CC.foo(2, 3)', cfoo(2, 3));
+
+  Expect.equals('BB.foo(1, B)', csfoo(1));
+  Expect.equals('BB.foo(2, 3)', csfoo(2, 3));
+}
diff --git a/tests/compiler/dart2js_native/dart2js_native.status b/tests/compiler/dart2js_native/dart2js_native.status
index 10785bb..499d474 100644
--- a/tests/compiler/dart2js_native/dart2js_native.status
+++ b/tests/compiler/dart2js_native/dart2js_native.status
@@ -6,9 +6,10 @@
 *: Skip
 
 [ $compiler == dart2js ]
+bound_closure_test: Fail
+call_on_native_class_test: CompileTimeError # Issue 14813
 native_no_such_method_exception4_frog_test: Fail  # Issue 9631
 native_no_such_method_exception5_frog_test: Fail  # Issue 9631
-call_on_native_class_test: CompileTimeError # Issue 14813
 
 [ $compiler == dart2js && $unminified ]
 fake_thing_test: Fail # Issue 13010