LayoutTests/ChangeLog

 12016-07-01 Joseph Pecoraro <pecoraro@apple.com>
 2
 3 REGRESSION (r202529?) inspector/debugger/break-on-* tests are flaky
 4 https://bugs.webkit.org/show_bug.cgi?id=159272
 5 <rdar://problem/27087938>
 6
 7 Reviewed by NOBODY (OOPS!).
 8
 9 Rewrite the break on exception and uncaught exception tests
 10 to be easier to read and understand, reduce duplicated code,
 11 and avoid unnecessary work (such as a reload and script check).
 12
 13 * TestExpectations:
 14 * platform/mac-wk2/TestExpectations:
 15 * platform/mac/TestExpectations:
 16 Unskip the core break-on-* tests, but mark them as Slow.
 17
 18 * inspector/debugger/break-on-exception-throw-in-promise.html:
 19 * inspector/debugger/break-on-exception-throw-in-promise-expected.txt:
 20 * inspector/debugger/break-on-uncaught-exception-throw-in-promise-expected.txt:
 21 * inspector/debugger/break-on-uncaught-exception-throw-in-promise.html:
 22 * inspector/debugger/break-on-exception-expected.txt:
 23 * inspector/debugger/break-on-exception.html:
 24 * inspector/debugger/break-on-uncaught-exception-expected.txt:
 25 * inspector/debugger/break-on-uncaught-exception.html:
 26 Converge into 4 tests, share a significant amount of code,
 27 and make them easier to read and understand.
 28
 29 * inspector/debugger/break-on-exception-catch-expected.txt: Removed.
 30 * inspector/debugger/break-on-exception-catch.html: Removed.
 31 * inspector/debugger/break-on-exception-finally-expected.txt: Removed.
 32 * inspector/debugger/break-on-exception-finally.html: Removed.
 33 * inspector/debugger/break-on-exception-native-expected.txt: Removed.
 34 * inspector/debugger/break-on-exception-native.html: Removed.
 35 * inspector/debugger/break-on-exception-throw-in-promise-rethrow-in-catch-expected.txt: Removed.
 36 * inspector/debugger/break-on-exception-throw-in-promise-rethrow-in-catch.html: Removed.
 37 * inspector/debugger/break-on-exception-throw-in-promise-then-expected.txt: Removed.
 38 * inspector/debugger/break-on-exception-throw-in-promise-then-with-catch-expected.txt: Removed.
 39 * inspector/debugger/break-on-exception-throw-in-promise-then-with-catch.html: Removed.
 40 * inspector/debugger/break-on-exception-throw-in-promise-then.html: Removed.
 41 * inspector/debugger/break-on-exception-throw-in-promise-with-catch-expected.txt: Removed.
 42 * inspector/debugger/break-on-exception-throw-in-promise-with-catch.html: Removed.
 43 * inspector/debugger/break-on-uncaught-exception-catch-expected.txt: Removed.
 44 * inspector/debugger/break-on-uncaught-exception-catch.html: Removed.
 45 * inspector/debugger/break-on-uncaught-exception-finally-expected.txt: Removed.
 46 * inspector/debugger/break-on-uncaught-exception-finally.html: Removed.
 47 * inspector/debugger/break-on-uncaught-exception-native-expected.txt: Removed.
 48 * inspector/debugger/break-on-uncaught-exception-native.html: Removed.
 49 * inspector/debugger/break-on-uncaught-exception-throw-in-promise-rethrow-in-catch-expected.txt: Removed.
 50 * inspector/debugger/break-on-uncaught-exception-throw-in-promise-rethrow-in-catch.html: Removed.
 51 * inspector/debugger/break-on-uncaught-exception-throw-in-promise-then-expected.txt: Removed.
 52 * inspector/debugger/break-on-uncaught-exception-throw-in-promise-then-with-catch-expected.txt: Removed.
 53 * inspector/debugger/break-on-uncaught-exception-throw-in-promise-then-with-catch.html: Removed.
 54 * inspector/debugger/break-on-uncaught-exception-throw-in-promise-then.html: Removed.
 55 * inspector/debugger/break-on-uncaught-exception-throw-in-promise-with-catch-expected.txt: Removed.
 56 * inspector/debugger/break-on-uncaught-exception-throw-in-promise-with-catch.html: Removed.
 57 Merged into the 4 tests above.
 58
 59 * inspector/debugger/break-on-exception-window-onerror-expected.txt: Removed.
 60 * inspector/debugger/break-on-exception-window-onerror.html: Removed.
 61 * inspector/debugger/break-on-uncaught-exception-window-onerror-expected.txt: Removed.
 62 * inspector/debugger/break-on-uncaught-exception-window-onerror.html: Removed.
 63 Eliminate these entirely. Tests already have an onerror listener,
 64 so these were actually already equivalent to the basic tests.
 65
1662016-06-30 Joseph Pecoraro <pecoraro@apple.com>
267
368 inspector/debugger/command-line-api-exception.html flakily times out on mac

LayoutTests/TestExpectations

@@webkit.org/b/148036 http/tests/inspector/replay/ [ Skip ]
131131
132132webkit.org/b/129639 inspector/dom/dom-search-crash.html [ Skip ]
133133
134 webkit.org/b/147502 inspector/debugger/break-on-uncaught-exception-throw-in-promise-rethrow-in-catch.html [ Skip ]
135 webkit.org/b/147502 inspector/debugger/break-on-uncaught-exception-throw-in-promise-then-with-catch.html [ Skip ]
136 webkit.org/b/147502 inspector/debugger/break-on-uncaught-exception-throw-in-promise-then.html [ Skip ]
137 webkit.org/b/147502 inspector/debugger/break-on-uncaught-exception-throw-in-promise-with-catch.html [ Skip ]
138 webkit.org/b/147502 inspector/debugger/break-on-uncaught-exception-throw-in-promise.html [ Skip ]
139134webkit.org/b/128736 inspector/debugger/setBreakpoint-dfg.html [ Failure Pass ]
140135webkit.org/b/134982 inspector/debugger/setBreakpoint-dfg-and-modify-local.html [ Failure Pass ]
141136

LayoutTests/inspector/debugger/break-on-exception-catch-expected.txt

1 CONSOLE MESSAGE: line 12: testCatch
2 CONSOLE MESSAGE: line 7: throwing TestError
3 CONSOLE MESSAGE: line 16: catch TestError
4 CONSOLE MESSAGE: line 18: DONE
5 Checking pause locations when pausing on all exceptions.
6 
7 PAUSE #1 AT: doThrow:8:22
8 

LayoutTests/inspector/debugger/break-on-exception-catch.html

1 <!doctype html>
2 <html>
3 <head>
4 <script type="text/javascript" src="../../http/tests/inspector/resources/inspector-test.js"></script>
5 <script type="text/javascript" src="./resources/break-on-exception-tests.js"></script>
6 <script>
7 function test() {
8  function doExceptionTest(testName, exceptionBreakType, resumeAction)
9  {
10  var pauses = 0;
11  var index = 0;
12 
13  function runTestCase(test) {
14  InspectorTest.evaluateInPage("setTimeout(" + test + ", 50)");
15  }
16 
17  WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.ScriptAdded, function(event) {
18  var scriptObject = event.data.script;
19  if (!/break-on-exception-tests\.js$/.test(scriptObject.url))
20  return;
21 
22  if (exceptionBreakType == 'AllExceptions')
23  WebInspector.debuggerManager.allExceptionsBreakpoint.disabled = false;
24  else
25  WebInspector.debuggerManager.allUncaughtExceptionsBreakpoint.disabled = false;
26 
27  runTestCase(testName);
28  });
29 
30  WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.CallFramesDidChange, function(event) {
31  var callFrame = WebInspector.debuggerManager.activeCallFrame;
32  if (callFrame) {
33  // Pausing.
34  InspectorTest.assert(WebInspector.debuggerManager.pauseReason == "exception");
35 
36  var funcName = callFrame.functionName || "<anonymous>";
37  var location = callFrame.sourceCodeLocation;
38  var line = location.lineNumber + 1;
39  var column = location.columnNumber + 1;
40 
41  InspectorTest.log("PAUSE #" + (++pauses) + " AT: " + funcName + ":" + line + ":" + column);
42  WebInspector.debuggerManager.resume();
43 
44  } else {
45  // Resuming.
46  if (resumeAction == 'FinishOnResume')
47  InspectorTest.completeTest();
48  }
49  });
50 
51  // This is a signal mechanism for the web process to tell us that the test is done.
52  // The web process fires the signal by doing console.log("DONE").
53  WebInspector.logManager.addEventListener(WebInspector.LogManager.Event.MessageAdded, function(event) {
54  var message = event.data.message;
55  if (!message.parameters || message.parameters.length !== 1)
56  return;
57  if (message.parameters[0].type !== "string" || message.parameters[0].description !== "DONE")
58  return;
59  InspectorTest.completeTest();
60  });
61 
62  InspectorTest.reloadPage();
63  }
64 
65  doExceptionTest('testCatch', 'AllExceptions', 'IgnoreResume');
66 }
67 </script>
68 </head>
69 <body onload="runTest()">
70  <p>Checking pause locations when pausing on all exceptions.</p>
71 </body>
72 </html>

LayoutTests/inspector/debugger/break-on-exception-expected.txt

11CONSOLE MESSAGE: line 7: throwing TestError
22CONSOLE MESSAGE: line 8: TestError
 3CONSOLE MESSAGE: line 22: testFinally
 4CONSOLE MESSAGE: line 7: throwing TestError
 5CONSOLE MESSAGE: line 26: finally
 6CONSOLE MESSAGE: line 8: TestError
 7CONSOLE MESSAGE: line 31: testThrowingThruNativeCode
 8CONSOLE MESSAGE: line 7: throwing TestError
 9CONSOLE MESSAGE: line 8: TestError
 10CONSOLE MESSAGE: line 12: testCatch
 11CONSOLE MESSAGE: line 7: throwing TestError
 12CONSOLE MESSAGE: line 16: catch TestError
 13CONSOLE MESSAGE: line 18: DONE
314Checking pause locations when pausing on all exceptions.
415
5 PAUSE #1 AT: doThrow:8:22
 16
 17== Running test suite: BreakOnAnyException
 18-- Running test case: BreakOnAnyException.UncaughtExceptionBasic
 19PASS: Should pause for exception.
 20PAUSE AT doThrow:8:22
 21Uncaught exception in test page: TestError [break-on-exception-tests.js:8]
 22
 23-- Running test case: BreakOnAnyException.UncaughtExceptionInFinally
 24PASS: Should pause for exception.
 25PAUSE AT doThrow:8:22
626Uncaught exception in test page: TestError [break-on-exception-tests.js:8]
727
 28-- Running test case: BreakOnAnyException.UncaughtExceptionThruNativeCode
 29PASS: Should pause for exception.
 30PAUSE AT doThrow:8:22
 31Uncaught exception in test page: TestError [break-on-exception-tests.js:8]
 32
 33-- Running test case: BreakOnAnyException.CaughtException
 34PASS: Should pause for exception.
 35PAUSE AT doThrow:8:22
 36

LayoutTests/inspector/debugger/break-on-exception-finally-expected.txt

1 CONSOLE MESSAGE: line 22: testFinally
2 CONSOLE MESSAGE: line 7: throwing TestError
3 CONSOLE MESSAGE: line 26: finally
4 CONSOLE MESSAGE: line 8: TestError
5 Checking pause locations when pausing on all exceptions.
6 
7 PAUSE #1 AT: doThrow:8:22
8 Uncaught exception in test page: TestError [break-on-exception-tests.js:8]
9 

LayoutTests/inspector/debugger/break-on-exception-finally.html

