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

Side by Side Diff: runtime/tests/vm/dart/isolate_mirror_local_test.dart

Issue 10887023: Use new try-catch syntax in runtime/, tools/, and utils/. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 3 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
« no previous file with comments | « runtime/lib/mirrors_impl.dart ('k') | runtime/tests/vm/dart/isolate_mirror_remote_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 // Dart test program for checking implemention of MirrorSystem when 5 // Dart test program for checking implemention of MirrorSystem when
6 // inspecting the current isolate. 6 // inspecting the current isolate.
7 7
8 #library('isolate_mirror_local_test'); 8 #library('isolate_mirror_local_test');
9 9
10 #import('dart:isolate'); 10 #import('dart:isolate');
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after
361 int method(int arg) { 361 int method(int arg) {
362 return arg + value; 362 return arg + value;
363 } 363 }
364 } 364 }
365 365
366 void testCustomInstanceMirror(InstanceMirror mirror) { 366 void testCustomInstanceMirror(InstanceMirror mirror) {
367 Expect.isTrue(mirror.hasReflectee); 367 Expect.isTrue(mirror.hasReflectee);
368 bool saw_exception = false; 368 bool saw_exception = false;
369 try { 369 try {
370 mirror.reflectee; 370 mirror.reflectee;
371 } catch (MirrorException me) { 371 } on MirrorException catch (me) {
372 saw_exception = true; 372 saw_exception = true;
373 } 373 }
374 Expect.isFalse(saw_exception); 374 Expect.isFalse(saw_exception);
375 Expect.equals("InstanceMirror on instance of 'MyClass'", mirror.toString()); 375 Expect.equals("InstanceMirror on instance of 'MyClass'", mirror.toString());
376 376
377 ClassMirror cls = mirror.type; 377 ClassMirror cls = mirror.type;
378 Expect.isTrue(cls is ClassMirror); 378 Expect.isTrue(cls is ClassMirror);
379 Expect.equals('MyClass', cls.simpleName); 379 Expect.equals('MyClass', cls.simpleName);
380 Expect.equals('MySuperClass', cls.superclass.simpleName); 380 Expect.equals('MySuperClass', cls.superclass.simpleName);
381 Expect.isTrue(cls.defaultFactory === null); 381 Expect.isTrue(cls.defaultFactory === null);
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
488 // Test that an isolate can reflect on itself. 488 // Test that an isolate can reflect on itself.
489 mirrorSystemOf(exit_port.toSendPort()).then(testMirrorSystem); 489 mirrorSystemOf(exit_port.toSendPort()).then(testMirrorSystem);
490 490
491 testIntegerInstanceMirror(reflect(1001)); 491 testIntegerInstanceMirror(reflect(1001));
492 testStringInstanceMirror(reflect('This\nis\na\nString')); 492 testStringInstanceMirror(reflect('This\nis\na\nString'));
493 testBoolInstanceMirror(reflect(true)); 493 testBoolInstanceMirror(reflect(true));
494 testNullInstanceMirror(reflect(null)); 494 testNullInstanceMirror(reflect(null));
495 testCustomInstanceMirror(reflect(new MyClass(17))); 495 testCustomInstanceMirror(reflect(new MyClass(17)));
496 testMirrorErrors(currentMirrorSystem()); 496 testMirrorErrors(currentMirrorSystem());
497 } 497 }
OLDNEW
« no previous file with comments | « runtime/lib/mirrors_impl.dart ('k') | runtime/tests/vm/dart/isolate_mirror_remote_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698