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

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

Issue 2383273002: Revert "Add native_testing library to mock @Native classes" (Closed)
Patch Set: Created 4 years, 2 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
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 'native_testing.dart'; 5 import "package:expect/expect.dart";
6 import 'dart:_foreign_helper' show JS;
6 7
7 class A { 8 class A {
8 int a; 9 int a;
9 } 10 }
10 11
11 class B extends A { 12 class B extends A {
12 int b; 13 int b;
13 } 14 }
14 15
15 @NoInline() 16 @NoInline()
16 escape(v) { g = v; } 17 escape(v) { g = v; }
17 var g; 18 var g;
18 19
19 main() { 20 main() {
20 g = new A(); 21 g = new A();
21 var a = JS('returns:A;new:true', '(1,#)', new B()); 22 var a = JS('returns:A;new:true', '(1,#)', new B());
22 23
23 a.a = 1; 24 a.a = 1;
24 if (a is B) { 25 if (a is B) {
25 escape(a); // Here we need to escape 'a' not the refinement of a to B. 26 escape(a); // Here we need to escape 'a' not the refinement of a to B.
26 g.a = 2; 27 g.a = 2;
27 Expect.equals(2, a.a); 28 Expect.equals(2, a.a);
28 } 29 }
29 } 30 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js_native/jsobject_test.dart ('k') | tests/compiler/dart2js_native/mirror_intercepted_field_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698