1 <!doctype html>
2 <html>
3 <head>
4 <script type="text/javascript" src="../../http/tests/inspector/resources/inspector-test.js"></script>
5 <script type="text/javascript" src="./resources/break-on-exception-tests.js"></script>
6 <script>
7 function test() {
8  function doExceptionTest(testName, exceptionBreakType, resumeAction)
9  {
10  var pauses = 0;
11  var index = 0;
12 
13  function runTestCase(test) {
14  InspectorTest.evaluateInPage("setTimeout(" + test + ", 50)");
15  }
16 
17  WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.ScriptAdded, function(event) {
18  var scriptObject = event.data.script;
19  if (!/break-on-exception-tests\.js$/.test(scriptObject.url))
20  return;
21 
22  if (exceptionBreakType == 'AllExceptions')
23  WebInspector.debuggerManager.allExceptionsBreakpoint.disabled = false;
24  else
25  WebInspector.debuggerManager.allUncaughtExceptionsBreakpoint.disabled = false;
26 
27  runTestCase(testName);
28  });
29 
30  WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.CallFramesDidChange, function(event) {
31  var callFrame = WebInspector.debuggerManager.activeCallFrame;
32  if (callFrame) {
33  // Pausing.
34  InspectorTest.assert(WebInspector.debuggerManager.pauseReason == "exception");
35 
36  var funcName = callFrame.functionName || "<anonymous>";
37  var location = callFrame.sourceCodeLocation;
38  var line = location.lineNumber + 1;
39  var column = location.columnNumber + 1;
40 
41  InspectorTest.log("PAUSE #" + (++pauses) + " AT: " + funcName + ":" + line + ":" + column);
42  WebInspector.debuggerManager.resume();
43 
44  } else {
45  // Resuming.
46  if (resumeAction == 'FinishOnResume')
47  InspectorTest.completeTest();
48  }
49  });
50 
51  // This is a signal mechanism for the web process to tell us that the test is done.
52  // The web process fires the signal by doing console.log("DONE").
53  WebInspector.logManager.addEventListener(WebInspector.LogManager.Event.MessageAdded, function(event) {
54  var message = event.data.message;
55  if (!message.parameters || message.parameters.length !== 1)
56  return;
57  if (message.parameters[0].type !== "string" || message.parameters[0].description !== "DONE")
58  return;
59  InspectorTest.completeTest();
60  });
61 
62  InspectorTest.reloadPage();
63  }
64 
65  doExceptionTest('testFinally', 'AllExceptions', 'IgnoreResume');
66 }
67 </script>
68 </head>
69 <body onload="runTest()">
70  <p>Checking pause locations when pausing on all exceptions.</p>
71 </body>
72 </html>

LayoutTests/inspector/debugger/break-on-exception-native-expected.txt

1 CONSOLE MESSAGE: line 31: testThrowingThruNativeCode
2 CONSOLE MESSAGE: line 7: throwing TestError
3 CONSOLE MESSAGE: line 8: TestError
4 Checking pause locations when pausing on all exceptions.
5 
6 PAUSE #1 AT: doThrow:8:22
7 Uncaught exception in test page: TestError [break-on-exception-tests.js:8]
8 

LayoutTests/inspector/debugger/break-on-exception-native.html

1 <!doctype html>
2 <html>
3 <head>
4 <script type="text/javascript" src="../../http/tests/inspector/resources/inspector-test.js"></script>
5 <script type="text/javascript" src="./resources/break-on-exception-tests.js"></script>
6 <script>
7 function test() {
8  function doExceptionTest(testName, exceptionBreakType, resumeAction)
9  {
10  var pauses = 0;
11  var index = 0;
12 
13  function runTestCase(test) {
14  InspectorTest.evaluateInPage("setTimeout(" + test + ", 50)");
15  }
16 
17  WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.ScriptAdded, function(event) {
18  var scriptObject = event.data.script;
19  if (!/break-on-exception-tests\.js$/.test(scriptObject.url))
20  return;
21 
22  if (exceptionBreakType == 'AllExceptions')
23  WebInspector.debuggerManager.allExceptionsBreakpoint.disabled = false;
24  else
25  WebInspector.debuggerManager.allUncaughtExceptionsBreakpoint.disabled = false;
26 
27  runTestCase(testName);
28  });
29 
30  WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.CallFramesDidChange, function(event) {
31  var callFrame = WebInspector.debuggerManager.activeCallFrame;
32  if (callFrame) {
33  // Pausing.
34  InspectorTest.assert(WebInspector.debuggerManager.pauseReason == "exception");
35 
36  var funcName = callFrame.functionName || "<anonymous>";
37  var location = callFrame.sourceCodeLocation;
38  var line = location.lineNumber + 1;
39  var column = location.columnNumber + 1;
40 
41  InspectorTest.log("PAUSE #" + (++pauses) + " AT: " + funcName + ":" + line + ":" + column);
42  WebInspector.debuggerManager.resume();
43 
44  } else {
45  // Resuming.
46  if (resumeAction == 'FinishOnResume')
47  InspectorTest.completeTest();
48  }
49  });
50 
51  // This is a signal mechanism for the web process to tell us that the test is done.
52  // The web process fires the signal by doing console.log("DONE").
53  WebInspector.logManager.addEventListener(WebInspector.LogManager.Event.MessageAdded, function(event) {
54  var message = event.data.message;
55  if (!message.parameters || message.parameters.length !== 1)
56  return;
57  if (message.parameters[0].type !== "string" || message.parameters[0].description !== "DONE")
58  return;
59  InspectorTest.completeTest();
60  });
61 
62  InspectorTest.reloadPage();
63  }
64 
65  doExceptionTest('testThrowingThruNativeCode', 'AllExceptions', 'IgnoreResume');
66 }
67 </script>
68 </head>
69 <body onload="runTest()">
70  <p>Checking pause locations when pausing on all exceptions.</p>
71 </body>
72 </html>

LayoutTests/inspector/debugger/break-on-exception-throw-in-promise-expected.txt

11CONSOLE MESSAGE: line 36: testThrowingInPromise
22CONSOLE MESSAGE: line 38: in promise
33CONSOLE MESSAGE: line 7: throwing TestError
4 Checking pause locations when pausing on all exceptions.
 4CONSOLE MESSAGE: line 55: testThrowingInPromiseThen
 5CONSOLE MESSAGE: line 57: in promise
 6CONSOLE MESSAGE: line 60: in promise.then
 7CONSOLE MESSAGE: line 7: throwing TestError
 8CONSOLE MESSAGE: line 66: testThrowingInPromiseThenWithCatch
 9CONSOLE MESSAGE: line 68: in promise
 10CONSOLE MESSAGE: line 71: in promise.then
 11CONSOLE MESSAGE: line 7: throwing TestError
 12CONSOLE MESSAGE: line 74: in promise.catch
 13CONSOLE MESSAGE: line 75: DONE
 14CONSOLE MESSAGE: line 44: testThrowingInPromiseWithCatch
 15CONSOLE MESSAGE: line 46: in promise
 16CONSOLE MESSAGE: line 7: throwing TestError
 17CONSOLE MESSAGE: line 49: in promise.catch
 18CONSOLE MESSAGE: line 50: DONE
 19CONSOLE MESSAGE: line 80: testThrowingInPromiseWithRethrowInCatch
 20CONSOLE MESSAGE: line 82: in promise
 21CONSOLE MESSAGE: line 7: throwing TestError
 22CONSOLE MESSAGE: line 85: in promise.catch
 23Checking pause locations within Promises when pausing on all exceptions.
524
6 PAUSE #1 AT: doThrow:8:22
 25
 26== Running test suite: BreakOnAnyException.Promise
 27-- Running test case: BreakOnAnyException.Promise.ExceptionInPromiseConstructor
 28PASS: Should pause for exception.
 29PAUSE AT doThrow:8:22
 30
 31-- Running test case: BreakOnAnyException.Promise.ExceptionInPromiseThenWithoutCatch
 32PASS: Should pause for exception.
 33PAUSE AT doThrow:8:22
 34
 35-- Running test case: BreakOnAnyException.Promise.ExceptionInPromiseThenWithCatch
 36PASS: Should pause for exception.
 37PAUSE AT doThrow:8:22
 38
 39-- Running test case: BreakOnAnyException.Promise.ExceptionInPromiseCatch
 40PASS: Should pause for exception.
 41PAUSE AT doThrow:8:22
 42
 43-- Running test case: BreakOnAnyException.Promise.ExceptionInPromiseThenAndRethrownInCatch
 44PASS: Should pause for exception.
 45PAUSE AT doThrow:8:22
 46PASS: Should pause for exception.
 47PAUSE AT promiseCatch:86:16
748

LayoutTests/inspector/debugger/break-on-exception-throw-in-promise-rethrow-in-catch-expected.txt

1 CONSOLE MESSAGE: line 80: testThrowingInPromiseWithRethrowInCatch
2 CONSOLE MESSAGE: line 82: in promise
3 CONSOLE MESSAGE: line 7: throwing TestError
4 CONSOLE MESSAGE: line 85: in promise.catch
5 Checking pause locations when pausing on all exceptions.
6 
7 PAUSE #1 AT: doThrow:8:22
8 PAUSE #2 AT: promiseCatch:86:16
9 

LayoutTests/inspector/debugger/break-on-exception-throw-in-promise-rethrow-in-catch.html

1 <!doctype html>
2 <html>
3 <head>
4 <script type="text/javascript" src="../../http/tests/inspector/resources/inspector-test.js"></script>
5 <script type="text/javascript" src="./resources/break-on-exception-tests.js"></script>
6 <script>
7 function test() {
8  function doExceptionTest(testName, exceptionBreakType, resumeAction)
9  {
10  var pauses = 0;
11  var index = 0;
12 
13  function runTestCase(test) {
14  InspectorTest.evaluateInPage("setTimeout(" + test + ", 50)");
15  }
16 
17  WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.ScriptAdded, function(event) {
18  var scriptObject = event.data.script;
19  if (!/break-on-exception-tests\.js$/.test(scriptObject.url))
20  return;
21 
22  if (exceptionBreakType == 'AllExceptions')
23  WebInspector.debuggerManager.allExceptionsBreakpoint.disabled = false;
24  else
25  WebInspector.debuggerManager.allUncaughtExceptionsBreakpoint.disabled = false;
26 
27  runTestCase(testName);
28  });
29 
30  WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.CallFramesDidChange, function(event) {
31  var callFrame = WebInspector.debuggerManager.activeCallFrame;
32  if (callFrame) {
33  // Pausing.
34  InspectorTest.assert(WebInspector.debuggerManager.pauseReason == "exception");
35 
36  var funcName = callFrame.functionName || "<anonymous>";
37  var location = callFrame.sourceCodeLocation;
38  var line = location.lineNumber + 1;
39  var column = location.columnNumber + 1;
40 
41  InspectorTest.log("PAUSE #" + (++pauses) + " AT: " + funcName + ":" + line + ":" + column);
42  WebInspector.debuggerManager.resume();
43 
44  } else {
45  // Resuming.
46  if (resumeAction == 'FinishOnResume')
47  InspectorTest.completeTest();
48  }
49  });
50 
51  // This is a signal mechanism for the web process to tell us that the test is done.
52  // The web process fires the signal by doing console.log("DONE").
53  WebInspector.logManager.addEventListener(WebInspector.LogManager.Event.MessageAdded, function(event) {
54  var message = event.data.message;
55  if (!message.parameters || message.parameters.length !== 1)
56  return;
57  if (message.parameters[0].type !== "string" || message.parameters[0].description !== "DONE")
58  return;
59  InspectorTest.completeTest();
60  });
61 
62  InspectorTest.reloadPage();
63  }
64 
65  doExceptionTest('testThrowingInPromiseWithRethrowInCatch', 'AllExceptions', 'FinishOnResume');
66 }
67 </script>
68 </head>
69 <body onload="runTest()">
70  <p>Checking pause locations when pausing on all exceptions.</p>
71 </body>
72 </html>

LayoutTests/inspector/debugger/break-on-exception-throw-in-promise-then-expected.txt

1 CONSOLE MESSAGE: line 55: testThrowingInPromiseThen
2 CONSOLE MESSAGE: line 57: in promise
3 CONSOLE MESSAGE: line 60: in promise.then
4 CONSOLE MESSAGE: line 7: throwing TestError
5 Checking pause locations when pausing on all exceptions.
6 
7 PAUSE #1 AT: doThrow:8:22
8 

