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

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

Issue 13973017: Revert "Revert "Allow multiple tags in native clause."" (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: rebase Created 7 years, 8 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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 "package:expect/expect.dart"; 5 import "package:expect/expect.dart";
6 6
7 // Test to see if novel HTML tags are interpreted as HTMLElement. 7 // Test to see if novel HTML tags are interpreted as HTMLElement.
8 8
9 class Element native "*HTMLElement" { 9 class Element native "HTMLElement" {
10 String dartMethod(int x) => 'dartMethod(${nativeMethod(x+1)})'; 10 String dartMethod(int x) => 'dartMethod(${nativeMethod(x+1)})';
11 String nativeMethod(int x) native; 11 String nativeMethod(int x) native;
12 } 12 }
13 13
14 makeE() native; 14 makeE() native;
15 makeF() native; 15 makeF() native;
16 16
17 void setup() native """ 17 void setup() native """
18 // A novel HTML element. 18 // A novel HTML element.
19 function HTMLGoofyElement(){} 19 function HTMLGoofyElement(){}
(...skipping 24 matching lines...) Expand all
44 var e = makeE(); 44 var e = makeE();
45 Expect.equals('Goofy.nativeMethod(10)', e.nativeMethod(10)); 45 Expect.equals('Goofy.nativeMethod(10)', e.nativeMethod(10));
46 Expect.equals('dartMethod(Goofy.nativeMethod(11))', e.dartMethod(10)); 46 Expect.equals('dartMethod(Goofy.nativeMethod(11))', e.dartMethod(10));
47 47
48 var f = makeF(); 48 var f = makeF();
49 Expect.throws(() => f.nativeMethod(20), (e) => e is NoSuchMethodError, 49 Expect.throws(() => f.nativeMethod(20), (e) => e is NoSuchMethodError,
50 'fake HTML Element must not run Dart method on native class'); 50 'fake HTML Element must not run Dart method on native class');
51 Expect.throws(() => f.dartMethod(20), (e) => e is NoSuchMethodError, 51 Expect.throws(() => f.dartMethod(20), (e) => e is NoSuchMethodError,
52 'fake HTML Element must not run native method on native class'); 52 'fake HTML Element must not run native method on native class');
53 } 53 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698