Title: [118382] trunk
Revision
118382
Author
[email protected]
Date
2012-05-24 08:50:31 -0700 (Thu, 24 May 2012)

Log Message

Web Inspector: [regression] search in formatted scripts is broken.
https://bugs.webkit.org/show_bug.cgi?id=87377

Reviewed by Vsevolod Vlasov.

Source/WebCore:

Using formatted content in search.

Test: inspector/debugger/script-formatter-search.html

* inspector/front-end/_javascript_Source.js:
(WebInspector._javascript_Source.prototype.workingCopyCommitted):
(WebInspector._javascript_Source.prototype.searchInContent.callbackWrapper):
(WebInspector._javascript_Source.prototype.searchInContent):

LayoutTests:

* inspector/debugger/script-formatter-search-expected.txt: Added.
* inspector/debugger/script-formatter-search.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (118381 => 118382)


--- trunk/LayoutTests/ChangeLog	2012-05-24 15:48:03 UTC (rev 118381)
+++ trunk/LayoutTests/ChangeLog	2012-05-24 15:50:31 UTC (rev 118382)
@@ -1,3 +1,13 @@
+2012-05-24  Pavel Feldman  <[email protected]>
+
+        Web Inspector: [regression] search in formatted scripts is broken.
+        https://bugs.webkit.org/show_bug.cgi?id=87377
+
+        Reviewed by Vsevolod Vlasov.
+
+        * inspector/debugger/script-formatter-search-expected.txt: Added.
+        * inspector/debugger/script-formatter-search.html: Added.
+
 2012-05-24  Jessie Berlin  <[email protected]>
 
         Fix the Mac tests after r118353.

Added: trunk/LayoutTests/inspector/debugger/script-formatter-search-expected.txt (0 => 118382)


--- trunk/LayoutTests/inspector/debugger/script-formatter-search-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/inspector/debugger/script-formatter-search-expected.txt	2012-05-24 15:50:31 UTC (rev 118382)
@@ -0,0 +1,15 @@
+Tests that search across files works with formatted scripts.
+
+Debugger was enabled.
+Pre-format search results:
+Search matches: 
+lineNumber: 24, line: '        scriptSource.searchInContent("margic-string", true, false, dump1);'
+lineNumber: 37, line: '        scriptSource.searchInContent("margic-string", true, false, dump2);'
+
+Original content was requested.
+Post-format search results:
+Search matches: 
+lineNumber: 28, line: '        scriptSource.searchInContent("margic-string", true, false, dump1);'
+lineNumber: 41, line: '        scriptSource.searchInContent("margic-string", true, false, dump2);'
+
+
Property changes on: trunk/LayoutTests/inspector/debugger/script-formatter-search-expected.txt
___________________________________________________________________

Added: svn:eol-style

Added: trunk/LayoutTests/inspector/debugger/script-formatter-search.html (0 => 118382)


--- trunk/LayoutTests/inspector/debugger/script-formatter-search.html	                        (rev 0)
+++ trunk/LayoutTests/inspector/debugger/script-formatter-search.html	2012-05-24 15:50:31 UTC (rev 118382)
@@ -0,0 +1,66 @@
+<html>
+<head>
+<script src=""
+<script src=""
+<script src=""
+
+<script>
+
+var test = function()
+{
+    var scriptSource;
+    var shouldRequestContent = false;
+
+    InspectorTest.startDebuggerTest(started);
+
+    function started()
+    {
+        InspectorTest.showScriptSource("script-formatter-search.html", didShowScriptSource);
+    }
+
+    function didShowScriptSource(frame)
+    {
+        scriptSource = frame._javaScriptSource;
+        InspectorTest.addSniffer(scriptSource._contentProvider, "requestContent", requestContentSniffer);
+        scriptSource.searchInContent("margic-string", true, false, dump1);
+    }
+
+    function dump1(matches)
+    {
+        InspectorTest.addResult("Pre-format search results:");
+        InspectorTest.dumpSearchMatches(matches);
+        shouldRequestContent = true;
+        scriptSource.setFormatted(true, didFormat);
+    }
+
+    function didFormat()
+    {
+        scriptSource.searchInContent("margic-string", true, false, dump2);
+    }
+
+    function dump2(matches)
+    {
+        InspectorTest.addResult("Post-format search results:");
+        InspectorTest.dumpSearchMatches(matches);
+        InspectorTest.completeTest();
+    }
+
+    function requestContentSniffer()
+    {
+        if (shouldRequestContent)
+            InspectorTest.addResult("Original content was requested.");
+        else
+            InspectorTest.addResult("Failure: original content should not be requested.");
+    }
+}
+
+</script>
+
+</head>
+
+<body _onload_="runTest()">
+<p>Tests that search across files works with formatted scripts.
+</p>
+
+</body>
+</html>
Property changes on: trunk/LayoutTests/inspector/debugger/script-formatter-search.html
___________________________________________________________________