LayoutTests/inspector/debugger/break-on-exception-throw-in-promise-then-with-catch-expected.txt

1 CONSOLE MESSAGE: line 66: testThrowingInPromiseThenWithCatch
2 CONSOLE MESSAGE: line 68: in promise
3 CONSOLE MESSAGE: line 71: in promise.then
4 CONSOLE MESSAGE: line 7: throwing TestError
5 CONSOLE MESSAGE: line 74: in promise.catch
6 CONSOLE MESSAGE: line 75: DONE
7 Checking pause locations when pausing on all exceptions.
8 
9 PAUSE #1 AT: doThrow:8:22
10 

LayoutTests/inspector/debugger/break-on-exception-throw-in-promise-then-with-catch.html

1 <!doctype html>
2 <html>
3 <head>
4 <script type="text/javascript" src="../../http/tests/inspector/resources/inspector-test.js"></script>
5 <script type="text/javascript" src="./resources/break-on-exception-tests.js"></script>
6 <script>
7 function test() {
8  function doExceptionTest(testName, exceptionBreakType, resumeAction)
9  {
10  var pauses = 0;
11  var index = 0;
12 
13  function runTestCase(test) {
14  InspectorTest.evaluateInPage("setTimeout(" + test + ", 50)");
15  }
16 
17  WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.ScriptAdded, function(event) {
18  var scriptObject = event.data.script;
19  if (!/break-on-exception-tests\.js$/.test(scriptObject.url))
20  return;
21 
22  if (exceptionBreakType == 'AllExceptions')
23  WebInspector.debuggerManager.allExceptionsBreakpoint.disabled = false;
24  else
25  WebInspector.debuggerManager.allUncaughtExceptionsBreakpoint.disabled = false;
26 
27  runTestCase(testName);
28  });
29 
30  WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.CallFramesDidChange, function(event) {
31  var callFrame = WebInspector.debuggerManager.activeCallFrame;
32  if (callFrame) {
33  // Pausing.
34  InspectorTest.assert(WebInspector.debuggerManager.pauseReason == "exception");
35 
36  var funcName = callFrame.functionName || "<anonymous>";
37  var location = callFrame.sourceCodeLocation;
38  var line = location.lineNumber + 1;
39  var column = location.columnNumber + 1;
40 
41  InspectorTest.log("PAUSE #" + (++pauses) + " AT: " + funcName + ":" + line + ":" + column);
42  WebInspector.debuggerManager.resume();
43 
44  } else {
45  // Resuming.
46  if (resumeAction == 'FinishOnResume')
47  InspectorTest.completeTest();
48  }
49  });
50 
51  // This is a signal mechanism for the web process to tell us that the test is done.
52  // The web process fires the signal by doing console.log("DONE").
53  WebInspector.logManager.addEventListener(WebInspector.LogManager.Event.MessageAdded, function(event) {
54  var message = event.data.message;
55  if (!message.parameters || message.parameters.length !== 1)
56  return;
57  if (message.parameters[0].type !== "string" || message.parameters[0].description !== "DONE")
58  return;
59  InspectorTest.completeTest();
60  });
61 
62  InspectorTest.reloadPage();
63  }
64 
65  doExceptionTest('testThrowingInPromiseThenWithCatch', 'AllExceptions', 'IgnoreResume');
66 }
67 </script>
68 </head>
69 <body onload="runTest()">
70  <p>Checking pause locations when pausing on all exceptions.</p>
71 </body>
72 </html>

LayoutTests/inspector/debugger/break-on-exception-throw-in-promise-then.html

1 <!doctype html>
2 <html>
3 <head>
4 <script type="text/javascript" src="../../http/tests/inspector/resources/inspector-test.js"></script>
5 <script type="text/javascript" src="./resources/break-on-exception-tests.js"></script>
6 <script>
7 function test() {
8  function doExceptionTest(testName, exceptionBreakType, resumeAction)
9  {
10  var pauses = 0;
11  var index = 0;
12 
13  function runTestCase(test) {
14  InspectorTest.evaluateInPage("setTimeout(" + test + ", 50)");
15  }
16 
17  WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.ScriptAdded, function(event) {
18  var scriptObject = event.data.script;
19  if (!/break-on-exception-tests\.js$/.test(scriptObject.url))
20  return;
21 
22  if (exceptionBreakType == 'AllExceptions')
23  WebInspector.debuggerManager.allExceptionsBreakpoint.disabled = false;
24  else
25  WebInspector.debuggerManager.allUncaughtExceptionsBreakpoint.disabled = false;
26 
27  runTestCase(testName);
28  });
29 
30  WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.CallFramesDidChange, function(event) {
31  var callFrame = WebInspector.debuggerManager.activeCallFrame;
32  if (callFrame) {
33  // Pausing.
34  InspectorTest.assert(WebInspector.debuggerManager.pauseReason == "exception");
35 
36  var funcName = callFrame.functionName || "<anonymous>";
37  var location = callFrame.sourceCodeLocation;
38  var line = location.lineNumber + 1;
39  var column = location.columnNumber + 1;
40 
41  InspectorTest.log("PAUSE #" + (++pauses) + " AT: " + funcName + ":" + line + ":" + column);
42  WebInspector.debuggerManager.resume();
43 
44  } else {
45  // Resuming.
46  if (resumeAction == 'FinishOnResume')
47  InspectorTest.completeTest();
48  }
49  });
50 
51  // This is a signal mechanism for the web process to tell us that the test is done.
52  // The web process fires the signal by doing console.log("DONE").
53  WebInspector.logManager.addEventListener(WebInspector.LogManager.Event.MessageAdded, function(event) {
54  var message = event.data.message;
55  if (!message.parameters || message.parameters.length !== 1)
56  return;
57  if (message.parameters[0].type !== "string" || message.parameters[0].description !== "DONE")
58  return;
59  InspectorTest.completeTest();
60  });
61 
62  InspectorTest.reloadPage();
63  }
64 
65  doExceptionTest('testThrowingInPromiseThen', 'AllExceptions', 'FinishOnResume');
66 }
67 </script>
68 </head>
69 <body onload="runTest()">
70  <p>Checking pause locations when pausing on all exceptions.</p>
71 </body>
72 </html>

LayoutTests/inspector/debugger/break-on-exception-throw-in-promise-with-catch-expected.txt

1 CONSOLE MESSAGE: line 44: testThrowingInPromiseWithCatch
2 CONSOLE MESSAGE: line 46: in promise
3 CONSOLE MESSAGE: line 7: throwing TestError
4 CONSOLE MESSAGE: line 49: in promise.catch
5 CONSOLE MESSAGE: line 50: DONE
6 Checking pause locations when pausing on all exceptions.
7 
8 PAUSE #1 AT: doThrow:8:22
9 

LayoutTests/inspector/debugger/break-on-exception-throw-in-promise-with-catch.html

1 <!doctype html>
2 <html>
3 <head>
4 <script type="text/javascript" src="../../http/tests/inspector/resources/inspector-test.js"></script>
5 <script type="text/javascript" src="./resources/break-on-exception-tests.js"></script>
6 <script>
7 function test() {
8  function doExceptionTest(testName, exceptionBreakType, resumeAction)
9  {
10  var pauses = 0;
11  var index = 0;
12 
13  function runTestCase(test) {
14  InspectorTest.evaluateInPage("setTimeout(" + test + ", 50)");
15  }
16 
17  WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.ScriptAdded, function(event) {
18  var scriptObject = event.data.script;
19  if (!/break-on-exception-tests\.js$/.test(scriptObject.url))
20  return;
21 
22  if (exceptionBreakType == 'AllExceptions')
23  WebInspector.debuggerManager.allExceptionsBreakpoint.disabled = false;
24  else
25  WebInspector.debuggerManager.allUncaughtExceptionsBreakpoint.disabled = false;
26 
27  runTestCase(testName);
28  });
29 
30  WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.CallFramesDidChange, function(event) {
31  var callFrame = WebInspector.debuggerManager.activeCallFrame;
32  if (callFrame) {
33  // Pausing.
34  InspectorTest.assert(WebInspector.debuggerManager.pauseReason == "exception");
35 
36  var funcName = callFrame.functionName || "<anonymous>";
37  var location = callFrame.sourceCodeLocation;
38  var line = location.lineNumber + 1;
39  var column = location.columnNumber + 1;
40 
41  InspectorTest.log("PAUSE #" + (++pauses) + " AT: " + funcName + ":" + line + ":" + column);
42  WebInspector.debuggerManager.resume();
43 
44  } else {
45  // Resuming.
46  if (resumeAction == 'FinishOnResume')
47  InspectorTest.completeTest();
48  }
49  });
50 
51  // This is a signal mechanism for the web process to tell us that the test is done.
52  // The web process fires the signal by doing console.log("DONE").
53  WebInspector.logManager.addEventListener(WebInspector.LogManager.Event.MessageAdded, function(event) {
54  var message = event.data.message;
55  if (!message.parameters || message.parameters.length !== 1)
56  return;
57  if (message.parameters[0].type !== "string" || message.parameters[0].description !== "DONE")
58  return;
59  InspectorTest.completeTest();
60  });
61 
62  InspectorTest.reloadPage();
63  }
64 
65  doExceptionTest('testThrowingInPromiseWithCatch', 'AllExceptions', 'IgnoreResume');
66 }
67 </script>
68 </head>
69 <body onload="runTest()">
70  <p>Checking pause locations when pausing on all exceptions.</p>
71 </body>
72 </html>

LayoutTests/inspector/debugger/break-on-exception-throw-in-promise.html

1 <!doctype html>
 1<!DOCTYPE html>
22<html>
33<head>
4 <script type="text/javascript" src="../../http/tests/inspector/resources/inspector-test.js"></script>
5 <script type="text/javascript" src="./resources/break-on-exception-tests.js"></script>
 4<script src="../../http/tests/inspector/resources/inspector-test.js"></script>
 5<script src="resources/break-on-exception-tests.js"></script>
