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

Side by Side Diff: tests/compiler/dart2js_native/browser_compat_1_prepatched_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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 //import 'dart:_foreign_helper' show JS; 7 //import 'dart:_foreign_helper' show JS;
7 //import 'dart:_js_helper' show Creates, setNativeSubclassDispatchRecord; 8 //import 'dart:_js_helper' show Creates, setNativeSubclassDispatchRecord;
8 9
9 // Test for dartNativeDispatchHooksTransformer, getTag hook. 10 // Test for dartNativeDispatchHooksTransformer, getTag hook.
10 11
11 class T1A native "T1A" { 12 @Native("T1A")
13 class T1A {
12 } 14 }
13 15
14 class T1B native "T1B" { 16 @Native("T1B")
17 class T1B {
15 } 18 }
16 19
17 class T1C native "T1C" { 20 @Native("T1C")
21 class T1C {
18 } 22 }
19 23
20 makeT1A() native; 24 makeT1A() native;
21 makeT1B() native; 25 makeT1B() native;
22 makeT1C() native; 26 makeT1C() native;
23 27
24 int getTagCallCount() native; 28 int getTagCallCount() native;
25 29
26 void setup() native r''' 30 void setup() native r'''
27 function T1A() { } // Normal native class. 31 function T1A() { } // Normal native class.
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 Expect.equals(true, t1c is T1C, '$t1c is T1C'); 87 Expect.equals(true, t1c is T1C, '$t1c is T1C');
84 88
85 Expect.equals(2, getTagCallCount()); 89 Expect.equals(2, getTagCallCount());
86 90
87 Expect.equals(true, inscrutable(t1a) is T1A, '$t1a is T1A'); 91 Expect.equals(true, inscrutable(t1a) is T1A, '$t1a is T1A');
88 Expect.equals(true, inscrutable(t1b) is T1B, '$t1b is T1B'); 92 Expect.equals(true, inscrutable(t1b) is T1B, '$t1b is T1B');
89 Expect.equals(true, inscrutable(t1c) is T1C, '$t1c is T1C'); 93 Expect.equals(true, inscrutable(t1c) is T1C, '$t1c is T1C');
90 94
91 Expect.equals(2, getTagCallCount()); 95 Expect.equals(2, getTagCallCount());
92 } 96 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698