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

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

Issue 2802973005: Migrate async tests to strong (Closed)
Patch Set: Created 3 years, 8 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 context["onerror"] = new JsFunction.withThis(errorHandler);
29
30 void throwit() {
31 var err = ++ctr;
32 try {
33 throw err;
34 } catch (e, s) {
35 errors.add([e, s]);
36 rethrow;
37 }
38 }
39
40 () async {
41 () async {
42 throwit();
43 }();
44 throwit();
45 }();
46 }
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