66<script>
7 function test() {
8  function doExceptionTest(testName, exceptionBreakType, resumeAction)
9  {
10  var pauses = 0;
11  var index = 0;
12 
13  function runTestCase(test) {
14  InspectorTest.evaluateInPage("setTimeout(" + test + ", 50)");
15  }
16 
17  WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.ScriptAdded, function(event) {
18  var scriptObject = event.data.script;
19  if (!/break-on-exception-tests\.js$/.test(scriptObject.url))
20  return;
21 
22  if (exceptionBreakType == 'AllExceptions')
23  WebInspector.debuggerManager.allExceptionsBreakpoint.disabled = false;
24  else
25  WebInspector.debuggerManager.allUncaughtExceptionsBreakpoint.disabled = false;
26 
27  runTestCase(testName);
28  });
29 
30  WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.CallFramesDidChange, function(event) {
31  var callFrame = WebInspector.debuggerManager.activeCallFrame;
32  if (callFrame) {
33  // Pausing.
34  InspectorTest.assert(WebInspector.debuggerManager.pauseReason == "exception");
35 
36  var funcName = callFrame.functionName || "<anonymous>";
37  var location = callFrame.sourceCodeLocation;
38  var line = location.lineNumber + 1;
39  var column = location.columnNumber + 1;
40 
41  InspectorTest.log("PAUSE #" + (++pauses) + " AT: " + funcName + ":" + line + ":" + column);
42  WebInspector.debuggerManager.resume();
43 
44  } else {
45  // Resuming.
46  if (resumeAction == 'FinishOnResume')
47  InspectorTest.completeTest();
 7TestPage.allowUncaughtExceptions = true;
 8
 9function test()
 10{
 11 WebInspector.debuggerManager.allExceptionsBreakpoint.disabled = false;
 12
 13 let suite = InspectorTest.createAsyncSuite("BreakOnAnyException.Promise");
 14
 15 InspectorTest.debug();
 16
 17 function addTestCase({name, description, expression}) {
 18 suite.addTestCase({
 19 name, description,
 20 test: (resolve, reject) => {
 21 InspectorTest.evaluateInPage(expression);
 22 WebInspector.debuggerManager.singleFireEventListener(WebInspector.DebuggerManager.Event.Paused, (event) => {
 23 InspectorTest.expectThat(WebInspector.debuggerManager.pauseReason === "exception", "Should pause for exception.");
 24 let callFrame = WebInspector.debuggerManager.activeCallFrame;
 25 let name = callFrame.functionName || "<anonymous>";
 26 let location = callFrame.sourceCodeLocation;
 27 let line = location.lineNumber + 1;
 28 let column = location.columnNumber + 1;
 29 InspectorTest.log(`PAUSE AT ${name}:${line}:${column}`);
 30 WebInspector.debuggerManager.resume().then(resolve, reject);
 31 });
4832 }
4933 });
50 
51  // This is a signal mechanism for the web process to tell us that the test is done.
52  // The web process fires the signal by doing console.log("DONE").
53  WebInspector.logManager.addEventListener(WebInspector.LogManager.Event.MessageAdded, function(event) {
54  var message = event.data.message;
55  if (!message.parameters || message.parameters.length !== 1)
56  return;
57  if (message.parameters[0].type !== "string" || message.parameters[0].description !== "DONE")
58  return;
59  InspectorTest.completeTest();
60  });
61 
62  InspectorTest.reloadPage();
6334 }
6435
65  doExceptionTest('testThrowingInPromise', 'AllExceptions', 'FinishOnResume');
 36 addTestCase({
 37 name: "BreakOnAnyException.Promise.ExceptionInPromiseConstructor",
 38 description: "Break on an exception thrown in Promise constructor.",
 39 expression: "setTimeout(testThrowingInPromise)",
 40 });
 41
 42 addTestCase({
 43 name: "BreakOnAnyException.Promise.ExceptionInPromiseThenWithoutCatch",
 44 description: "Break on an exception thrown in Promise then handler with no catch handler.",
 45 expression: "setTimeout(testThrowingInPromiseThen)",
 46 });
 47
 48 addTestCase({
 49 name: "BreakOnAnyException.Promise.ExceptionInPromiseThenWithCatch",
 50 description: "Break on an exception thrown in Promise then handler with a catch handler.",
 51 expression: "setTimeout(testThrowingInPromiseThenWithCatch)",
 52 });
 53
 54 addTestCase({
 55 name: "BreakOnAnyException.Promise.ExceptionInPromiseCatch",
 56 description: "Break on an exception thrown in Promise catch with no then handler.",
 57 expression: "setTimeout(testThrowingInPromiseWithCatch)",
 58 });
 59
 60 suite.addTestCase({
 61 name: "BreakOnAnyException.Promise.ExceptionInPromiseThenAndRethrownInCatch",
 62 description: "Break on an exception thrown in Promise then handler, and then again when rethrown in catch handler.",
 63 test: (resolve, reject) => {
 64 InspectorTest.evaluateInPage("setTimeout(testThrowingInPromiseWithRethrowInCatch)");
 65
 66 function logPauseLocation() {
 67 let callFrame = WebInspector.debuggerManager.activeCallFrame;
 68 let name = callFrame.functionName || "<anonymous>";
 69 let location = callFrame.sourceCodeLocation;
 70 let line = location.lineNumber + 1;
 71 let column = location.columnNumber + 1;
 72 InspectorTest.log(`PAUSE AT ${name}:${line}:${column}`);
 73 }
 74
 75 let phase = 0;
 76 let listener = WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.CallFramesDidChange, (event) => {
 77 if (!WebInspector.debuggerManager.activeCallFrame)
 78 return;
 79
 80 phase++;
 81
 82 // Pause at throw inside then.
 83 if (phase === 1) {
 84 InspectorTest.expectThat(WebInspector.debuggerManager.pauseReason === "exception", "Should pause for exception.");
 85 logPauseLocation();
 86 WebInspector.debuggerManager.resume();
 87 return;
 88 }
 89
 90 // Pause at re-throw inside catch.
 91 if (phase === 2) {
 92 InspectorTest.expectThat(WebInspector.debuggerManager.pauseReason === "exception", "Should pause for exception.");
 93 logPauseLocation();
 94 WebInspector.debuggerManager.resume().then(() => {
 95 WebInspector.debuggerManager.removeEventListener(WebInspector.DebuggerManager.Event.CallFramesDidChange, listener);
 96 resolve();
 97 }, reject);
 98 return;
 99 }
 100 });
 101 }
 102 });
 103
 104 suite.runTestCasesAndFinish();
66105}
67106</script>
68107</head>
69108<body onload="runTest()">
70  <p>Checking pause locations when pausing on all exceptions.</p>
 109<p>Checking pause locations within Promises when pausing on all exceptions.</p>
71110</body>
72111</html>

LayoutTests/inspector/debugger/break-on-exception-window-onerror-expected.txt

1 CONSOLE MESSAGE: line 7: throwing TestError
2 CONSOLE MESSAGE: line 8: window.onerror: TestError
3 CONSOLE MESSAGE: line 9: DONE
4 CONSOLE MESSAGE: line 8: TestError
5 Checking pause locations when pausing on all exceptions.
6 
7 PAUSE #1 AT: doThrow:8:22
8 

LayoutTests/inspector/debugger/break-on-exception-window-onerror.html

1 <!doctype html>
2 <html>
3 <head>
4 <script type="text/javascript" src="../../http/tests/inspector/resources/inspector-test.js"></script>
5 <script type="text/javascript" src="./resources/break-on-exception-tests.js"></script>
6 <script>
7 window.onerror = function(e) {
8  console.log("window.onerror: " + e);
9  console.log("DONE");
10 }
11 
12 function test() {
13  function doExceptionTest(testName, exceptionBreakType, resumeAction)
14  {
15  var pauses = 0;
16  var index = 0;
17 
18  function runTestCase(test) {
19  InspectorTest.evaluateInPage("setTimeout(" + test + ", 50)");
20  }
21 
22  WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.ScriptAdded, function(event) {
23  var scriptObject = event.data.script;
24  if (!/break-on-exception-tests\.js$/.test(scriptObject.url))
25  return;
26 
27  if (exceptionBreakType == 'AllExceptions')
28  WebInspector.debuggerManager.allExceptionsBreakpoint.disabled = false;
29  else
30  WebInspector.debuggerManager.allUncaughtExceptionsBreakpoint.disabled = false;
31 
32  runTestCase(testName);
33  });
34 
35  WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.CallFramesDidChange, function(event) {
36  var callFrame = WebInspector.debuggerManager.activeCallFrame;
37  if (callFrame) {
38  // Pausing.
39  InspectorTest.assert(WebInspector.debuggerManager.pauseReason == "exception");
40 
41  var funcName = callFrame.functionName || "<anonymous>";
42  var location = callFrame.sourceCodeLocation;
43  var line = location.lineNumber + 1;
44  var column = location.columnNumber + 1;
45 
46  InspectorTest.log("PAUSE #" + (++pauses) + " AT: " + funcName + ":" + line + ":" + column);
47  WebInspector.debuggerManager.resume();
48 
49  } else {
50  // Resuming.
51  if (resumeAction == 'FinishOnResume')
52  InspectorTest.completeTest();
53  }
54  });
55 
56  // This is a signal mechanism for the web process to tell us that the test is done.
57  // The web process fires the signal by doing console.log("DONE").
58  WebInspector.logManager.addEventListener(WebInspector.LogManager.Event.MessageAdded, function(event) {
59  var message = event.data.message;
60  if (!message.parameters || message.parameters.length !== 1)
61  return;
62  if (message.parameters[0].type !== "string" || message.parameters[0].description !== "DONE")
63  return;
64  InspectorTest.completeTest();
65  });
66 
67  InspectorTest.reloadPage();
68  }
69 
70  doExceptionTest('doThrow', 'AllExceptions', 'IgnoreResume');
71 }
72 </script>
73 </head>
74 <body onload="runTest()">
75  <p>Checking pause locations when pausing on all exceptions.</p>
76 </body>
77 </html>

LayoutTests/inspector/debugger/break-on-exception.html

1 <!doctype html>
 1<!DOCTYPE html>
22<html>
33<head>
4 <script type="text/javascript" src="../../http/tests/inspector/resources/inspector-test.js"></script>
5 <script type="text/javascript" src="./resources/break-on-exception-tests.js"></script>
 4<script src="../../http/tests/inspector/resources/inspector-test.js"></script>
 5<script src="resources/break-on-exception-tests.js"></script>