Added: svn:eol-style

Modified: trunk/Source/WebCore/ChangeLog (118381 => 118382)


--- trunk/Source/WebCore/ChangeLog	2012-05-24 15:48:03 UTC (rev 118381)
+++ trunk/Source/WebCore/ChangeLog	2012-05-24 15:50:31 UTC (rev 118382)
@@ -1,3 +1,19 @@
+2012-05-24  Pavel Feldman  <[email protected]>
+
+        Web Inspector: [regression] search in formatted scripts is broken.
+        https://bugs.webkit.org/show_bug.cgi?id=87377
+
+        Reviewed by Vsevolod Vlasov.
+
+        Using formatted content in search.
+
+        Test: inspector/debugger/script-formatter-search.html
+
+        * inspector/front-end/_javascript_Source.js:
+        (WebInspector._javascript_Source.prototype.workingCopyCommitted):
+        (WebInspector._javascript_Source.prototype.searchInContent.callbackWrapper):
+        (WebInspector._javascript_Source.prototype.searchInContent):
+
 2012-05-24  Philip Rogers  <[email protected]>
 
         Refactor SVGAnimateTransformElement to avoid expensive determineAnimatedPropertyType call

Modified: trunk/Source/WebCore/inspector/Inspector.json (118381 => 118382)


--- trunk/Source/WebCore/inspector/Inspector.json	2012-05-24 15:48:03 UTC (rev 118381)
+++ trunk/Source/WebCore/inspector/Inspector.json	2012-05-24 15:50:31 UTC (rev 118382)
@@ -92,7 +92,7 @@
                 "id": "MemoryBlock",
                 "type": "object",
                 "properties": [
-                    { "name": "size", "type": "integer", "optional":true, "description": "Size of the block in bytes if available" },
+                    { "name": "size", "type": "integer", "optional": true, "description": "Size of the block in bytes if available" },
                     { "name": "name", "type": "string", "description": "Unique name used to identify the component that allocated this block" },
                     { "name": "children", "type": "array", "optional": true, "items": { "$ref": "MemoryBlock" }}
                 ]

Modified: trunk/Source/WebCore/inspector/front-end/_javascript_Source.js (118381 => 118382)


--- trunk/Source/WebCore/inspector/front-end/_javascript_Source.js	2012-05-24 15:48:03 UTC (rev 118381)
+++ trunk/Source/WebCore/inspector/front-end/_javascript_Source.js	2012-05-24 15:50:31 UTC (rev 118382)
@@ -183,6 +183,19 @@
     workingCopyCommitted: function(callback)
     {  
         WebInspector.DebuggerResourceBinding.setScriptSource(this, this.workingCopy(), callback);
+    },
+
+    /**
+     * @param {string} query
+     * @param {boolean} caseSensitive
+     * @param {boolean} isRegex
+     * @param {function(Array.<WebInspector.ContentProvider.SearchMatch>)} callback
+     */
+    searchInContent: function(query, caseSensitive, isRegex, callback)
+    {
+        var content = this.content();
+        var provider = content ? new WebInspector.StaticContentProvider(this._contentProvider.contentType(), content) : this._contentProvider;
+        provider.searchInContent(query, caseSensitive, isRegex, callback);
     }
 }
 

Modified: trunk/Source/WebCore/inspector/generate-protocol-externs (118381 => 118382)


--- trunk/Source/WebCore/inspector/generate-protocol-externs	2012-05-24 15:48:03 UTC (rev 118381)
+++ trunk/Source/WebCore/inspector/generate-protocol-externs	2012-05-24 15:50:31 UTC (rev 118382)
@@ -41,7 +41,7 @@
 input_file = open(input_path, "r")
 json_string = input_file.read()
 json_string = json_string.replace(": true", ": True")
-json_string = json_string.replace(": false", ": false")
+json_string = json_string.replace(": false", ": False")
 json_api = eval(json_string)["domains"]
 
 output_file = open(output_path, "w")
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to