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

Side by Side Diff: tests/language/vm/regress_27201_test.dart

Issue 2537253002: Fixed assert causing crash when attempting to load a library from an invalid path. (Closed)
Patch Set: Addressed comments from initial upload Created 4 years 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/language/vm/regress_27201_lib.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /*
2 * Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
3 * for details. All rights reserved. Use of this source code is governed by a
4 * BSD-style license that can be found in the LICENSE file.
5 */
6 import "dart:async";
7 import "package:expect/expect.dart";
8 import "regress_27201_lib.dart" deferred as p;
9 import "regress_27201_bad_lib_path.dart" deferred as q;
10
11 test_loaded() {
12 try {
13 p.someFunc();
14 } catch (e) {
15 Expect.fail("Should not be here");
16 }
17 try {
18 p.someGetter;
19 } catch (e) {
20 Expect.fail("Should not be here");
21 }
22 try {
23 p.someSetter = 1;
24 } catch (e) {
25 Expect.fail("Should not be here");
26 }
27 try {
28 p.Func;
29 } catch (e) {
30 Expect.fail("Should not be here");
31 }
32 try {
33 Expect.isTrue(p.loadLibrary() is Future);
34 } catch (e) {
35 Expect.fail("Should not be here");
36 }
37 }
38
39
40 main() {
41 p.loadLibrary().then((v) {
42 test_loaded();
43 },
44 onError: (e) {
45 Expect.fail("Should have loaded library!");
46 });
47
48 // Ensure bad library import is handled correctly.
49 q.loadLibrary().then((v) {
50 Expect.fail("Should have failed");
51 },
52 onError: (e) {
53 Expect.throws(() => q.x);
54 });
55 }
56
OLDNEW
« no previous file with comments | « tests/language/vm/regress_27201_lib.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698