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

Side by Side Diff: tests/lib_strong/async/dart2js_uncaught_error_test.dart

Issue 2999943002: Migrated test block 168 to Dart 2.0. (Closed)
Patch Set: Fixed package:test crash related issues, addressed Bob's comments. Created 3 years, 4 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
« no previous file with comments | « tests/lib_strong/async/catch_errors_test.dart ('k') | tests/lib_strong/async/event_helper.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
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.
4
5 import "dart:async";
6 import "dart:js";
7 import "dart:collection" show Queue;
8 import "package:expect/expect.dart";
9 import "package:async_helper/async_helper.dart";
10
11 var errors = new Queue();
12 int ctr = 0;
13
14 main() {
15 print("STARTED");
16 asyncStart();
17
18 void errorHandler(self, message, url, line, [column, error]) {
19 print(">> $message / $ctr");
20 var expect = errors.removeFirst();
21 if (ctr == 2) {
22 asyncEnd();
23 print("DONE");
24 }
25 Expect.equals(expect[0].toString(), message);
26 Expect.equals(expect[1].toString(), error["stack"].toString());
27 }
28
29 context["onerror"] = new JsFunction.withThis(errorHandler);
30
31 void throwit() {
32 var err = ++ctr;
33 try {
34 throw err;
35 } catch (e, s) {
36 errors.add([e, s]);
37 rethrow;
38 }
39 }
40
41 () async {
42 () async {
43 throwit();
44 }();
45 throwit();
46 }();
47 }
OLDNEW
« no previous file with comments | « tests/lib_strong/async/catch_errors_test.dart ('k') | tests/lib_strong/async/event_helper.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698