66<script>
7 function test() {
8  function doExceptionTest(testName, exceptionBreakType, resumeAction)
9  {
10  var pauses = 0;
11  var index = 0;
12 
13  function runTestCase(test) {
14  InspectorTest.evaluateInPage("setTimeout(" + test + ", 50)");
15  }
16 
17  WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.ScriptAdded, function(event) {
18  var scriptObject = event.data.script;
19  if (!/break-on-exception-tests\.js$/.test(scriptObject.url))
20  return;
21 
22  if (exceptionBreakType == 'AllExceptions')
23  WebInspector.debuggerManager.allExceptionsBreakpoint.disabled = false;
24  else
25  WebInspector.debuggerManager.allUncaughtExceptionsBreakpoint.disabled = false;
26 
27  runTestCase(testName);
28  });
29 
30  WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.CallFramesDidChange, function(event) {
31  var callFrame = WebInspector.debuggerManager.activeCallFrame;
32  if (callFrame) {
33  // Pausing.
34  InspectorTest.assert(WebInspector.debuggerManager.pauseReason == "exception");
35 
36  var funcName = callFrame.functionName || "<anonymous>";
37  var location = callFrame.sourceCodeLocation;
38  var line = location.lineNumber + 1;
39  var column = location.columnNumber + 1;
40 
41  InspectorTest.log("PAUSE #" + (++pauses) + " AT: " + funcName + ":" + line + ":" + column);
42  WebInspector.debuggerManager.resume();
43 
44  } else {
45  // Resuming.
46  if (resumeAction == 'FinishOnResume')
47  InspectorTest.completeTest();
 7TestPage.allowUncaughtExceptions = true;
 8
 9function test()
 10{
 11 WebInspector.debuggerManager.allExceptionsBreakpoint.disabled = false;
 12
 13 let suite = InspectorTest.createAsyncSuite("BreakOnAnyException");
 14
 15 function addTestCase({name, description, expression}) {
 16 suite.addTestCase({
 17 name, description,
 18 test: (resolve, reject) => {
 19 InspectorTest.evaluateInPage(expression);
 20 WebInspector.debuggerManager.singleFireEventListener(WebInspector.DebuggerManager.Event.Paused, (event) => {
 21 InspectorTest.expectThat(WebInspector.debuggerManager.pauseReason === "exception", "Should pause for exception.");
 22 let callFrame = WebInspector.debuggerManager.activeCallFrame;
 23 let name = callFrame.functionName || "<anonymous>";
 24 let location = callFrame.sourceCodeLocation;
 25 let line = location.lineNumber + 1;
 26 let column = location.columnNumber + 1;
 27 InspectorTest.log(`PAUSE AT ${name}:${line}:${column}`);
 28 WebInspector.debuggerManager.resume().then(resolve, reject);
 29 });
4830 }
4931 });
50 
51  // This is a signal mechanism for the web process to tell us that the test is done.
52  // The web process fires the signal by doing console.log("DONE").
53  WebInspector.logManager.addEventListener(WebInspector.LogManager.Event.MessageAdded, function(event) {
54  var message = event.data.message;
55  if (!message.parameters || message.parameters.length !== 1)
56  return;
57  if (message.parameters[0].type !== "string" || message.parameters[0].description !== "DONE")
58  return;
59  InspectorTest.completeTest();
60  });
61 
62  InspectorTest.reloadPage();
6332 }
6433
65  doExceptionTest('doThrow', 'AllExceptions', 'IgnoreResume');
 34 addTestCase({
 35 name: "BreakOnAnyException.UncaughtExceptionBasic",
 36 description: "Break on an uncaught exception thrown in a function.",
 37 expression: "setTimeout(doThrow)",
 38 });
 39
 40 addTestCase({
 41 name: "BreakOnAnyException.UncaughtExceptionInFinally",
 42 description: "Break on an uncaught exception thrown in a finally block.",
 43 expression: "setTimeout(testFinally)",
 44 });
 45
 46 addTestCase({
 47 name: "BreakOnAnyException.UncaughtExceptionThruNativeCode",
 48 description: "Break on an uncaught exception thrown thru native code (Map.prototype.forEach).",
 49 expression: "setTimeout(testThrowingThruNativeCode)",
 50 });
 51
 52 addTestCase({
 53 name: "BreakOnAnyException.CaughtException",
 54 description: "Break on a caught exception.",
 55 expression: "setTimeout(testCatch)",
 56 });
 57
 58 suite.runTestCasesAndFinish();
6659}
6760</script>
6861</head>
6962<body onload="runTest()">
70  <p>Checking pause locations when pausing on all exceptions.</p>
 63<p>Checking pause locations when pausing on all exceptions.</p>
7164</body>
7265</html>

LayoutTests/inspector/debugger/break-on-uncaught-exception-catch-expected.txt

1 CONSOLE MESSAGE: line 12: testCatch
2 CONSOLE MESSAGE: line 7: throwing TestError
3 CONSOLE MESSAGE: line 16: catch TestError
4 CONSOLE MESSAGE: line 18: DONE
5 Checking pause locations when pausing on uncaught exceptions.

LayoutTests/inspector/debugger/break-on-uncaught-exception-catch.html

1 <!doctype html>
2 <html>
3 <head>
4 <script type="text/javascript" src="../../http/tests/inspector/resources/inspector-test.js"></script>
5 <script type="text/javascript" src="./resources/break-on-exception-tests.js"></script>
6 <script>
7 function test() {
8  function doExceptionTest(testName, exceptionBreakType, resumeAction)
9  {
10  var pauses = 0;
11  var index = 0;
12 
13  function runTestCase(test) {
14  InspectorTest.evaluateInPage("setTimeout(" + test + ", 50)");
15  }
16 
17  WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.ScriptAdded, function(event) {
18  var scriptObject = event.data.script;
19  if (!/break-on-exception-tests\.js$/.test(scriptObject.url))
20  return;
21 
22  if (exceptionBreakType == 'AllExceptions')
23  WebInspector.debuggerManager.allExceptionsBreakpoint.disabled = false;
24  else
25  WebInspector.debuggerManager.allUncaughtExceptionsBreakpoint.disabled = false;
26 
27  runTestCase(testName);
28  });
29 
30  WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.CallFramesDidChange, function(event) {
31  var callFrame = WebInspector.debuggerManager.activeCallFrame;
32  if (callFrame) {
33  // Pausing.
34  InspectorTest.assert(WebInspector.debuggerManager.pauseReason == "exception");
35 
36  var funcName = callFrame.functionName || "<anonymous>";
37  var location = callFrame.sourceCodeLocation;
38  var line = location.lineNumber + 1;
39  var column = location.columnNumber + 1;
40 
41  InspectorTest.log("PAUSE #" + (++pauses) + " AT: " + funcName + ":" + line + ":" + column);
42  WebInspector.debuggerManager.resume();
43 
44  } else {
45  // Resuming.
46  if (resumeAction == 'FinishOnResume')
47  InspectorTest.completeTest();
48  }
49  });
50 
51  // This is a signal mechanism for the web process to tell us that the test is done.
52  // The web process fires the signal by doing console.log("DONE").
53  WebInspector.logManager.addEventListener(WebInspector.LogManager.Event.MessageAdded, function(event) {
54  var message = event.data.message;
55  if (!message.parameters || message.parameters.length !== 1)
56  return;
57  if (message.parameters[0].type !== "string" || message.parameters[0].description !== "DONE")
58  return;
59  InspectorTest.completeTest();
60  });
61 
62  InspectorTest.reloadPage();
63  }
64 
65  doExceptionTest('testCatch', 'UncaughtExceptions', 'IgnoreResume');
66 }
67 </script>
68 </head>
69 <body onload="runTest()">
70  <p>Checking pause locations when pausing on uncaught exceptions.</p>
71 </body>
72 </html>

LayoutTests/inspector/debugger/break-on-uncaught-exception-expected.txt

11CONSOLE MESSAGE: line 7: throwing TestError
22CONSOLE MESSAGE: line 8: TestError
 3CONSOLE MESSAGE: line 22: testFinally
 4CONSOLE MESSAGE: line 7: throwing TestError
 5CONSOLE MESSAGE: line 26: finally
 6CONSOLE MESSAGE: line 8: TestError
 7CONSOLE MESSAGE: line 31: testThrowingThruNativeCode
 8CONSOLE MESSAGE: line 7: throwing TestError
 9CONSOLE MESSAGE: line 8: TestError
 10CONSOLE MESSAGE: line 12: testCatch
 11CONSOLE MESSAGE: line 7: throwing TestError
 12CONSOLE MESSAGE: line 16: catch TestError
 13CONSOLE MESSAGE: line 18: DONE
314Checking pause locations when pausing on uncaught exceptions.
415
5 PAUSE #1 AT: doThrow:8:22
 16
 17== Running test suite: BreakOnUncaughtException
 18-- Running test case: BreakOnUncaughtException.UncaughtExceptionBasic
 19PASS: Should pause for exception.
 20PAUSE AT doThrow:8:22
 21Uncaught exception in test page: TestError [break-on-exception-tests.js:8]
 22
 23-- Running test case: BreakOnUncaughtException.UncaughtExceptionInFinally
 24PASS: Should pause for exception.
 25PAUSE AT doThrow:8:22
626Uncaught exception in test page: TestError [break-on-exception-tests.js:8]
727
 28-- Running test case: BreakOnUncaughtException.UncaughtExceptionThruNativeCode
 29PASS: Should pause for exception.
 30PAUSE AT doThrow:8:22
 31Uncaught exception in test page: TestError [break-on-exception-tests.js:8]
 32
 33-- Running test case: BreakOnUncaughtException.CaughtException
 34PASS: Should not pause, exception was caught.
 35

LayoutTests/inspector/debugger/break-on-uncaught-exception-finally-expected.txt

1 CONSOLE MESSAGE: line 22: testFinally
2 CONSOLE MESSAGE: line 7: throwing TestError
3 CONSOLE MESSAGE: line 26: finally
4 CONSOLE MESSAGE: line 8: TestError
5 Checking pause locations when pausing on uncaught exceptions.
6 
7 PAUSE #1 AT: doThrow:8:22
8 Uncaught exception in test page: TestError [break-on-exception-tests.js:8]
9 

LayoutTests/inspector/debugger/break-on-uncaught-exception-finally.html

1 <!doctype html>
2 <html>
3 <head>
4 <script type="text/javascript" src="../../http/tests/inspector/resources/inspector-test.js"></script>
5 <script type="text/javascript" src="./resources/break-on-exception-tests.js"></script>
6 <script>
7 function test() {
8  function doExceptionTest(testName, exceptionBreakType, resumeAction)
9  {
10  var pauses = 0;
11  var index = 0;
12 
13  function runTestCase(test) {
14  InspectorTest.evaluateInPage("setTimeout(" + test + ", 50)");
15  }
16 
17  WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.ScriptAdded, function(event) {
18  var scriptObject = event.data.script;
19  if (!/break-on-exception-tests\.js$/.test(scriptObject.url))
20  return;
21 
22  if (exceptionBreakType == 'AllExceptions')
23  WebInspector.debuggerManager.allExceptionsBreakpoint.disabled = false;
24  else
25  WebInspector.debuggerManager.allUncaughtExceptionsBreakpoint.disabled = false;
26 
27  runTestCase(testName);
28  });
29 
30  WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.CallFramesDidChange, function(event) {
31  var callFrame = WebInspector.debuggerManager.activeCallFrame;
32  if (callFrame) {
33  // Pausing.
34  InspectorTest.assert(WebInspector.debuggerManager.pauseReason == "exception");
35 
36  var funcName = callFrame.functionName || "<anonymous>";
37  var location = callFrame.sourceCodeLocation;
38  var line = location.lineNumber + 1;
39  var column = location.columnNumber + 1;
40 
41  InspectorTest.log("PAUSE #" + (++pauses) + " AT: " + funcName + ":" + line + ":" + column);
42  WebInspector.debuggerManager.resume();
43 
44  } else {
45  // Resuming.
46  if (resumeAction == 'FinishOnResume')
47  InspectorTest.completeTest();
48  }
49  });
50 
51  // This is a signal mechanism for the web process to tell us that the test is done.
52  // The web process fires the signal by doing console.log("DONE").
53  WebInspector.logManager.addEventListener(WebInspector.LogManager.Event.MessageAdded, function(event) {
54  var message = event.data.message;
55  if (!message.parameters || message.parameters.length !== 1)
56  return;
57  if (message.parameters[0].type !== "string" || message.parameters[0].description !== "DONE")
58  return;
59  InspectorTest.completeTest();
60  });
61 
62  InspectorTest.reloadPage();
63  }
64 
65  doExceptionTest('testFinally', 'UncaughtExceptions', 'IgnoreResume');
66 }
67 </script>
68 </head>
69 <body onload="runTest()">
70  <p>Checking pause locations when pausing on uncaught exceptions.</p>
71 </body>
72 </html>

LayoutTests/inspector/debugger/break-on-uncaught-exception-native-expected.txt

1 CONSOLE MESSAGE: line 31: testThrowingThruNativeCode
2 CONSOLE MESSAGE: line 7: throwing TestError
3 CONSOLE MESSAGE: line 8: TestError
4 Checking pause locations when pausing on uncaught exceptions.
5 
6 PAUSE #1 AT: doThrow:8:22
7 Uncaught exception in test page: TestError [break-on-exception-tests.js:8]
8 

LayoutTests/inspector/debugger/break-on-uncaught-exception-native.html

1 <!doctype html>
2 <html>
3 <head>
4 <script type="text/javascript" src="../../http/tests/inspector/resources/inspector-test.js"></script>
5 <script type="text/javascript" src="./resources/break-on-exception-tests.js"></script>
6 <script>
7 function test() {
8  function doExceptionTest(testName, exceptionBreakType, resumeAction)
9  {
10  var pauses = 0;
11  var index = 0;
12 
13  function runTestCase(test) {
14  InspectorTest.evaluateInPage("setTimeout(" + test + ", 50)");
15  }
16 
17  WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.ScriptAdded, function(event) {
18  var scriptObject = event.data.script;
19  if (!/break-on-exception-tests\.js$/.test(scriptObject.url))
20  return;
21 
22  if (exceptionBreakType == 'AllExceptions')
23  WebInspector.debuggerManager.allExceptionsBreakpoint.disabled = false;
24  else
25  WebInspector.debuggerManager.allUncaughtExceptionsBreakpoint.disabled = false;
26 
27  runTestCase(testName);
28  });
29 
30  WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.CallFramesDidChange, function(event) {
31  var callFrame = WebInspector.debuggerManager.activeCallFrame;
32  if (callFrame) {
33  // Pausing.
34  InspectorTest.assert(WebInspector.debuggerManager.pauseReason == "exception");
35 
36  var funcName = callFrame.functionName || "<anonymous>";
37  var location = callFrame.sourceCodeLocation;
38  var line = location.lineNumber + 1;
39  var column = location.columnNumber + 1;
40 
41  InspectorTest.log("PAUSE #" + (++pauses) + " AT: " + funcName + ":" + line + ":" + column);
42  WebInspector.debuggerManager.resume();
43 
44  } else {
45  // Resuming.
46  if (resumeAction == 'FinishOnResume')
47  InspectorTest.completeTest();
48  }
49  });
50 
51  // This is a signal mechanism for the web process to tell us that the test is done.
52  // The web process fires the signal by doing console.log("DONE").
53  WebInspector.logManager.addEventListener(WebInspector.LogManager.Event.MessageAdded, function(event) {
54  var message = event.data.message;
55  if (!message.parameters || message.parameters.length !== 1)
56  return;
57  if (message.parameters[0].type !== "string" || message.parameters[0].description !== "DONE")
58  return;
59  InspectorTest.completeTest();
60  });
61 
62  InspectorTest.reloadPage();
63  }
64 
65  doExceptionTest('testThrowingThruNativeCode', 'UncaughtExceptions', 'IgnoreResume');
66 }
67 </script>
68 </head>
69 <body onload="runTest()">
70  <p>Checking pause locations when pausing on uncaught exceptions.</p>
71 </body>
72 </html>

