Changeset 96576 in webkit


Ignore:
Timestamp:
Oct 4, 2011 2:03:51 AM (12 years ago)
Author:
commit-queue@webkit.org
Message:

Unreviewed, rolling out r96491.
http://trac.webkit.org/changeset/96491
https://bugs.webkit.org/show_bug.cgi?id=69326

Breaks Slow Leopard inspector tests (Requested by pfeldman on
#webkit).

Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2011-10-04

Source/WebCore:

  • inspector/Inspector.json:
  • inspector/InspectorDebuggerAgent.cpp:

(WebCore::InspectorDebuggerAgent::getScriptSource):

  • inspector/InspectorDebuggerAgent.h:
  • inspector/front-end/ContentProviders.js:

(WebInspector.ScriptContentProvider.prototype.requestContent):

  • inspector/front-end/Script.js:

(WebInspector.Script.prototype.requestSource.didGetScriptSource):
(WebInspector.Script.prototype.requestSource):

LayoutTests:

  • http/tests/inspector/resource-tree/resource-tree-test.js:

(initialize_ResourceTreeTest.InspectorTest.runAfterResourcesAreFinished):
(initialize_ResourceTreeTest.InspectorTest._runAfterResourcesAreFinished):
(initialize_ResourceTreeTest):

  • http/tests/inspector/resources-test.js:

(initialize_ResourceTest):

  • http/tests/inspector/search/resources/search-concatenated.html: Removed.
  • http/tests/inspector/search/search-in-concatenated-script-expected.txt: Removed.
  • http/tests/inspector/search/search-in-concatenated-script.html: Removed.
  • http/tests/inspector/search/search-in-resource.html:
  • http/tests/inspector/search/search-in-script-expected.txt: Removed.
  • http/tests/inspector/search/search-in-script.html: Removed.
  • http/tests/inspector/search/search-test.js:

(initialize_SearchTest.InspectorTest.runAfterResourcesAreCreated):
(initialize_SearchTest.InspectorTest._runAfterResourcesAreCreated):
(initialize_SearchTest.InspectorTest._runAfterResourcesAreCreated.maybeCallback):
(initialize_SearchTest.InspectorTest._runAfterResourcesAreCreated.addSniffer):
(initialize_SearchTest.InspectorTest._runAfterResourcesAreCreated.onResourceBind):
(initialize_SearchTest.InspectorTest._runAfterResourcesAreCreated.visit):
(initialize_SearchTest):

Location:
trunk
Files:
5 deleted
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r96574 r96576  
     12011-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
    1312011-10-04  Ryosuke Niwa  <rniwa@webkit.org>
    232
  • trunk/LayoutTests/http/tests/inspector/resource-tree/resource-tree-test.js

    r96491 r96576  
    8787}
    8888
     89InspectorTest.runAfterResourcesAreFinished = function(resourceURLs, callback)
     90{
     91    InspectorTest._runAfterResourcesAreFinished(resourceURLs.keySet(), callback);
     92}
     93
     94InspectorTest._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
    89117};
  • trunk/LayoutTests/http/tests/inspector/resources-test.js

    r96491 r96576  
    2828}
    2929
    30 InspectorTest.runAfterResourcesAreFinished = function(resourceURLs, callback)
    31 {
    32     InspectorTest._runAfterResourcesAreFinished(resourceURLs.keySet(), callback);
    3330}
    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  
    22<head>
    33<script src="../inspector-test.js"></script>
    4 <script src="../resources-test.js"></script>
    54<script src="search-test.js"></script>
    65<script>
     
    98    // This file should not match search query.
    109    var text = "searchTest" + "UniqueString";
    11     InspectorTest.runAfterResourcesAreFinished(["search.js"], step2);
     10    InspectorTest.runAfterResourcesAreCreated(["search.js"], step2);
    1211
    1312    function step2()
  • trunk/LayoutTests/http/tests/inspector/search/search-test.js

    r96491 r96576  
    1717};
    1818
     19InspectorTest.runAfterResourcesAreCreated = function(resourceURLs, callback)
     20{
     21    InspectorTest._runAfterResourcesAreCreated(resourceURLs.keySet(), callback);
     22}
     23
     24InspectorTest._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
    1965};
  • trunk/Source/WebCore/ChangeLog

    r96575 r96576  
     12011-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
    1202011-10-03  Pavel Feldman  <pfeldman@google.com>
    221
  • trunk/Source/WebCore/inspector/Inspector.json

    r96499 r96576  
    17661766            },
    17671767            {
    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             {
    17791768                "name": "setScriptSource",
    17801769                "parameters": [
  • trunk/Source/WebCore/inspector/InspectorDebuggerAgent.cpp

    r96491 r96576  
    3232
    3333#if ENABLE(JAVASCRIPT_DEBUGGER) && ENABLE(INSPECTOR)
    34 #include "ContentSearchUtils.h"
    3534#include "InjectedScript.h"
    3635#include "InjectedScriptManager.h"
     
    322321}
    323322
    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     else
    330         *error = "No script for id: " + scriptId;
    331 }
    332 
    333323void InspectorDebuggerAgent::setScriptSource(ErrorString* error, const String& scriptId, const String& newContent, const bool* const preview, RefPtr<InspectorArray>* newCallFrames, RefPtr<InspectorObject>* result)
    334324{
     
    343333}
    344334
    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;
     335void InspectorDebuggerAgent::getScriptSource(ErrorString*, const String& scriptId, String* scriptSource)
     336{
     337    *scriptSource = m_scripts.get(scriptId).source;
    352338}
    353339
  • trunk/Source/WebCore/inspector/InspectorDebuggerAgent.h

    r96491 r96576  
    8282    void continueToLocation(ErrorString*, PassRefPtr<InspectorObject> location);
    8383
    84     void searchInContent(ErrorString*, const String& scriptId, const String& query, RefPtr<InspectorArray>*);
    8584    void setScriptSource(ErrorString*, const String& scriptId, const String& newContent, const bool* const preview, RefPtr<InspectorArray>* newCallFrames, RefPtr<InspectorObject>* result);
    8685    void getScriptSource(ErrorString*, const String& scriptId, String* scriptSource);
  • trunk/Source/WebCore/inspector/front-end/ContentProviders.js

    r96575 r96576  
    4747        }
    4848        this._script.requestSource(didRequestSource.bind(this));
    49     },
    50 
    51     searchInContent: function(query, callback)
    52     {
    53         this._script.searchInContent(query, callback);
    5449    }
    5550}
     
    8176       for (var i = 0; i < scripts.length; ++i)
    8277           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]));
    11678   },
    11779
  • trunk/Source/WebCore/inspector/front-end/Script.js

    r96491 r96576  
    5050        function didGetScriptSource(error, source)
    5151        {
    52             if (error)
    53                 console.error(error);
    5452            this._source = source;
    5553            callback(this._source);
     
    5856    },
    5957
    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    
    7258    editSource: function(newSource, callback)
    7359    {
Note: See TracChangeset for help on using the changeset viewer.