Changeset 96576 in webkit
- Timestamp:
- Oct 4, 2011 2:03:51 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 5 deleted
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r96574 r96576 1 2011-10-04 Sheriff Bot <webkit.review.bot@gmail.com> 2 3 Unreviewed, rolling out r96491. 4 http://trac.webkit.org/changeset/96491 5 https://bugs.webkit.org/show_bug.cgi?id=69326 6 7 Breaks Slow Leopard inspector tests (Requested by pfeldman on 8 #webkit). 9 10 * http/tests/inspector/resource-tree/resource-tree-test.js: 11 (initialize_ResourceTreeTest.InspectorTest.runAfterResourcesAreFinished): 12 (initialize_ResourceTreeTest.InspectorTest._runAfterResourcesAreFinished): 13 (initialize_ResourceTreeTest): 14 * http/tests/inspector/resources-test.js: 15 (initialize_ResourceTest): 16 * http/tests/inspector/search/resources/search-concatenated.html: Removed. 17 * http/tests/inspector/search/search-in-concatenated-script-expected.txt: Removed. 18 * http/tests/inspector/search/search-in-concatenated-script.html: Removed. 19 * http/tests/inspector/search/search-in-resource.html: 20 * http/tests/inspector/search/search-in-script-expected.txt: Removed. 21 * http/tests/inspector/search/search-in-script.html: Removed. 22 * http/tests/inspector/search/search-test.js: 23 (initialize_SearchTest.InspectorTest.runAfterResourcesAreCreated): 24 (initialize_SearchTest.InspectorTest._runAfterResourcesAreCreated): 25 (initialize_SearchTest.InspectorTest._runAfterResourcesAreCreated.maybeCallback): 26 (initialize_SearchTest.InspectorTest._runAfterResourcesAreCreated.addSniffer): 27 (initialize_SearchTest.InspectorTest._runAfterResourcesAreCreated.onResourceBind): 28 (initialize_SearchTest.InspectorTest._runAfterResourcesAreCreated.visit): 29 (initialize_SearchTest): 30 1 31 2011-10-04 Ryosuke Niwa <rniwa@webkit.org> 2 32 -
trunk/LayoutTests/http/tests/inspector/resource-tree/resource-tree-test.js
r96491 r96576 87 87 } 88 88 89 InspectorTest.runAfterResourcesAreFinished = function(resourceURLs, callback) 90 { 91 InspectorTest._runAfterResourcesAreFinished(resourceURLs.keySet(), callback); 92 } 93 94 InspectorTest._runAfterResourcesAreFinished = function(resourceURLs, callback) 95 { 96 function visit(resource) 97 { 98 if (!resource.finished) 99 return true; 100 101 for (var url in resourceURLs) { 102 if (resource.url.indexOf(url) !== -1) 103 delete resourceURLs[url]; 104 } 105 106 if (!Object.keys(resourceURLs).length) { 107 callback(); 108 return true; 109 } 110 } 111 112 var succeeded = WebInspector.resourceTreeModel.forAllResources(visit); 113 if (!succeeded) 114 setTimeout(InspectorTest._runAfterResourcesAreFinished.bind(InspectorTest, resourceURLs, callback), 0); 115 } 116 89 117 }; -
trunk/LayoutTests/http/tests/inspector/resources-test.js
r96491 r96576 28 28 } 29 29 30 InspectorTest.runAfterResourcesAreFinished = function(resourceURLs, callback)31 {32 InspectorTest._runAfterResourcesAreFinished(resourceURLs.keySet(), callback);33 30 } 34 35 InspectorTest._runAfterResourcesAreFinished = function(resourceURLs, callback)36 {37 function checkResource(resource)38 {39 for (var url in resourceURLs) {40 if (resource.url.indexOf(url) !== -1)41 delete resourceURLs[url];42 }43 }44 45 function maybeCallback()46 {47 if (!Object.keys(resourceURLs).length) {48 callback();49 return true;50 }51 }52 53 function addSniffer(resource)54 {55 InspectorTest.addSniffer(WebInspector.ResourceTreeModel.prototype, "_addResourceToFrame", resourceAddedToFrame.bind(this));56 }57 58 function resourceAddedToFrame(resource)59 {60 checkResource(resource);61 if (!maybeCallback())62 addSniffer();63 }64 65 function visit(resource)66 {67 checkResource(resource);68 return maybeCallback();69 }70 71 var succeeded = WebInspector.resourceTreeModel.forAllResources(visit);72 if (!succeeded)73 addSniffer();74 }75 76 } -
trunk/LayoutTests/http/tests/inspector/search/search-in-resource.html
r96491 r96576 2 2 <head> 3 3 <script src="../inspector-test.js"></script> 4 <script src="../resources-test.js"></script>5 4 <script src="search-test.js"></script> 6 5 <script> … … 9 8 // This file should not match search query. 10 9 var text = "searchTest" + "UniqueString"; 11 InspectorTest.runAfterResourcesAre Finished(["search.js"], step2);10 InspectorTest.runAfterResourcesAreCreated(["search.js"], step2); 12 11 13 12 function step2() -
trunk/LayoutTests/http/tests/inspector/search/search-test.js
r96491 r96576 17 17 }; 18 18 19 InspectorTest.runAfterResourcesAreCreated = function(resourceURLs, callback) 20 { 21 InspectorTest._runAfterResourcesAreCreated(resourceURLs.keySet(), callback); 22 } 23 24 InspectorTest._runAfterResourcesAreCreated = function(resourceURLs, callback) 25 { 26 function checkResource(resource) 27 { 28 for (var url in resourceURLs) { 29 if (resource.url.indexOf(url) !== -1) 30 delete resourceURLs[url]; 31 } 32 } 33 34 function maybeCallback() 35 { 36 if (!Object.keys(resourceURLs).length) { 37 callback(); 38 return true; 39 } 40 } 41 42 function addSniffer(resource) 43 { 44 InspectorTest.addSniffer(WebInspector.ResourceTreeModel.prototype, "_bindResourceURL", onResourceBind.bind(this)); 45 } 46 47 function onResourceBind(resource) 48 { 49 checkResource(resource); 50 if (!maybeCallback()) 51 addSniffer(); 52 } 53 54 function visit(resource) 55 { 56 checkResource(resource); 57 return maybeCallback(); 58 } 59 60 var succeeded = WebInspector.resourceTreeModel.forAllResources(visit); 61 if (!succeeded) 62 addSniffer(); 63 } 64 19 65 }; -
trunk/Source/WebCore/ChangeLog
r96575 r96576 1 2011-10-04 Sheriff Bot <webkit.review.bot@gmail.com> 2 3 Unreviewed, rolling out r96491. 4 http://trac.webkit.org/changeset/96491 5 https://bugs.webkit.org/show_bug.cgi?id=69326 6 7 Breaks Slow Leopard inspector tests (Requested by pfeldman on 8 #webkit). 9 10 * inspector/Inspector.json: 11 * inspector/InspectorDebuggerAgent.cpp: 12 (WebCore::InspectorDebuggerAgent::getScriptSource): 13 * inspector/InspectorDebuggerAgent.h: 14 * inspector/front-end/ContentProviders.js: 15 (WebInspector.ScriptContentProvider.prototype.requestContent): 16 * inspector/front-end/Script.js: 17 (WebInspector.Script.prototype.requestSource.didGetScriptSource): 18 (WebInspector.Script.prototype.requestSource): 19 1 20 2011-10-03 Pavel Feldman <pfeldman@google.com> 2 21 -
trunk/Source/WebCore/inspector/Inspector.json
r96499 r96576 1766 1766 }, 1767 1767 { 1768 "name": "searchInContent",1769 "parameters": [1770 { "name": "scriptId", "$ref": "ScriptId", "description": "Id of the script to search in." },1771 { "name": "query", "type": "string", "description": "String to search for." }1772 ],1773 "returns": [1774 { "name": "result", "type": "array", "items": { "$ref": "Page.SearchMatch" }, "description": "List of search matches." }1775 ],1776 "description": "Searches for given string in script content."1777 },1778 {1779 1768 "name": "setScriptSource", 1780 1769 "parameters": [ -
trunk/Source/WebCore/inspector/InspectorDebuggerAgent.cpp
r96491 r96576 32 32 33 33 #if ENABLE(JAVASCRIPT_DEBUGGER) && ENABLE(INSPECTOR) 34 #include "ContentSearchUtils.h"35 34 #include "InjectedScript.h" 36 35 #include "InjectedScriptManager.h" … … 322 321 } 323 322 324 void InspectorDebuggerAgent::searchInContent(ErrorString* error, const String& scriptId, const String& query, RefPtr<InspectorArray>* results)325 {326 ScriptsMap::iterator it = m_scripts.find(scriptId);327 if (it != m_scripts.end())328 *results = ContentSearchUtils::searchInTextByLines(query, it->second.source);329 else330 *error = "No script for id: " + scriptId;331 }332 333 323 void InspectorDebuggerAgent::setScriptSource(ErrorString* error, const String& scriptId, const String& newContent, const bool* const preview, RefPtr<InspectorArray>* newCallFrames, RefPtr<InspectorObject>* result) 334 324 { … … 343 333 } 344 334 345 void InspectorDebuggerAgent::getScriptSource(ErrorString* error, const String& scriptId, String* scriptSource) 346 { 347 ScriptsMap::iterator it = m_scripts.find(scriptId); 348 if (it != m_scripts.end()) 349 *scriptSource = it->second.source; 350 else 351 *error = "No script for id: " + scriptId; 335 void InspectorDebuggerAgent::getScriptSource(ErrorString*, const String& scriptId, String* scriptSource) 336 { 337 *scriptSource = m_scripts.get(scriptId).source; 352 338 } 353 339 -
trunk/Source/WebCore/inspector/InspectorDebuggerAgent.h
r96491 r96576 82 82 void continueToLocation(ErrorString*, PassRefPtr<InspectorObject> location); 83 83 84 void searchInContent(ErrorString*, const String& scriptId, const String& query, RefPtr<InspectorArray>*);85 84 void setScriptSource(ErrorString*, const String& scriptId, const String& newContent, const bool* const preview, RefPtr<InspectorArray>* newCallFrames, RefPtr<InspectorObject>* result); 86 85 void getScriptSource(ErrorString*, const String& scriptId, String* scriptSource); -
trunk/Source/WebCore/inspector/front-end/ContentProviders.js
r96575 r96576 47 47 } 48 48 this._script.requestSource(didRequestSource.bind(this)); 49 },50 51 searchInContent: function(query, callback)52 {53 this._script.searchInContent(query, callback);54 49 } 55 50 } … … 81 76 for (var i = 0; i < scripts.length; ++i) 82 77 scripts[i].requestSource(didRequestSource.bind(this)); 83 },84 85 searchInContent: function(query, callback)86 {87 var results = {};88 var scriptsLeft = this._scripts.length;89 90 function maybeCallback()91 {92 if (!scriptsLeft) {93 var result = [];94 for (var i = 0; i < this._scripts.length; ++i)95 result = result.concat(results[this._scripts[i].scriptId]);96 callback(result);97 }98 }99 100 function searchCallback(script, searchMatches)101 {102 results[script.scriptId] = [];103 for (var i = 0; i < searchMatches.length; ++i) {104 var searchMatch = {};105 searchMatch.lineNumber = searchMatches[i].lineNumber + script.lineOffset;106 searchMatch.lineContent = searchMatches[i].lineContent;107 results[script.scriptId].push(searchMatch);108 }109 scriptsLeft--;110 maybeCallback.call(this);111 }112 113 maybeCallback();114 for (var i = 0; i < this._scripts.length; ++i)115 this._scripts[i].searchInContent(query, searchCallback.bind(this, this._scripts[i]));116 78 }, 117 79 -
trunk/Source/WebCore/inspector/front-end/Script.js
r96491 r96576 50 50 function didGetScriptSource(error, source) 51 51 { 52 if (error)53 console.error(error);54 52 this._source = source; 55 53 callback(this._source); … … 58 56 }, 59 57 60 searchInContent: function(query, callback)61 {62 function innerCallback(error, searchMatches)63 {64 if (error)65 console.error(error);66 callback(searchMatches);67 }68 69 DebuggerAgent.searchInContent(this.scriptId, query, innerCallback.bind(this));70 },71 72 58 editSource: function(newSource, callback) 73 59 {
Note: See TracChangeset
for help on using the changeset viewer.