diff options
Diffstat (limited to 'WebCore/manual-tests/inspector')
3 files changed, 386 insertions, 0 deletions
diff --git a/WebCore/manual-tests/inspector/debugger-watch-expressions.html b/WebCore/manual-tests/inspector/debugger-watch-expressions.html new file mode 100644 index 0000000..eb883c9 --- /dev/null +++ b/WebCore/manual-tests/inspector/debugger-watch-expressions.html @@ -0,0 +1,115 @@ +<p>Test for +<a href="https://bugs.webkit.org/show_bug.cgi?id=27514">Bug 27514 - add support for watched expression</a>. + +<p>To begin test, open web inspector, go the scripts panel +(enabling script debugging if necccessary), and then click this link: +<a href="javascript:runTest()">[begin test]</a>. + +<p>Perform the following steps, and note the expected results: + +<ol> + +<li><p>After clicking the link above, you should now be paused in the body of +the test method, thanks to the <code>debugger</code> statement. + +<li><p>Add the following expressions to the "Watch Expressions" section of the +Scripts panel sidebar pane: "<code>this</code>", "<code>a</code>", +"<code>b</code>", "<code>c</code>" and "<code>d</code>". Do <b>NOT</b> enter the quotes. + +<li><p>The values of the expressions as shown in the window should a +<code>DOMWindow</code> for <code>this</code>, <code>undefined</code> for +the <code>a</code>, <code>b</code>, and <code>c</code> variables, and a +value of <code>ReferenceError: Can't find variable: d</code> +for the <code>d</code> variable. + +<li><p>Note that the value for <code>d</code> should not change for the life of +the test, as the variable <code>d</code> is never introduced in the program. + +<li><p>Step through the code, and you'll see the values of <code>a</code>, +<code>b</code>, and <code>c</code> change, as the variables are assigned. +Also note that as the scope changes due to the function invocation, values +will be changed to refer to their current scope. The <code>this</code> +expression will change when the method is invoked on the object constructed by +the test. + +<li><p>Click different stack frames in the Call Stack section to ensure the +expressions change value appropriately as the current stack frame changes. + +<li><p>Drive the debugger through the end of the outermost function, so that +the debugger is no longer in paused state. The values of +<code>a</code>, <code>b</code>, and <code>c</code> should all be a +ReferenceError like <code>d</code>, since these variables are defined in the +<code>runTest()</code> function, and the expressions are being evaluated against +the global object. + +<li><p>From the console, execute the statement "<code>a = 1</code>". The +watch expressions do not currently refresh, so the value for <code>a</code> +should still be ReferenceError. + +<li><p>Click the "Refresh" button in the Watch Expressions section and the +value for "<code>a</code>" should now be "<code>1</code>". + +<li><p>Close down the browser, start it back up, traverse to a web site, +bring up web inspector, go to the Scripts panel. You should see the same +set of Watch Expressions in the list as you had when you last used web +inspector. + +<li><p>Delete an expression by moving the mouse into the Watch Expression +section, and clicking the X icon which appears to the right of an +expression (on hover). + +<li><p>Delete an expression by double-clicking anywhere on a top-level line +of a watch expression, and changing the expression to an empty string or +nothing but white-space. + +<li><p>Modify an entry by double-clicking anywhere on a top-level line +of a watch expression, and changing the expression. + +<li><p>Enter a new expression, "<code>new Date()</code>". The value should be +a toString() version of the date. Repeatedly press the Refresh button to see +the value updated with the current time. + +</ol> + +<script> +function runTest() { + + // a nested function + function subFunction() { + debugger; + var a = "a in subFunction()"; + + subSubFunction(); + + // another nested function + function subSubFunction() { + debugger; + var b = "b in subSubFunction()"; + } + } + + // a class + function aClass() { + this.x = "xxx"; + this.y = "yyy"; + } + + aClass.prototype.aMethod = function() { + debugger; + var c = "c in aMethod()"; + } + + // main logic + debugger; + + var a = "a in runTest()"; + var b = "b in runTest()"; + var c = "c in runTest()"; + + subFunction(); + + var object = new aClass(); + object.aMethod(); + +} +</script> diff --git a/WebCore/manual-tests/inspector/display-form-data.html b/WebCore/manual-tests/inspector/display-form-data.html new file mode 100644 index 0000000..48cd817 --- /dev/null +++ b/WebCore/manual-tests/inspector/display-form-data.html @@ -0,0 +1,249 @@ +<html> +<head> +<title>Tests for Bug 22920</title> +<meta http-equiv="Content-Type" content="text/html;charset=utf-8" > +</head> + +<body> +<p>Tests for +<ul> +<li><p><a href="https://bugs.webkit.org/show_bug.cgi?id=22920">Bug 22920: Inspector Request Headers Should Show Data/Variables/Parameters Sent With Request</a> +<li><p><a href="https://bugs.webkit.org/show_bug.cgi?id=28970">Bug 28970: content-type parameters not taken into account when building form-data</a> +</ul> + +<p>To test, open the Inspector on this page, go to the Resources panel, +and select the various resources created by this page in the left column of the +Resources panel. Note that for test-4 ... +test-11, the -sync and -async versions should show the same Form Data, +Request Payload and/or Query String Parameter values. + +<ul> + +<li><p><b>test-1</b>: +<br>no Form Data, Request Payload or Query String Parameters + +<li><p><b>test-2</b>: +<br>Query String Parameters (1): "parm1: abc" + +<li><p><b>test-3</b>: +<br>Query String Parameters (2): "parm1: def" and "parm2: g h i"; +Hovering over either parm should yield a tooltip: +<i>"Double-Click to toggle between URL encoded and decoded formats"</i>. +Double-clicking on either parm should toggle between encoded and decoded +versions of the string. The decoded form is initially displayed. +The encoded form of parm2 is "g%20h+i". + +<li><p><b>test-4</b>: +<br>no Form Data, Request Payload or Query String Parameters + +<li><p><b>test-5</b>: +<br>Query String Parameters (1): "parm1: abc" + +<li><p><b>test-6</b>: +<br>Query String Parameters (3): "parm1: def" and "parm2: g h i" and "parm3: jj kk ll" + +<li><p><b>test-7</b>: +<br>Request Payload: 3 lines of text data with a very long 2nd line which should wrap + +<li><p><b>test-8</b>: +<br>Request Payload: 3 lines of text data with a very long 2nd line which should wrap + +<li><p><b>test-9</b>: +<br>Request Payload: 3 lines of text data with a very long 2nd line of binary data which should wrap + +<li><p><b>test-10</b>: +<br>Form Data (1): "parm1: abc" + +<li><p><b>test-11</b>: +<br>Form Data (2): "parm1: def" and "parm2: g h i" + +<li><p><b>test-12</b>: +<br>Query String Parameters (2): "parm1: abc" and "parm2: d e f" +<br>Form Data (2): "parm1: ghi" and "parm2: j k l" + +<li><p><b>test-13</b>: +<br>Query String Parameters (2): "parm1: äbc" and "parm2: d ě f" +<br>Form Data (2): "parm1: ghi" and "parm2: j k l" +<p>Note that you should view the encoded values of the query string parameters +by double-clicking on one of the parameters. The values should be: +<pre> +parm1: %C3%A4bc +parm2: d%20%C4%9B+f +</pre> + +<li><p><b>test-14</b>: +<br>Same results as for test-13, a slightly different but compatible Content-Type +is used for the form data. + +<li><p><b>test-15</b>: +<br>Query String Parameters (2): "parm1: % (unable to decode value)" and "parm2: % (unable to decode value)", +with the parenthesized part in red. +<br>Form Data (2): "parm1: % (unable to decode value)" and "parm2: % (unable to decode value)", +with the parenthesized part in red. +<p>Note that you should view the encoded values of the query string parameters +by double-clicking on one of the parameters. The values for all four parameters should be "%". + +<li><p><b>test-form</b>: +<br>For this test, invoke the form at the bottom of the page +by pressing the submit button. The Resources panel should have a "test-form" +resource, with the following data: +<p>Form Data (2): "field1: value ä;b;c" and "field2:value d;ě;f" +<p>Note that you should view the encoded values of the query string parameters +by double-clicking on one of the parameters. The values should be: +<pre> +field1: value+%C3%A4%3Bb%3Bc +field2: value+d%3B%C4%9B%3Bf</pre> +</ul> + +<p><b>test-form</b> +<form id="form" action="http://example.org/test-form" method="post" enctype="application/x-www-form-urlencoded"> +<span style="font-size:200%">field1:</span> <input style="font-size:200%" type="text" name="field1" value="value ä;b;c"><br> +<span style="font-size:200%">field2:</span> <input style="font-size:200%" type="text" name="field2" value="value d;ě;f"><br> +<input type="submit"> +</form> + +<div style="display:none"> + +<img src="http://example.org/test-1"> +<img src="http://example.org/test-2?parm1=abc"> +<img src="http://example.org/test-3?parm1=def&parm2=g%20h+i"> + +</div> + +<hr> + +<p><b>NLS sample info</b> + +<pre> +<span style="font-size:300%">ä</span> - LATIN SMALL LETTER A WITH DIAERESIS +Unicode: 0x00E4 == 228 +UTF8: C3 A4 +HTML: &auml; + +<span style="font-size:300%">ě</span> - LATIN SMALL LETTER E WITH CARON +Unicode: 0x011B == 283 +UTF8: C4 9B +HTML: &#x11B; +</pre> + +<script> + +function getReadyState(num) { + switch(num) { + case 0: return "uninitialized"; + case 1: return "loading"; + case 2: return "loaded"; + case 3: return "interactive"; + case 4: return "complete"; + default: return "unknown: " + num; + } +} + +function getProcessXHR(request) { + return function() { + if (true) return; + var rs = getReadyState(request.readyState); + console.log("ready state change for " + request.url); + console.log(" ready state: " + rs); + console.log(" response text: " + request.responseText); + if (request.readyState == 4) { + console.log(" status: " + request.status); + console.log(" status text: " + request.statusText); + } + } +} + +function sendXHR(url, method, headers, body) { + if (!method) method = "GET"; + if (!headers) headers = []; + if (!body) body=""; + + // copy headers + var headersNew = []; + for (var i=0; i<headers.length; i++) { + headersNew.push(headers[i]); + } + headers = headersNew; + + if (body != "") { + headers.push(["Content-Length", body.length.toString()]); + } + + // sync + var req = new XMLHttpRequest(); + + req.url = url.replace("^","-sync"); + req.onreadystatechange = getProcessXHR(req); + req.open(method, req.url, false); + + for (var i=0; i<headers.length; i++) { + req.setRequestHeader(headers[i][0], headers[i][1]); + } + + req.send(body); + + // async + var req = new XMLHttpRequest(); + + req.url = url.replace("^","-async"); + req.onreadystatechange = getProcessXHR(req); + req.open(method, req.url, true); + + for (var i=0; i<headers.length; i++) { + req.setRequestHeader(headers[i][0], headers[i][1]); + } + + req.send(body); +} + +var headersPlain = [ + ["Content-Type", "text/plain"] +]; + +var headersForm = [ + ["Content-Type", "application/x-www-form-urlencoded"] +]; + +var headersFormExtra1 = [ + ["Content-Type", "application/x-www-form-urlencoded;something-else=here"] +]; + +var headersFormExtra2 = [ + ["Content-Type", "application/x-www-form-urlencoded ; something-else=here"] +]; + +var headersBinary = [ + ["Content-Type", "application/octet-stream"] +]; + +var longText = "some text with a \n"; +for (var i=0; i<40; i++) { + longText += "very-"; +} +longText += "long\nline in it"; + +var binaryData = "some text with binary data\n"; +for (var i=0; i<256; i++) { + binaryData += String.fromCharCode(i); +} +binaryData += "\nin the middle of it"; + + +sendXHR("http://example.org/test-4^"); +sendXHR("http://example.org/test-5^?parm1=abc"); +sendXHR("http://example.org/test-6^?parm1=def&parm2=g%20h+i&parm3=jj++kk%20%20ll"); + +sendXHR("http://example.org/test-7^", "POST", null, longText); +sendXHR("http://example.org/test-8^", "POST", headersPlain, longText); +sendXHR("http://example.org/test-9^", "POST", headersBinary, binaryData); +sendXHR("http://example.org/test-10^", "POST", headersForm, "parm1=abc"); +sendXHR("http://example.org/test-11^", "POST", headersForm, "parm1=def&parm2=g%20h+i"); +sendXHR("http://example.org/test-12^?parm1=abc&parm2=d%20e+f", "POST", headersForm, "parm1=ghi&parm2=j%20k+l"); +sendXHR("http://example.org/test-13^?parm1=%C3%A4bc&parm2=d%20%C4%9B+f", "POST", headersFormExtra1, "parm1=ghi&parm2=j%20k+l"); +sendXHR("http://example.org/test-14^?parm1=%C3%A4bc&parm2=d%20%C4%9B+f", "POST", headersFormExtra2, "parm1=ghi&parm2=j%20k+l"); +sendXHR("http://example.org/test-15^?parm1=%&parm2=%", "POST", headersForm, "parm1=%&parm2=%"); + +</script> + +</body> +</html>
\ No newline at end of file diff --git a/WebCore/manual-tests/inspector/webinspector-log.html b/WebCore/manual-tests/inspector/webinspector-log.html new file mode 100644 index 0000000..cdc5663 --- /dev/null +++ b/WebCore/manual-tests/inspector/webinspector-log.html @@ -0,0 +1,22 @@ +<p>Test for <a href="https://bugs.webkit.org/show_bug.cgi?id=28047">Bug 28047: add utility method to enable logging messages for inspector development</a>.</p> + +<ul> +<li>Open a browser, go to any web page. +<li>Open web inspector +<li>Open the console panel +<li>Open a web inspector on the web inspector +<li>Open that inspector's console panel +<li>In that panel, run the code: +<pre> + WebInspector.log("hello, world") +</pre> +</ul> + +<p>Results: +<br>In the original inspector window, there should now be a message +in the console with the text "hello, world". There will be a blue +maginifying glass icon to the left of the message. Run the same +command again, and you should see the repeat count go to 2. +The message and repeat count are blue. + + |