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

Side by Side Diff: tests/html/isolates_test.dart

Issue 10891020: Update almost all tests (except co19) to use the new try-catch syntax. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Merge. 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 | « tests/html/inner_frame_test.dart ('k') | tests/html/window_nosuchmethod_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 #library('IsolatesTest'); 1 #library('IsolatesTest');
2 #import('../../pkg/unittest/unittest.dart'); 2 #import('../../pkg/unittest/unittest.dart');
3 #import('../../pkg/unittest/html_config.dart'); 3 #import('../../pkg/unittest/html_config.dart');
4 #import('dart:html'); 4 #import('dart:html');
5 #import('dart:json'); 5 #import('dart:json');
6 #import('dart:isolate', prefix:'isolate'); 6 #import('dart:isolate', prefix:'isolate');
7 7
8 String responseFor(message) => 'response for $message'; 8 String responseFor(message) => 'response for $message';
9 9
10 void isolateEntry() { 10 void isolateEntry() {
11 bool wasThrown = false; 11 bool wasThrown = false;
12 try { 12 try {
13 window.alert('Test'); 13 window.alert('Test');
14 } catch(final e) { 14 } catch (e) {
15 wasThrown = true; 15 wasThrown = true;
16 } 16 }
17 // If wasn't thrown, do not listen to messages to make test fail. 17 // If wasn't thrown, do not listen to messages to make test fail.
18 if (!wasThrown) { 18 if (!wasThrown) {
19 return; 19 return;
20 } 20 }
21 21
22 // Check that JSON library was loaded to isolate. 22 // Check that JSON library was loaded to isolate.
23 JSON.stringify([1, 2, 3]); 23 JSON.stringify([1, 2, 3]);
24 24
(...skipping 18 matching lines...) Expand all
43 port.call(msg2).then((response) { 43 port.call(msg2).then((response) {
44 guardAsync(() { 44 guardAsync(() {
45 Expect.equals(responseFor(msg2), response); 45 Expect.equals(responseFor(msg2), response);
46 callback(); 46 callback();
47 }); 47 });
48 }); 48 });
49 }); 49 });
50 }); 50 });
51 }); 51 });
52 } 52 }
OLDNEW
« no previous file with comments | « tests/html/inner_frame_test.dart ('k') | tests/html/window_nosuchmethod_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698