Changeset 202784 in webkit
- Timestamp:
- Jul 2, 2016 8:33:34 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r202783 r202784 1 2016-07-02 Joseph Pecoraro <pecoraro@apple.com> 2 3 inspector/debugger/command-line-api-exception.html flakily times out on mac 4 https://bugs.webkit.org/show_bug.cgi?id=152029 5 <rdar://problem/23813812> 6 7 Reviewed by Timothy Hatcher. 8 9 * inspector/debugger/command-line-api-exception-expected.txt: 10 * inspector/debugger/command-line-api-exception-nested-catch-expected.txt: 11 * inspector/debugger/command-line-api-exception-nested-catch.html: 12 * inspector/debugger/command-line-api-exception.html: 13 * platform/mac/TestExpectations: 14 Rewrite these tests to use the new test harness. 15 This also is more careful about Pause/Resume timing differences 16 between Release and Debug builds. 17 1 18 2016-07-02 Joseph Pecoraro <pecoraro@apple.com> 2 19 -
trunk/LayoutTests/inspector/debugger/command-line-api-exception-expected.txt
r201083 r202784 13 13 Checks that $exception is available and accurate in evaluations when paused on an exception. 14 14 15 BEFORE: $exception => undefined16 PAUSE #1: $exception => TypeError: undefined is not an object (evaluating '[].x.x')17 PAUSE #2: $exception => ReferenceError: Can't find variable: variableThatDoesNotExist18 PAUSE #3: $exception => SyntaxError: Unexpected token ')'19 PAUSE #4: $exception => Error: IndexSizeError: DOM Exception 120 PAUSE #5: $exception => thrown string21 PAUSE #6: $exception => 123.45622 PAUSE #7: $exception => null23 PAUSE #8: $exception => Object24 PAUSE #9: $exception => <body>25 PAUSE #10: $exception => TypeError: undefined is not an object (evaluating '[].x.x')26 STEPPED OUT TO CATCH BLOCK: $exception === e ? true27 PAUSE #11: $exception => thrown string28 STEPPED OUT TO CATCH BLOCK: $exception === e ? true29 PAUSE #12: $exception => Object30 STEPPED OUT TO CATCH BLOCK: $exception === e ? true31 AFTER: $exception => undefined32 15 16 == Running test suite: CommandLineAPI.$exception 17 -- Running test case: BeforeExceptions 18 PASS: $exception should be undefined if there is no exception. 19 20 -- Running test case: UncaughtTypeException 21 $exception => TypeError: undefined is not an object (evaluating '[].x.x') 22 23 -- Running test case: UncaughtReferenceException 24 $exception => ReferenceError: Can't find variable: variableThatDoesNotExist 25 26 -- Running test case: UncaughtSyntaxException 27 $exception => SyntaxError: Unexpected token ')' 28 29 -- Running test case: UncaughtDOMException 30 $exception => Error: IndexSizeError: DOM Exception 1 31 32 -- Running test case: UncaughtString 33 $exception => thrown string 34 35 -- Running test case: UncaughtNumber 36 $exception => 123.456 37 38 -- Running test case: UncaughtNull 39 $exception => null 40 41 -- Running test case: UncaughtObject 42 $exception => Object 43 44 -- Running test case: UncaughtNode 45 $exception => <body> 46 47 -- Running test case: CatchTypeException 48 PASS: Paused, stepping out to catch block... 49 PASS: `$exception` should be equal to `e`. 50 $exception => TypeError: undefined is not an object (evaluating '[].x.x') 51 52 -- Running test case: CatchThrownString 53 PASS: Paused, stepping out to catch block... 54 PASS: `$exception` should be equal to `e`. 55 $exception => thrown string 56 57 -- Running test case: CatchThrownObject 58 PASS: Paused, stepping out to catch block... 59 PASS: `$exception` should be equal to `e`. 60 $exception => Object 61 62 -- Running test case: AfterExceptions 63 PASS: $exception should be undefined if there is no exception. 64 -
trunk/LayoutTests/inspector/debugger/command-line-api-exception-nested-catch-expected.txt
r176357 r202784 3 3 Checks that $exception is the value of the current exception, even in nested catch blocks. 4 4 5 BEFORE : $exception => undefined 5 6 == Running test suite: CommandLineAPI.$exception 7 -- Running test case: EmptyBefore 8 PASS: $exception should be undefined if there is no exception. 9 10 -- Running test case: CheckExceptionInsideNestedCatchBlocks 6 11 OUTER 1: $exception => outer exception 7 12 INNER 1: $exception => inner exception … … 10 15 OUTER 2: $exception => outer exception 11 16 CATCH: $exception === e1 ? true 12 AFTER : $exception => undefined13 17 18 -- Running test case: EmptyAfter 19 PASS: $exception should be undefined if there is no exception. 20 -
trunk/LayoutTests/inspector/debugger/command-line-api-exception-nested-catch.html
r201855 r202784 1 <! doctypehtml>1 <!DOCTYPE html> 2 2 <html> 3 3 <head> 4 <script type="text/javascript"src="../../http/tests/inspector/resources/inspector-test.js"></script>5 <script type="text/javascript" src="./resources/exceptions.js"></script>4 <script src="../../http/tests/inspector/resources/inspector-test.js"></script> 5 <script src="resources/exceptions.js"></script> 6 6 <script> 7 function triggerException() 8 { 9 // We expect uncaught exceptions, so avoid logs for them. 10 window.onerror = function(){}; 11 setTimeout(nestedCatchBlocks, 0); 12 } 7 window.onerror = function(){}; 13 8 14 9 function test() … … 28 23 } 29 24 30 var done = false;31 var phase = 0;32 25 33 WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.CallFramesDidChange, function(event) { 34 if (done) 35 return; 26 let suite = InspectorTest.createAsyncSuite("CommandLineAPI.$exception"); 36 27 37 phase++; 38 39 // Skip past the first pause to the second pause. 40 if (phase === 1) { 41 dumpCommandLineAPIValue("OUTER 1"); 42 WebInspector.debuggerManager.resume(); 43 return; 44 } 45 46 // Paused on the exception in the inner try, step over to get into the inner catch. 47 if (phase === 2) { 48 dumpCommandLineAPIValue("INNER 1"); 49 WebInspector.debuggerManager.stepOver(); 50 return; 51 } 52 53 // Paused in the inner catch, verify $exception is "inner exception". 54 if (phase === 3) { 55 dumpCommandLineAPIValue("INNER 2"); 56 checkIfExceptionValueMatchesVariable("e2"); 57 WebInspector.debuggerManager.stepOver(); 58 return; 59 } 60 61 // Stepped into the outer catch, verify $exception is "outer exception". 62 if (phase === 4) { 63 dumpCommandLineAPIValue("OUTER 2"); 64 checkIfExceptionValueMatchesVariable("e1"); 65 WebInspector.debuggerManager.resume(); 66 return; 28 suite.addTestCase({ 29 name: "EmptyBefore", 30 description: "Without exceptions, $exception should be undefined", 31 test: (resolve, reject) => { 32 WebInspector.runtimeManager.evaluateInInspectedWindow("$exception", {objectGroup: "test", includeCommandLineAPI: true, doNotPauseOnExceptionsAndMuteConsole: true}, (result, wasThrown) => { 33 InspectorTest.expectThat(result.description === "undefined", "$exception should be undefined if there is no exception."); 34 resolve(); 35 }); 67 36 } 68 37 }); 69 38 70 WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.Resumed, function(event) { 71 done = true; 72 dumpCommandLineAPIValue("AFTER "); 73 InspectorTest.completeTest(); 39 suite.addTestCase({ 40 name: "CheckExceptionInsideNestedCatchBlocks", 41 description: "Check $exception is always the current exception object when stepping through catch blocks.", 42 test: (resolve, reject) => { 43 InspectorTest.evaluateInPage("setTimeout(nestedCatchBlocks, 0)"); 44 45 let phase = 0; 46 let listener = WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.CallFramesDidChange, (event) => { 47 if (!WebInspector.debuggerManager.activeCallFrame) 48 return; 49 50 phase++; 51 52 // Skip past the first pause to the second pause. 53 if (phase === 1) { 54 dumpCommandLineAPIValue("OUTER 1"); 55 WebInspector.debuggerManager.resume(); 56 return; 57 } 58 59 // Paused on the exception in the inner try, step over to get into the inner catch. 60 if (phase === 2) { 61 dumpCommandLineAPIValue("INNER 1"); 62 WebInspector.debuggerManager.stepOver(); 63 return; 64 } 65 66 // Paused in the inner catch, verify $exception is "inner exception". 67 if (phase === 3) { 68 dumpCommandLineAPIValue("INNER 2"); 69 checkIfExceptionValueMatchesVariable("e2"); 70 WebInspector.debuggerManager.stepOver(); 71 return; 72 } 73 74 // Stepped into the outer catch, verify $exception is "outer exception". 75 if (phase === 4) { 76 dumpCommandLineAPIValue("OUTER 2"); 77 checkIfExceptionValueMatchesVariable("e1"); 78 WebInspector.debuggerManager.resume().then(() => { 79 WebInspector.debuggerManager.removeEventListener(WebInspector.DebuggerManager.Event.CallFramesDidChange, listener); 80 resolve(); 81 }, reject); 82 return; 83 } 84 }); 85 } 74 86 }); 75 87 76 dumpCommandLineAPIValue("BEFORE "); 77 InspectorTest.evaluateInPage("triggerException()"); 88 suite.addTestCase({ 89 name: "EmptyAfter", 90 description: "Without exceptions, $exception should be undefined", 91 test: (resolve, reject) => { 92 WebInspector.runtimeManager.evaluateInInspectedWindow("$exception", {objectGroup: "test", includeCommandLineAPI: true, doNotPauseOnExceptionsAndMuteConsole: true}, (result, wasThrown) => { 93 InspectorTest.expectThat(result.description === "undefined", "$exception should be undefined if there is no exception."); 94 resolve(); 95 }); 96 } 97 }); 98 99 suite.runTestCasesAndFinish(); 78 100 } 79 101 </script> 80 102 </head> 81 103 <body onload="runTest()"> 82 104 <p>Checks that <code>$exception</code> is the value of the current exception, even in nested catch blocks.</p> 83 105 </body> 84 106 </html> -
trunk/LayoutTests/inspector/debugger/command-line-api-exception.html
r201855 r202784 1 <! doctypehtml>1 <!DOCTYPE html> 2 2 <html> 3 3 <head> 4 <script type="text/javascript"src="../../http/tests/inspector/resources/inspector-test.js"></script>5 <script type="text/javascript"src="./resources/exceptions.js"></script>4 <script src="../../http/tests/inspector/resources/inspector-test.js"></script> 5 <script src="./resources/exceptions.js"></script> 6 6 <script> 7 var exceptionIndex = 0; 8 var exceptionCausers = [ 9 triggerUncaughtTypeException, 10 triggerUncaughtReferenceException, 11 triggerUncaughtSyntaxException, 12 triggerUncaughtDOMException, 13 throwString, 14 throwNumber, 15 throwNull, 16 throwObject, 17 throwNode, 18 function() { catcher(triggerUncaughtTypeException); }, 19 function() { catcher(throwString); }, 20 function() { catcher(throwObject); }, 21 ]; 22 23 24 function triggerNextException() 25 { 26 // We expect uncaught exceptions, so avoid logs for them. 27 window.onerror = function(){}; 28 29 setTimeout(function() { 30 exceptionCausers[exceptionIndex++](); 31 }, 0); 32 } 7 // We expect uncaught exceptions, so avoid logs for them. 8 window.onerror = function(){}; 33 9 34 10 function test() … … 36 12 WebInspector.debuggerManager.allExceptionsBreakpoint.disabled = false; 37 13 38 function triggerNextException() { 39 InspectorTest.evaluateInPage("triggerNextException()"); 40 } 14 let suite = InspectorTest.createAsyncSuite("CommandLineAPI.$exception"); 41 15 42 function dumpCommandLineAPIValue(prefix) { 43 WebInspector.runtimeManager.evaluateInInspectedWindow("$exception", {objectGroup: "test", includeCommandLineAPI: true, doNotPauseOnExceptionsAndMuteConsole: true}, function(result, wasThrown) { 44 InspectorTest.log(prefix + ": $exception => " + result.description); 16 function addNoExceptionTest(name) { 17 suite.addTestCase({ 18 name, description: "Without exceptions, $exception should be undefined", 19 test: (resolve, reject) => { 20 WebInspector.runtimeManager.evaluateInInspectedWindow("$exception", {objectGroup: "test", includeCommandLineAPI: true, doNotPauseOnExceptionsAndMuteConsole: true}, (result, wasThrown) => { 21 InspectorTest.expectThat(result.description === "undefined", "$exception should be undefined if there is no exception."); 22 resolve(); 23 }); 24 } 45 25 }); 46 26 } 47 27 48 function checkIfExceptionValueMatchesCatchVariable() { 49 WebInspector.runtimeManager.evaluateInInspectedWindow("$exception === e", {objectGroup: "test", includeCommandLineAPI: true, doNotPauseOnExceptionsAndMuteConsole: true}, function(result, wasThrown) { 50 InspectorTest.log("STEPPED OUT TO CATCH BLOCK: $exception === e ? " + result.description); 28 function addUncaughtExceptionTest(name, testFunction) { 29 suite.addTestCase({ 30 name, description: "Trigger an uncaught exception and check $exception.", 31 test: (resolve, reject) => { 32 InspectorTest.evaluateInPage(`setTimeout(${testFunction})`); 33 WebInspector.debuggerManager.singleFireEventListener(WebInspector.DebuggerManager.Event.Paused, (event) => { 34 WebInspector.runtimeManager.evaluateInInspectedWindow("$exception", {objectGroup: "test", includeCommandLineAPI: true, doNotPauseOnExceptionsAndMuteConsole: true}, (result, wasThrown) => { 35 InspectorTest.log("$exception => " + result.description); 36 WebInspector.debuggerManager.resume().then(resolve, reject); 37 }); 38 }); 39 } 51 40 }); 52 41 } 53 42 54 var pauses = 0;55 var stepping = false;56 var done = false;57 const pointWhereExpectionsAreBeingCaught = 9;58 const expectedPauses = 12;43 function addCaughtExceptionTest(name, expression) { 44 suite.addTestCase({ 45 name, description: "Trigger a caught exception and check $exception.", 46 test: (resolve, reject) => { 47 InspectorTest.evaluateInPage(expression); 59 48 60 WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.CallFramesDidChange, function(event) { 61 if (done) 62 return; 49 let didStep = false; 50 let didEvaluate = false; 63 51 64 if (!stepping) { 65 dumpCommandLineAPIValue("PAUSE #" + (++pauses)); 66 if (pauses > pointWhereExpectionsAreBeingCaught) { 67 WebInspector.debuggerManager.stepOut(); 68 stepping = true; 69 return; 52 let listener = WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.CallFramesDidChange, (event) => { 53 if (!WebInspector.debuggerManager.activeCallFrame) 54 return; 55 56 if (!didStep) { 57 didStep = true; 58 InspectorTest.pass("Paused, stepping out to catch block..."); 59 WebInspector.debuggerManager.stepOut(); 60 return; 61 } 62 63 if (!didEvaluate) { 64 didEvaluate = true; 65 WebInspector.runtimeManager.evaluateInInspectedWindow("$exception === e", {objectGroup: "test", includeCommandLineAPI: true, doNotPauseOnExceptionsAndMuteConsole: true}, (result, wasThrown) => { 66 InspectorTest.expectThat(result.description === "true", "`$exception` should be equal to `e`."); 67 }); 68 WebInspector.runtimeManager.evaluateInInspectedWindow("$exception", {objectGroup: "test", includeCommandLineAPI: true, doNotPauseOnExceptionsAndMuteConsole: true}, (result, wasThrown) => { 69 InspectorTest.log("$exception => " + result.description); 70 WebInspector.debuggerManager.resume().then(() => { 71 WebInspector.debuggerManager.removeEventListener(WebInspector.DebuggerManager.Event.CallFramesDidChange, listener); 72 resolve(); 73 }, reject); 74 }); 75 return; 76 } 77 }); 70 78 } 71 } else { 72 checkIfExceptionValueMatchesCatchVariable(); 73 stepping = false; 74 } 79 }); 80 } 75 81 76 WebInspector.debuggerManager.resume();82 addNoExceptionTest("BeforeExceptions"); 77 83 78 if (pauses !== expectedPauses) { 79 triggerNextException(); 80 return; 81 } 82 }); 84 addUncaughtExceptionTest("UncaughtTypeException", "triggerUncaughtTypeException"); 85 addUncaughtExceptionTest("UncaughtReferenceException", "triggerUncaughtReferenceException"); 86 addUncaughtExceptionTest("UncaughtSyntaxException", "triggerUncaughtSyntaxException"); 87 addUncaughtExceptionTest("UncaughtDOMException", "triggerUncaughtDOMException"); 88 addUncaughtExceptionTest("UncaughtString", "throwString"); 89 addUncaughtExceptionTest("UncaughtNumber", "throwNumber"); 90 addUncaughtExceptionTest("UncaughtNull", "throwNull"); 91 addUncaughtExceptionTest("UncaughtObject", "throwObject"); 92 addUncaughtExceptionTest("UncaughtNode", "throwNode"); 83 93 84 WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.Resumed, function(event) { 85 done = true; 86 dumpCommandLineAPIValue("AFTER"); 87 InspectorTest.completeTest(); 88 }); 94 addCaughtExceptionTest("CatchTypeException", "setTimeout(function() { catcher(triggerUncaughtTypeException); })"); 95 addCaughtExceptionTest("CatchThrownString", "setTimeout(function() { catcher(throwString); })"); 96 addCaughtExceptionTest("CatchThrownObject", "setTimeout(function() { catcher(throwObject); })"); 89 97 90 dumpCommandLineAPIValue("BEFORE"); 91 triggerNextException(); 98 addNoExceptionTest("AfterExceptions"); 99 100 suite.runTestCasesAndFinish(); 92 101 } 93 102 </script> 94 103 </head> 95 104 <body onload="runTest()"> 96 105 <p>Checks that <code>$exception</code> is available and accurate in evaluations when paused on an exception.</p> 97 106 </body> 98 107 </html> -
trunk/LayoutTests/platform/mac/TestExpectations
r202783 r202784 1211 1211 webkit.org/b/153460 [ Debug ] inspector/codemirror/prettyprinting-css-rules.html [ Pass Timeout ] 1212 1212 webkit.org/b/158742 [ Debug ] inspector/debugger/break-in-constructor-before-super.html [ Pass Timeout ] 1213 webkit.org/b/152029 inspector/debugger/command-line-api-exception.html [ Pass Timeout ]1214 webkit.org/b/152487 inspector/debugger/command-line-api-exception-nested-catch.html [ Pass Timeout ]1215 1213 webkit.org/b/148636 inspector/dom/content-flow-content-nodes.html [ Pass Timeout ] 1216 1214 webkit.org/b/148636 inspector/dom/content-flow-content-removal.html [ Pass Timeout ] -
trunk/Source/WebInspectorUI/ChangeLog
r202742 r202784 1 2016-07-02 Joseph Pecoraro <pecoraro@apple.com> 2 3 inspector/debugger/command-line-api-exception.html flakily times out on mac 4 https://bugs.webkit.org/show_bug.cgi?id=152029 5 <rdar://problem/23813812> 6 7 Reviewed by Timothy Hatcher. 8 9 * UserInterface/Base/Object.js: 10 (WebInspector.Object.addEventListener): 11 Return the listener, this makes it cleaner to write tests. 12 1 13 2016-07-01 Joseph Pecoraro <pecoraro@apple.com> 2 14 -
trunk/Source/WebInspectorUI/UserInterface/Base/Object.js
r201171 r202784 55 55 56 56 listenersTable.add(thisObject, listener); 57 return listener; 57 58 } 58 59
Note: See TracChangeset
for help on using the changeset viewer.