Title: [163361] trunk/LayoutTests
Revision
163361
Author
mark....@apple.com
Date
2014-02-03 20:13:54 -0800 (Mon, 03 Feb 2014)

Log Message

Need regression test to ensure that the debugger does not attempt to execute a bad script from its console.
<https://webkit.org/b/128121>

Reviewed by Geoffrey Garen.

Regression test for https://bugs.webkit.org/show_bug.cgi?id=127600.

* inspector-protocol/debugger/breakpoint-condition-with-bad-script-expected.txt: Added.
* inspector-protocol/debugger/breakpoint-condition-with-bad-script.html: Added.
- Sets up a breakpoint with a condition script. The condition script
  will fail to parse with a syntax error.
  I've tested that without the fix in http://trac.webkit.org/r162752,
  this will crash the VM. With the fix, it works fine.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (163360 => 163361)


--- trunk/LayoutTests/ChangeLog	2014-02-04 04:08:25 UTC (rev 163360)
+++ trunk/LayoutTests/ChangeLog	2014-02-04 04:13:54 UTC (rev 163361)
@@ -1,3 +1,19 @@
+2014-02-03  Mark Lam  <mark....@apple.com>
+
+        Need regression test to ensure that the debugger does not attempt to execute a bad script from its console.
+        <https://webkit.org/b/128121>
+
+        Reviewed by Geoffrey Garen.
+
+        Regression test for https://bugs.webkit.org/show_bug.cgi?id=127600.
+
+        * inspector-protocol/debugger/breakpoint-condition-with-bad-script-expected.txt: Added.
+        * inspector-protocol/debugger/breakpoint-condition-with-bad-script.html: Added.
+        - Sets up a breakpoint with a condition script. The condition script
+          will fail to parse with a syntax error.
+          I've tested that without the fix in http://trac.webkit.org/r162752,
+          this will crash the VM. With the fix, it works fine.
+
 2014-02-03  Radu Stavila  <stav...@adobe.com>
 
         REGRESSION (r163018): Can’t scroll in <select> lists

Added: trunk/LayoutTests/inspector-protocol/debugger/breakpoint-condition-with-bad-script-expected.txt (0 => 163361)


--- trunk/LayoutTests/inspector-protocol/debugger/breakpoint-condition-with-bad-script-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/inspector-protocol/debugger/breakpoint-condition-with-bad-script-expected.txt	2014-02-04 04:13:54 UTC (rev 163361)
@@ -0,0 +1,7 @@
+CONSOLE MESSAGE: line 9: SyntaxError: Unexpected keyword 'else'
+The debugger should not crash when executing a bad script for testing a breakpoint condition.
+
+Found breakpoint.js
+inside breakpointWithCondition a:(1) b:(2) a+b:(3)
+PASS: The VM should not crash.
+

Added: trunk/LayoutTests/inspector-protocol/debugger/breakpoint-condition-with-bad-script.html (0 => 163361)


--- trunk/LayoutTests/inspector-protocol/debugger/breakpoint-condition-with-bad-script.html	                        (rev 0)
+++ trunk/LayoutTests/inspector-protocol/debugger/breakpoint-condition-with-bad-script.html	2014-02-04 04:13:54 UTC (rev 163361)
@@ -0,0 +1,53 @@
+<html>
+<head>
+<script src=""
+<script src=""
+<script>
+function test()
+{
+    InspectorTest.eventHandler["Debugger.scriptParsed"] = function(messageObject)
+    {
+        if (/resources\/breakpoint\.js$/.test(messageObject.params.url)) {
+            InspectorTest.log("Found breakpoint.js");
+            var breakpoint = {
+                location: {
+                    scriptId: messageObject.params.scriptId,
+                    lineNumber: 8,
+                    columnNumber: 0
+                },
+                options: {
+                    autoContinue: true,
+                    condition: "else", // a bad script that should fail to parse.
+                    action: [
+                        {type: "log", data: "FAIL: The breakpoint action should not be executed if the condition had an exception."}
+                    ]
+                }
+            };
+            InspectorTest.sendCommand("Debugger.setBreakpoint", breakpoint, InspectorTest.checkForError);
+            InspectorTest.sendCommand("Runtime.evaluate", {_expression_: "breakpointWithCondition(1,2)"}, function() {
+                InspectorTest.log("PASS: The VM should not crash.");
+                completeTest();
+            });
+        }
+    }
+
+    InspectorTest.eventHandler["Debugger.paused"] = function(messageObject)
+    {
+        InspectorTest.log("FAIL: Paused in debugger: reason = \"" + messageObject.params.reason + "\"");
+        completeTest();
+    }
+
+    function completeTest()
+    {
+        // Reset the pauseOnException state before ending the test.
+        InspectorTest.completeTest();
+    }
+
+    InspectorTest.sendCommand("Debugger.enable", {});
+}
+</script>
+</head>
+<body _onload_="runTest()">
+<p>The debugger should not crash when executing a bad script for testing a breakpoint condition.</p>
+</body>
+</html>
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to