LayoutTests/inspector/debugger/break-on-uncaught-exception-throw-in-promise-expected.txt

11CONSOLE MESSAGE: line 36: testThrowingInPromise
22CONSOLE MESSAGE: line 38: in promise
33CONSOLE MESSAGE: line 7: throwing TestError
4 Checking pause locations when pausing on uncaught exceptions.
 4CONSOLE MESSAGE: line 55: testThrowingInPromiseThen
 5CONSOLE MESSAGE: line 57: in promise
 6CONSOLE MESSAGE: line 60: in promise.then
 7CONSOLE MESSAGE: line 7: throwing TestError
 8CONSOLE MESSAGE: line 66: testThrowingInPromiseThenWithCatch
 9CONSOLE MESSAGE: line 68: in promise
 10CONSOLE MESSAGE: line 71: in promise.then
 11CONSOLE MESSAGE: line 7: throwing TestError
 12CONSOLE MESSAGE: line 74: in promise.catch
 13CONSOLE MESSAGE: line 75: DONE
 14CONSOLE MESSAGE: line 44: testThrowingInPromiseWithCatch
 15CONSOLE MESSAGE: line 46: in promise
 16CONSOLE MESSAGE: line 7: throwing TestError
 17CONSOLE MESSAGE: line 49: in promise.catch
 18CONSOLE MESSAGE: line 50: DONE
 19CONSOLE MESSAGE: line 80: testThrowingInPromiseWithRethrowInCatch
 20CONSOLE MESSAGE: line 82: in promise
 21CONSOLE MESSAGE: line 7: throwing TestError
 22CONSOLE MESSAGE: line 85: in promise.catch
 23Checking no pauses within Promises when pausing on uncaught exceptions.
524
6 PAUSE #1 AT: doThrow:8:22
 25
 26== Running test suite: BreakOnUncaughtException.Promise
 27-- Running test case: BreakOnUncaughtException.Promise.ExceptionInPromiseConstructor
 28PASS: Should not pause, exception is 'caught' by Promise.
 29
 30-- Running test case: BreakOnUncaughtException.Promise.ExceptionInPromiseThenWithoutCatch
 31PASS: Should not pause, exception is 'caught' by Promise.
 32
 33-- Running test case: BreakOnUncaughtException.Promise.ExceptionInPromiseThenWithCatch
 34PASS: Should not pause, exception is 'caught' by Promise.
 35
 36-- Running test case: BreakOnUncaughtException.Promise.ExceptionInPromiseCatch
 37PASS: Should not pause, exception is 'caught' by Promise.
 38
 39-- Running test case: BreakOnUncaughtException.Promise.ExceptionInPromiseThenAndRethrownInCatch
 40PASS: Should not pause, exception is 'caught' by Promise.
741

LayoutTests/inspector/debugger/break-on-uncaught-exception-throw-in-promise-rethrow-in-catch-expected.txt

1 CONSOLE MESSAGE: line 80: testThrowingInPromiseWithRethrowInCatch
2 CONSOLE MESSAGE: line 82: in promise
3 CONSOLE MESSAGE: line 7: throwing TestError
4 CONSOLE MESSAGE: line 85: in promise.catch
5 Checking pause locations when pausing on uncaught exceptions.
6 
7 PAUSE #1 AT: doThrow:8:22
8 PAUSE #2 AT: promiseCatch:86:16
9 

LayoutTests/inspector/debugger/break-on-uncaught-exception-throw-in-promise-rethrow-in-catch.html

1 <!doctype html>
2 <html>
3 <head>
4 <script type="text/javascript" src="../../http/tests/inspector/resources/inspector-test.js"></script>
5 <script type="text/javascript" src="./resources/break-on-exception-tests.js"></script>
6 <script>
7 function test() {
8  function doExceptionTest(testName, exceptionBreakType, resumeAction)
9  {
10  var pauses = 0;
11  var index = 0;
12 
13  function runTestCase(test) {
14  InspectorTest.evaluateInPage("setTimeout(" + test + ", 50)");
15  }
16 
17  WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.ScriptAdded, function(event) {
18  var scriptObject = event.data.script;
19  if (!/break-on-exception-tests\.js$/.test(scriptObject.url))
20  return;
21 
22  if (exceptionBreakType == 'AllExceptions')
23  WebInspector.debuggerManager.allExceptionsBreakpoint.disabled = false;
24  else
25  WebInspector.debuggerManager.allUncaughtExceptionsBreakpoint.disabled = false;
26 
27  runTestCase(testName);
28  });
29 
30  WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.CallFramesDidChange, function(event) {
31  var callFrame = WebInspector.debuggerManager.activeCallFrame;
32  if (callFrame) {
33  // Pausing.
34  InspectorTest.assert(WebInspector.debuggerManager.pauseReason == "exception");
35 
36  var funcName = callFrame.functionName || "<anonymous>";
37  var location = callFrame.sourceCodeLocation;
38  var line = location.lineNumber + 1;
39  var column = location.columnNumber + 1;
40 
41  InspectorTest.log("PAUSE #" + (++pauses) + " AT: " + funcName + ":" + line + ":" + column);
42  WebInspector.debuggerManager.resume();
43 
44  } else {
45  // Resuming.
46  if (resumeAction == 'FinishOnResume')
47  InspectorTest.completeTest();
48  }
49  });
50 
51  // This is a signal mechanism for the web process to tell us that the test is done.
52  // The web process fires the signal by doing console.log("DONE").
53  WebInspector.logManager.addEventListener(WebInspector.LogManager.Event.MessageAdded, function(event) {
54  var message = event.data.message;
55  if (!message.parameters || message.parameters.length !== 1)
56  return;
57  if (message.parameters[0].type !== "string" || message.parameters[0].description !== "DONE")
58  return;
59  InspectorTest.completeTest();
60  });
61 
62  InspectorTest.reloadPage();
63  }
64 
65  doExceptionTest('testThrowingInPromiseWithRethrowInCatch', 'UncaughtExceptions', 'FinishOnResume');
66 }
67 </script>
68 </head>
69 <body onload="runTest()">
70  <p>Checking pause locations when pausing on uncaught exceptions.</p>
71 </body>
72 </html>

LayoutTests/inspector/debugger/break-on-uncaught-exception-throw-in-promise-then-expected.txt

1 CONSOLE MESSAGE: line 55: testThrowingInPromiseThen
2 CONSOLE MESSAGE: line 57: in promise
3 CONSOLE MESSAGE: line 60: in promise.then
4 CONSOLE MESSAGE: line 7: throwing TestError
5 Checking pause locations when pausing on uncaught exceptions.
6 
7 PAUSE #1 AT: doThrow:8:22
8 

LayoutTests/inspector/debugger/break-on-uncaught-exception-throw-in-promise-then-with-catch-expected.txt

1 CONSOLE MESSAGE: line 66: testThrowingInPromiseThenWithCatch
2 CONSOLE MESSAGE: line 68: in promise
3 CONSOLE MESSAGE: line 71: in promise.then
4 CONSOLE MESSAGE: line 7: throwing TestError
5 CONSOLE MESSAGE: line 74: in promise.catch
6 CONSOLE MESSAGE: line 75: DONE
7 Checking pause locations when pausing on uncaught exceptions.
8 
9 PAUSE #1 AT: doThrow:8:22
10 

LayoutTests/inspector/debugger/break-on-uncaught-exception-throw-in-promise-then-with-catch.html

1 <!doctype html>
2 <html>
3 <head>
4 <script type="text/javascript" src="../../http/tests/inspector/resources/inspector-test.js"></script>
5 <script type="text/javascript" src="./resources/break-on-exception-tests.js"></script>
6 <script>
7 function test() {
8  function doExceptionTest(testName, exceptionBreakType, resumeAction)
9  {
10  var pauses = 0;
11  var index = 0;
12 
13  function runTestCase(test) {
14  InspectorTest.evaluateInPage("setTimeout(" + test + ", 50)");
15  }
16 
17  WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.ScriptAdded, function(event) {
18  var scriptObject = event.data.script;
19  if (!/break-on-exception-tests\.js$/.test(scriptObject.url))
20  return;
21 
22  if (exceptionBreakType == 'AllExceptions')
23  WebInspector.debuggerManager.allExceptionsBreakpoint.disabled = false;
24  else
25  WebInspector.debuggerManager.allUncaughtExceptionsBreakpoint.disabled = false;
26 
27  runTestCase(testName);
28  });
29 
30  WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.CallFramesDidChange, function(event) {
31  var callFrame = WebInspector.debuggerManager.activeCallFrame;
32  if (callFrame) {
33  // Pausing.
34  InspectorTest.assert(WebInspector.debuggerManager.pauseReason == "exception");
35 
36  var funcName = callFrame.functionName || "<anonymous>";
37  var location = callFrame.sourceCodeLocation;
38  var line = location.lineNumber + 1;
39  var column = location.columnNumber + 1;
40 
41  InspectorTest.log("PAUSE #" + (++pauses) + " AT: " + funcName + ":" + line + ":" + column);
42  WebInspector.debuggerManager.resume();
43 
44  } else {
45  // Resuming.
46  if (resumeAction == 'FinishOnResume')
47  InspectorTest.completeTest();
48  }
49  });
50 
51  // This is a signal mechanism for the web process to tell us that the test is done.
52  // The web process fires the signal by doing console.log("DONE").
53  WebInspector.logManager.addEventListener(WebInspector.LogManager.Event.MessageAdded, function(event) {
54  var message = event.data.message;
55  if (!message.parameters || message.parameters.length !== 1)
56  return;
57  if (message.parameters[0].type !== "string" || message.parameters[0].description !== "DONE")
58  return;
59  InspectorTest.completeTest();
60  });
61 
62  InspectorTest.reloadPage();
63  }
64 
65  doExceptionTest('testThrowingInPromiseThenWithCatch', 'UncaughtExceptions', 'IgnoreResume');
66 }
67 </script>
68 </head>
69 <body onload="runTest()">
70  <p>Checking pause locations when pausing on uncaught exceptions.</p>
71 </body>
72 </html>

LayoutTests/inspector/debugger/break-on-uncaught-exception-throw-in-promise-then.html

