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

Side by Side Diff: tests/compiler/dart2js_foreign/native_class_inheritance1_test.dart

Issue 12743005: Revert "Remove Expect from core library." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Reupload (first upload failed). Created 7 years, 9 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 // Test to see if resolving a hidden native class's method interferes with 5 // Test to see if resolving a hidden native class's method interferes with
6 // subsequent resolving the subclass's method. This might happen if the 6 // subsequent resolving the subclass's method. This might happen if the
7 // superclass caches the method in the prototype, so shadowing the dispatcher 7 // superclass caches the method in the prototype, so shadowing the dispatcher
8 // stored on Object.prototype. 8 // stored on Object.prototype.
9 9
10 import "package:expect/expect.dart";
11 import 'native_metadata.dart'; 10 import 'native_metadata.dart';
12 11
13 // Version 1: It might be possible to call foo directly. 12 // Version 1: It might be possible to call foo directly.
14 @Native("*A1") 13 @Native("*A1")
15 class A1 { 14 class A1 {
16 @native foo(); 15 @native foo();
17 } 16 }
18 17
19 @Native("*B1") 18 @Native("*B1")
20 class B1 extends A1 { 19 class B1 extends A1 {
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 caught = false; 99 caught = false;
101 try { 100 try {
102 var x = 123; 101 var x = 123;
103 x.foo(20); 102 x.foo(20);
104 } catch (ex) { 103 } catch (ex) {
105 caught = true; 104 caught = true;
106 Expect.isTrue(ex is NoSuchMethodError); 105 Expect.isTrue(ex is NoSuchMethodError);
107 } 106 }
108 Expect.isTrue(caught, "x.foo(20) should throw"); 107 Expect.isTrue(caught, "x.foo(20) should throw");
109 } 108 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698