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

Side by Side Diff: test/debugger/debug/es6/debug-promises/throw-caught-all.js

Issue 2497973002: [debug-wrapper] Further extend the debug wrapper (Closed)
Patch Set: Address comments Created 4 years, 1 month 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
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Flags: --expose-debug-as debug --allow-natives-syntax
6 5
7 // Test debug events when we listen to all exceptions and 6 // Test debug events when we listen to all exceptions and
8 // there is a catch handler for the exception thrown in a Promise. 7 // there is a catch handler for the exception thrown in a Promise.
9 // We expect a normal Exception debug event to be triggered. 8 // We expect a normal Exception debug event to be triggered.
10 9
11 Debug = debug.Debug; 10 Debug = debug.Debug;
12 11
13 var expected_events = 1; 12 var expected_events = 1;
14 var log = []; 13 var log = [];
15 14
(...skipping 12 matching lines...) Expand all
28 function(e) { 27 function(e) {
29 assertEquals("caught", e.message); 28 assertEquals("caught", e.message);
30 }); 29 });
31 30
32 function listener(event, exec_state, event_data, data) { 31 function listener(event, exec_state, event_data, data) {
33 try { 32 try {
34 if (event == Debug.DebugEvent.Exception) { 33 if (event == Debug.DebugEvent.Exception) {
35 expected_events--; 34 expected_events--;
36 assertTrue(expected_events >= 0); 35 assertTrue(expected_events >= 0);
37 assertEquals("caught", event_data.exception().message); 36 assertEquals("caught", event_data.exception().message);
38 assertSame(q, event_data.promise());
39 assertFalse(event_data.uncaught()); 37 assertFalse(event_data.uncaught());
40 } 38 }
41 } catch (e) { 39 } catch (e) {
42 %AbortJS(e + "\n" + e.stack); 40 %AbortJS(e + "\n" + e.stack);
43 } 41 }
44 } 42 }
45 43
46 Debug.setBreakOnException(); 44 Debug.setBreakOnException();
47 Debug.setListener(listener); 45 Debug.setListener(listener);
48 46
(...skipping 10 matching lines...) Expand all
59 } 57 }
60 } catch (e) { 58 } catch (e) {
61 %AbortJS(e + "\n" + e.stack); 59 %AbortJS(e + "\n" + e.stack);
62 } 60 }
63 } 61 }
64 62
65 %EnqueueMicrotask(checkResult); 63 %EnqueueMicrotask(checkResult);
66 } 64 }
67 65
68 testDone(0); 66 testDone(0);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698