1 <!doctype html>
2 <html>
3 <head>
4 <script type="text/javascript" src="../../http/tests/inspector/resources/inspector-test.js"></script>
5 <script type="text/javascript" src="./resources/break-on-exception-tests.js"></script>
6 <script>
7 function test() {
8  function doExceptionTest(testName, exceptionBreakType, resumeAction)
9  {
10  var pauses = 0;
11  var index = 0;
12 
13  function runTestCase(test) {
14  InspectorTest.evaluateInPage("setTimeout(" + test + ", 50)");
15  }
16 
17  WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.ScriptAdded, function(event) {
18  var scriptObject = event.data.script;
19  if (!/break-on-exception-tests\.js$/.test(scriptObject.url))
20  return;
21 
22  if (exceptionBreakType == 'AllExceptions')
23  WebInspector.debuggerManager.allExceptionsBreakpoint.disabled = false;
24  else
25  WebInspector.debuggerManager.allUncaughtExceptionsBreakpoint.disabled = false;
26 
27  runTestCase(testName);
28  });
29 
30  WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.CallFramesDidChange, function(event) {
31  var callFrame = WebInspector.debuggerManager.activeCallFrame;
32  if (callFrame) {
33  // Pausing.
34  InspectorTest.assert(WebInspector.debuggerManager.pauseReason == "exception");
35 
36  var funcName = callFrame.functionName || "<anonymous>";
37  var location = callFrame.sourceCodeLocation;
38  var line = location.lineNumber + 1;
39  var column = location.columnNumber + 1;
40 
41  InspectorTest.log("PAUSE #" + (++pauses) + " AT: " + funcName + ":" + line + ":" + column);
42  WebInspector.debuggerManager.resume();
43 
44  } else {
45  // Resuming.
46  if (resumeAction == 'FinishOnResume')
47  InspectorTest.completeTest();
48  }
49  });
50 
51  // This is a signal mechanism for the web process to tell us that the test is done.
52  // The web process fires the signal by doing console.log("DONE").
53  WebInspector.logManager.addEventListener(WebInspector.LogManager.Event.MessageAdded, function(event) {
54  var message = event.data.message;
55  if (!message.parameters || message.parameters.length !== 1)
56  return;
57  if (message.parameters[0].type !== "string" || message.parameters[0].description !== "DONE")
58  return;
59  InspectorTest.completeTest();
60  });
61 
62  InspectorTest.reloadPage();
63  }
64 
65  doExceptionTest('testThrowingInPromiseThen', 'UncaughtExceptions', 'FinishOnResume');
66 }
67 </script>
68 </head>
69 <body onload="runTest()">
70  <p>Checking pause locations when pausing on uncaught exceptions.</p>
71 </body>
72 </html>

LayoutTests/inspector/debugger/break-on-uncaught-exception-throw-in-promise-with-catch-expected.txt

1 CONSOLE MESSAGE: line 44: testThrowingInPromiseWithCatch
2 CONSOLE MESSAGE: line 46: in promise
3 CONSOLE MESSAGE: line 7: throwing TestError
4 CONSOLE MESSAGE: line 49: in promise.catch
5 CONSOLE MESSAGE: line 50: DONE
6 Checking pause locations when pausing on uncaught exceptions.
7 
8 PAUSE #1 AT: doThrow:8:22
9 

LayoutTests/inspector/debugger/break-on-uncaught-exception-throw-in-promise-with-catch.html

1 <!doctype html>
2 <html>
3 <head>
4 <script type="text/javascript" src="../../http/tests/inspector/resources/inspector-test.js"></script>
5 <script type="text/javascript" src="./resources/break-on-exception-tests.js"></script>
6 <script>
7 function test() {
8  function doExceptionTest(testName, exceptionBreakType, resumeAction)
9  {
10  var pauses = 0;
11  var index = 0;
12 
13  function runTestCase(test) {
14  InspectorTest.evaluateInPage("setTimeout(" + test + ", 50)");
15  }
16 
17  WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.ScriptAdded, function(event) {
18  var scriptObject = event.data.script;
19  if (!/break-on-exception-tests\.js$/.test(scriptObject.url))
20  return;
21 
22  if (exceptionBreakType == 'AllExceptions')
23  WebInspector.debuggerManager.allExceptionsBreakpoint.disabled = false;
24  else
25  WebInspector.debuggerManager.allUncaughtExceptionsBreakpoint.disabled = false;
26 
27  runTestCase(testName);
28  });
29 
30  WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.CallFramesDidChange, function(event) {
31  var callFrame = WebInspector.debuggerManager.activeCallFrame;
32  if (callFrame) {
33  // Pausing.
34  InspectorTest.assert(WebInspector.debuggerManager.pauseReason == "exception");
35 
36  var funcName = callFrame.functionName || "<anonymous>";
37  var location = callFrame.sourceCodeLocation;
38  var line = location.lineNumber + 1;
39  var column = location.columnNumber + 1;
40 
41  InspectorTest.log("PAUSE #" + (++pauses) + " AT: " + funcName + ":" + line + ":" + column);
42  WebInspector.debuggerManager.resume();
43 
44  } else {
45  // Resuming.
46  if (resumeAction == 'FinishOnResume')
47  InspectorTest.completeTest();
48  }
49  });
50 
51  // This is a signal mechanism for the web process to tell us that the test is done.
52  // The web process fires the signal by doing console.log("DONE").
53  WebInspector.logManager.addEventListener(WebInspector.LogManager.Event.MessageAdded, function(event) {
54  var message = event.data.message;
55  if (!message.parameters || message.parameters.length !== 1)
56  return;
57  if (message.parameters[0].type !== "string" || message.parameters[0].description !== "DONE")
58  return;
59  InspectorTest.completeTest();
60  });
61 
62  InspectorTest.reloadPage();
63  }
64 
65  doExceptionTest('testThrowingInPromiseWithCatch', 'UncaughtExceptions', 'IgnoreResume');
66 }
67 </script>
68 </head>
69 <body onload="runTest()">
70  <p>Checking pause locations when pausing on uncaught exceptions.</p>
71 </body>
72 </html>

LayoutTests/inspector/debugger/break-on-uncaught-exception-throw-in-promise.html

1 <!doctype html>
 1<!DOCTYPE html>
22<html>
33<head>
4 <script type="text/javascript" src="../../http/tests/inspector/resources/inspector-test.js"></script>
5 <script type="text/javascript" src="./resources/break-on-exception-tests.js"></script>
 4<script src="../../http/tests/inspector/resources/inspector-test.js"></script>
 5<script src="resources/break-on-exception-tests.js"></script>
