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

Side by Side Diff: tests/standalone/oom_error_stacktrace_test.dart

Issue 19106008: Fix for issue 11680 (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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 | Annotate | Revision Log
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 // Dart test program for testing throw statement
5
6 import "package:expect/expect.dart";
7
8 class Helper1 {
9 static int func1() {
10 return func2();
11 }
12 static int func2() {
13 return func3();
14 }
15 static int func3() {
16 return func4();
17 }
18 static int func4() {
19 var i = 0;
20 try {
21 i = 10;
22 func5();
23 } on OutOfMemoryError catch (e) {
24 i = 100;
25 Expect.isNull(e.stackTrace, "OOM should not have a stackTrace on throw");
26 }
27 return i;
28 }
29 static List func5() {
30 // Cause an OOM(out of memory) exception.
31 var l1 = new List(268435455);
32 return l1;
33 }
34 }
35
36 class OOMErrorStackTraceTest {
37 static testMain() {
38 Expect.equals(100, Helper1.func1());
39 }
40 }
41
42 main() {
43 OOMErrorStackTraceTest.testMain();
44 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698