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

Side by Side Diff: tests/compiler/dart2js_native/native_field_invocation2_test.dart

Issue 383413003: Add @Native(...) annotation for native class names. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comments. Created 6 years, 5 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 import "dart:_js_helper";
5 import "package:expect/expect.dart"; 6 import "package:expect/expect.dart";
6 7
7 class NNative native "NNative" { 8 @Native("NNative")
9 class NNative {
8 var status; 10 var status;
9 11
10 var f; 12 var f;
11 13
12 ClickCounter() { 14 ClickCounter() {
13 f = wrap(g); 15 f = wrap(g);
14 } 16 }
15 17
16 g(val) => "### $val ###"; 18 g(val) => "### $val ###";
17 } 19 }
(...skipping 23 matching lines...) Expand all
41 }; 43 };
42 } 44 }
43 45
44 main() { 46 main() {
45 setup(); 47 setup();
46 // Make sure the ClickCounter class goes through interceptors. 48 // Make sure the ClickCounter class goes through interceptors.
47 Expect.equals("### !!! 42 !!! ###", nativeId(new ClickCounter()).f(42)); 49 Expect.equals("### !!! 42 !!! ###", nativeId(new ClickCounter()).f(42));
48 // We are interested in the direct call, where the type is known. 50 // We are interested in the direct call, where the type is known.
49 Expect.equals("### !!! 499 !!! ###", new ClickCounter().f(499)); 51 Expect.equals("### !!! 499 !!! ###", new ClickCounter().f(499));
50 } 52 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698