66<script>
7 function test() {
8  function doExceptionTest(testName, exceptionBreakType, resumeAction)
9  {
10  var pauses = 0;
11  var index = 0;
12 
13  function runTestCase(test) {
14  InspectorTest.evaluateInPage("setTimeout(" + test + ", 50)");
15  }
16 
17  WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.ScriptAdded, function(event) {
18  var scriptObject = event.data.script;
19  if (!/break-on-exception-tests\.js$/.test(scriptObject.url))
20  return;
21 
22  if (exceptionBreakType == 'AllExceptions')
23  WebInspector.debuggerManager.allExceptionsBreakpoint.disabled = false;
24  else
25  WebInspector.debuggerManager.allUncaughtExceptionsBreakpoint.disabled = false;
26 
27  runTestCase(testName);
28  });
29 
30  WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.CallFramesDidChange, function(event) {
31  var callFrame = WebInspector.debuggerManager.activeCallFrame;
32  if (callFrame) {
33  // Pausing.
34  InspectorTest.assert(WebInspector.debuggerManager.pauseReason == "exception");
35 
36  var funcName = callFrame.functionName || "<anonymous>";
37  var location = callFrame.sourceCodeLocation;
38  var line = location.lineNumber + 1;
39  var column = location.columnNumber + 1;
40 
41  InspectorTest.log("PAUSE #" + (++pauses) + " AT: " + funcName + ":" + line + ":" + column);
42  WebInspector.debuggerManager.resume();
43 
44  } else {
45  // Resuming.
46  if (resumeAction == 'FinishOnResume')
47  InspectorTest.completeTest();
 7TestPage.allowUncaughtExceptions = true;
 8
 9function test()
 10{
 11 // Pause on uncaught exception behavior in Promises is likely to change. This tests our
 12 // current behavior of not pausing for uncaught exception when the Promise swallows
 13 // the exception. See these bugs:
 14 // FIXME: <https://webkit.org/b/124066> Uncaught exceptions raised in promise completion functions are not printed to console
 15 // FIXME: <https://webkit.org/b/147502> Uncaught Exception in promise does not trigger break on uncaught exception breakpoint
 16
 17 WebInspector.debuggerManager.allUncaughtExceptionsBreakpoint.disabled = false;
 18
 19 let suite = InspectorTest.createAsyncSuite("BreakOnUncaughtException.Promise");
 20
 21 function addTestCase({name, description, expression}) {
 22 suite.addTestCase({
 23 name, description,
 24 test: (resolve, reject) => {
 25 InspectorTest.evaluateInPage(expression);
 26 InspectorTest.evaluateInPage(`setTimeout(() => { TestPage.dispatchEventToFrontend("AfterTestFunction"); }, 50)`);
 27
 28 let listener = WebInspector.debuggerManager.singleFireEventListener(WebInspector.DebuggerManager.Event.Paused, (event) => {
 29 InspectorTest.fail("Should not have paused.");
 30 WebInspector.debuggerManager.resume();
 31 reject();
 32 });
 33
 34 InspectorTest.singleFireEventListener("AfterTestFunction", (event) => {
 35 InspectorTest.pass("Should not pause, exception is 'caught' by Promise.");
 36 WebInspector.debuggerManager.removeEventListener(WebInspector.DebuggerManager.Event.Paused, listener);
 37 resolve();
 38 });
4839 }
4940 });
50 
51  // This is a signal mechanism for the web process to tell us that the test is done.
52  // The web process fires the signal by doing console.log("DONE").
53  WebInspector.logManager.addEventListener(WebInspector.LogManager.Event.MessageAdded, function(event) {
54  var message = event.data.message;
55  if (!message.parameters || message.parameters.length !== 1)
56  return;
57  if (message.parameters[0].type !== "string" || message.parameters[0].description !== "DONE")
58  return;
59  InspectorTest.completeTest();
60  });
61 
62  InspectorTest.reloadPage();
6341 }
6442
65  doExceptionTest('testThrowingInPromise', 'UncaughtExceptions', 'FinishOnResume');
 43 addTestCase({
 44 name: "BreakOnUncaughtException.Promise.ExceptionInPromiseConstructor",
 45 description: "Break on an exception thrown in Promise constructor.",
 46 expression: "setTimeout(testThrowingInPromise)",
 47 });
 48
 49 addTestCase({
 50 name: "BreakOnUncaughtException.Promise.ExceptionInPromiseThenWithoutCatch",
 51 description: "Break on an exception thrown in Promise then handler with no catch handler.",
 52 expression: "setTimeout(testThrowingInPromiseThen)",
 53 });
 54
 55 addTestCase({
 56 name: "BreakOnUncaughtException.Promise.ExceptionInPromiseThenWithCatch",
 57 description: "Break on an exception thrown in Promise then handler with a catch handler.",
 58 expression: "setTimeout(testThrowingInPromiseThenWithCatch)",
 59 });
 60
 61 addTestCase({
 62 name: "BreakOnUncaughtException.Promise.ExceptionInPromiseCatch",
 63 description: "Break on an exception thrown in Promise catch with no then handler.",
 64 expression: "setTimeout(testThrowingInPromiseWithCatch)",
 65 });
 66
 67 addTestCase({
 68 name: "BreakOnUncaughtException.Promise.ExceptionInPromiseThenAndRethrownInCatch",
 69 description: "Break on an exception thrown in Promise then handler, and then again when rethrown in catch handler.",
 70 expression: "setTimeout(testThrowingInPromiseWithRethrowInCatch)",
 71 });
 72
 73 suite.runTestCasesAndFinish();
6674}
6775</script>
6876</head>
6977<body onload="runTest()">
70  <p>Checking pause locations when pausing on uncaught exceptions.</p>
 78<p>Checking no pauses within Promises when pausing on uncaught exceptions.</p>
7179</body>
7280</html>

LayoutTests/inspector/debugger/break-on-uncaught-exception-window-onerror-expected.txt

1 CONSOLE MESSAGE: line 7: throwing TestError
2 CONSOLE MESSAGE: line 8: window.onerror: TestError
3 CONSOLE MESSAGE: line 9: DONE
4 CONSOLE MESSAGE: line 8: TestError
5 Checking pause locations when pausing on uncaught exceptions.
6 
7 PAUSE #1 AT: doThrow:8:22
8 

LayoutTests/inspector/debugger/break-on-uncaught-exception-window-onerror.html

1 <!doctype html>
2 <html>
3 <head>
4 <script type="text/javascript" src="../../http/tests/inspector/resources/inspector-test.js"></script>
5 <script type="text/javascript" src="./resources/break-on-exception-tests.js"></script>
6 <script>
7 window.onerror = function(e) {
8  console.log("window.onerror: " + e);
9  console.log("DONE");
10 }
11 
12 function test() {
13  function doExceptionTest(testName, exceptionBreakType, resumeAction)
14  {
15  var pauses = 0;
16  var index = 0;
17 
18  function runTestCase(test) {
19  InspectorTest.evaluateInPage("setTimeout(" + test + ", 50)");
20  }
21 
22  WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.ScriptAdded, function(event) {
23  var scriptObject = event.data.script;
24  if (!/break-on-exception-tests\.js$/.test(scriptObject.url))
25  return;
26 
27  if (exceptionBreakType == 'AllExceptions')
28  WebInspector.debuggerManager.allExceptionsBreakpoint.disabled = false;
29  else
30  WebInspector.debuggerManager.allUncaughtExceptionsBreakpoint.disabled = false;
31 
32  runTestCase(testName);
33  });
34 
35  WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.CallFramesDidChange, function(event) {
36  var callFrame = WebInspector.debuggerManager.activeCallFrame;
37  if (callFrame) {
38  // Pausing.
39  InspectorTest.assert(WebInspector.debuggerManager.pauseReason == "exception");
40 
41  var funcName = callFrame.functionName || "<anonymous>";
42  var location = callFrame.sourceCodeLocation;
43  var line = location.lineNumber + 1;
44  var column = location.columnNumber + 1;
45 
46  InspectorTest.log("PAUSE #" + (++pauses) + " AT: " + funcName + ":" + line + ":" + column);
47  WebInspector.debuggerManager.resume();
48 
49  } else {
50  // Resuming.
51  if (resumeAction == 'FinishOnResume')
52  InspectorTest.completeTest();
53  }
54  });
55 
56  // This is a signal mechanism for the web process to tell us that the test is done.
57  // The web process fires the signal by doing console.log("DONE").
58  WebInspector.logManager.addEventListener(WebInspector.LogManager.Event.MessageAdded, function(event) {
59  var message = event.data.message;
60  if (!message.parameters || message.parameters.length !== 1)
61  return;
62  if (message.parameters[0].type !== "string" || message.parameters[0].description !== "DONE")
63  return;
64  InspectorTest.completeTest();
65  });
66 
67  InspectorTest.reloadPage();
68  }
69 
70  doExceptionTest('doThrow', 'UncaughtExceptions', 'IgnoreResume');
71 }
72 </script>
73 </head>
74 <body onload="runTest()">
75  <p>Checking pause locations when pausing on uncaught exceptions.</p>
76 </body>
77 </html>

LayoutTests/inspector/debugger/break-on-uncaught-exception.html

1 <!doctype html>
 1<!DOCTYPE html>
22<html>
33<head>
4 <script type="text/javascript" src="../../http/tests/inspector/resources/inspector-test.js"></script>
5 <script type="text/javascript" src="./resources/break-on-exception-tests.js"></script>
 4<script src="../../http/tests/inspector/resources/inspector-test.js"></script>
 5<script src="resources/break-on-exception-tests.js"></script>
66<script>
7 function test() {
8  function doExceptionTest(testName, exceptionBreakType, resumeAction)
9  {
10  var pauses = 0;
11  var index = 0;
12 
13  function runTestCase(test) {
14  InspectorTest.evaluateInPage("setTimeout(" + test + ", 50)");
15  }
16 
17  WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.ScriptAdded, function(event) {
18  var scriptObject = event.data.script;
19  if (!/break-on-exception-tests\.js$/.test(scriptObject.url))
20  return;
21 
22  if (exceptionBreakType == 'AllExceptions')
23  WebInspector.debuggerManager.allExceptionsBreakpoint.disabled = false;
24  else
25  WebInspector.debuggerManager.allUncaughtExceptionsBreakpoint.disabled = false;
26 
27  runTestCase(testName);
28  });
29 
30  WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.CallFramesDidChange, function(event) {
31  var callFrame = WebInspector.debuggerManager.activeCallFrame;
32  if (callFrame) {
33  // Pausing.
34  InspectorTest.assert(WebInspector.debuggerManager.pauseReason == "exception");
35 
36  var funcName = callFrame.functionName || "<anonymous>";
37  var location = callFrame.sourceCodeLocation;
38  var line = location.lineNumber + 1;
39  var column = location.columnNumber + 1;
40 
41  InspectorTest.log("PAUSE #" + (++pauses) + " AT: " + funcName + ":" + line + ":" + column);
42  WebInspector.debuggerManager.resume();
43 
44  } else {
45  // Resuming.
46  if (resumeAction == 'FinishOnResume')
47  InspectorTest.completeTest();
 7TestPage.allowUncaughtExceptions = true;
 8
 9function test()
 10{
 11 WebInspector.debuggerManager.allUncaughtExceptionsBreakpoint.disabled = false;
 12
 13 let suite = InspectorTest.createAsyncSuite("BreakOnUncaughtException");
 14
 15 function addTestCase({name, description, expression}) {
 16 suite.addTestCase({
 17 name, description,
 18 test: (resolve, reject) => {
 19 InspectorTest.evaluateInPage(expression);
 20 WebInspector.debuggerManager.singleFireEventListener(WebInspector.DebuggerManager.Event.Paused, (event) => {
 21 InspectorTest.expectThat(WebInspector.debuggerManager.pauseReason === "exception", "Should pause for exception.");
 22 let callFrame = WebInspector.debuggerManager.activeCallFrame;
 23 let name = callFrame.functionName || "<anonymous>";
 24 let location = callFrame.sourceCodeLocation;
 25 let line = location.lineNumber + 1;
 26 let column = location.columnNumber + 1;
 27 InspectorTest.log(`PAUSE AT ${name}:${line}:${column}`);
 28 WebInspector.debuggerManager.resume().then(resolve, reject);
 29 });
4830 }
4931 });
50 
51  // This is a signal mechanism for the web process to tell us that the test is done.
52  // The web process fires the signal by doing console.log("DONE").
53  WebInspector.logManager.addEventListener(WebInspector.LogManager.Event.MessageAdded, function(event) {
54  var message = event.data.message;
55  if (!message.parameters || message.parameters.length !== 1)
56  return;
57  if (message.parameters[0].type !== "string" || message.parameters[0].description !== "DONE")
58  return;
59  InspectorTest.completeTest();
60  });
61 
62  InspectorTest.reloadPage();
6332 }
6433
65  doExceptionTest('doThrow', 'UncaughtExceptions', 'IgnoreResume');
 34 addTestCase({
 35 name: "BreakOnUncaughtException.UncaughtExceptionBasic",
 36 description: "Break on an uncaught exception thrown in a function.",
 37 expression: "setTimeout(doThrow)",
 38 });
 39
 40 addTestCase({
 41 name: "BreakOnUncaughtException.UncaughtExceptionInFinally",
 42 description: "Break on an uncaught exception thrown in a finally block.",
 43 expression: "setTimeout(testFinally)",
 44 });
 45
 46 addTestCase({
 47 name: "BreakOnUncaughtException.UncaughtExceptionThruNativeCode",
 48 description: "Break on an uncaught exception thrown thru native code (Map.prototype.forEach).",
 49 expression: "setTimeout(testThrowingThruNativeCode)",
 50 });
 51
 52 suite.addTestCase({
 53 name: "BreakOnUncaughtException.CaughtException",
 54 description: "No break on a caught exception.",
 55 test: (resolve, reject) => {
 56 InspectorTest.evaluateInPage(`setTimeout(() => {
 57 testCatch();
 58 TestPage.dispatchEventToFrontend("AfterTestFunction");
 59 })`);
 60
 61 let listener = WebInspector.debuggerManager.singleFireEventListener(WebInspector.DebuggerManager.Event.Paused, (event) => {
 62 InspectorTest.fail("Should not have paused.");
 63 WebInspector.debuggerManager.resume();
 64 reject();
 65 });
 66
 67 InspectorTest.singleFireEventListener("AfterTestFunction", (event) => {
 68 InspectorTest.pass("Should not pause, exception was caught.");
 69 WebInspector.debuggerManager.removeEventListener(WebInspector.DebuggerManager.Event.Paused, listener);
 70 resolve();
 71 });
 72 }
 73 });
 74
 75 suite.runTestCasesAndFinish();
6676}
6777</script>
6878</head>
6979<body onload="runTest()">
70  <p>Checking pause locations when pausing on uncaught exceptions.</p>
 80<p>Checking pause locations when pausing on uncaught exceptions.</p>
7181</body>
7282</html>

LayoutTests/platform/mac-wk2/TestExpectations

@@webkit.org/b/151729 [ Yosemite ] http/tests/xmlhttprequest/methods-async.html [
296296
297297webkit.org/b/152025 [ Debug ] inspector/console/messagesCleared.html [ Pass Timeout ]
298298
299 webkit.org/b/152492 [ Debug ] inspector/debugger/break-on-exception-catch.html [ Pass Timeout ]
300 
301299webkit.org/b/155138 [ Yosemite ElCapitan ] inspector/console/addInspectedNode.html [ Pass Timeout ]
302300
303301webkit.org/b/155151 [ Debug ElCapitan ] media/track/track-cues-pause-on-exit.html [ Pass Timeout ]

LayoutTests/platform/mac/TestExpectations

@@webkit.org/b/123250 plugins/destroy-during-npp-new-object-with-fallback-content.
737737webkit.org/b/123369 svg/css/parent-shadow-offscreen.svg [ ImageOnlyFailure ]
738738webkit.org/b/123369 svg/css/root-shadow-offscreen.svg [ ImageOnlyFailure ]
739739
740 webkit.org/b/151832 inspector/debugger/break-on-uncaught-exception-throw-in-promise-rethrow-in-catch.html
741 webkit.org/b/151832 inspector/debugger/break-on-uncaught-exception-throw-in-promise-then-with-catch.html
742 webkit.org/b/151832 inspector/debugger/break-on-uncaught-exception-throw-in-promise-then.html
743 webkit.org/b/151832 inspector/debugger/break-on-uncaught-exception-throw-in-promise-with-catch.html
744 webkit.org/b/151832 inspector/debugger/break-on-uncaught-exception-throw-in-promise.html
745740inspector/debugger/setBreakpoint-dfg-callee-and-examine-dfg-local.html
746741inspector/debugger/didSampleProbe-multiple-probes.html
747742inspector/debugger/nested-inspectors.html
748743
 744inspector/debugger/break-on-exception-throw-in-promise.html [ Slow ]
 745inspector/debugger/break-on-exception.html [ Slow ]
 746inspector/debugger/break-on-uncaught-exception-throw-in-promise.html [ Slow ]
 747inspector/debugger/break-on-uncaught-exception.html [ Slow ]
 748
749749webkit.org/b/124311 compositing/regions/transform-transparent-positioned-video-inside-region.html [ ImageOnlyFailure ]
750750
751751webkit.org/b/124321 animations/resume-after-page-cache.html [ Pass Failure ]

@@webkit.org/b/158006 inspector/console/console-time.html [ Pass Timeout ]
12321232webkit.org/b/156634 inspector/formatting/formatting-javascript.html [ Pass Timeout ]
12331233webkit.org/b/158948 inspector/timeline [ Pass Timeout ]
12341234
1235 webkit.org/b/159272 inspector/debugger/break-on-exception-finally.html
1236 webkit.org/b/159272 inspector/debugger/break-on-exception-native.html
1237 webkit.org/b/159272 inspector/debugger/break-on-exception.html
1238 webkit.org/b/159272 inspector/debugger/break-on-uncaught-exception-finally.html
1239 webkit.org/b/159272 inspector/debugger/break-on-uncaught-exception-native.html
1240 webkit.org/b/159272 inspector/debugger/break-on-uncaught-exception.html
1241 
12421235# Colorspaces on CA OpenGL layers not available in Yosemite
12431236[ Yosemite ] fast/canvas/webgl/match-page-color-space.html [ Skip ]
12441237