Changeset 139332 in webkit


Ignore:
Timestamp:
Jan 10, 2013 10:25:39 AM (11 years ago)
Author:
commit-queue@webkit.org
Message:

Web Inspector: Refactor InspectorTest to create output interface
https://bugs.webkit.org/show_bug.cgi?id=106231

Patch by John J. Barton <johnjbarton@chromium.org> on 2013-01-10
Reviewed by Pavel Feldman.

Refactor InspectorTest to extract InspectorTest.Output, the API
used between InspectorTest and the test output reciever (the
test-script page by default).

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

(initialize_InspectorTest.InspectorTest.Output.testComplete):
(initialize_InspectorTest.InspectorTest.Output.addResult):
(initialize_InspectorTest.InspectorTest.Output.clearResults):
(initialize_InspectorTest.InspectorTest.completeTest):
(initialize_InspectorTest.InspectorTest.addResult):

Location:
trunk/LayoutTests
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r139330 r139332  
     12013-01-10  John J. Barton  <johnjbarton@chromium.org>
     2
     3        Web Inspector: Refactor InspectorTest to create output interface
     4        https://bugs.webkit.org/show_bug.cgi?id=106231
     5
     6        Reviewed by Pavel Feldman.
     7
     8        Refactor InspectorTest to extract InspectorTest.Output, the API
     9        used between InspectorTest and the test output reciever (the
     10        test-script page by default).
     11
     12        * http/tests/inspector/inspector-test.js:
     13        (initialize_InspectorTest.InspectorTest.Output.testComplete):
     14        (initialize_InspectorTest.InspectorTest.Output.addResult):
     15        (initialize_InspectorTest.InspectorTest.Output.clearResults):
     16        (initialize_InspectorTest.InspectorTest.completeTest):
     17        (initialize_InspectorTest.InspectorTest.addResult):
     18
    1192013-01-10  Max Vujovic  <mvujovic@adobe.com>
    220
  • trunk/LayoutTests/http/tests/inspector/inspector-test.js

    r136949 r139332  
    1212console.error = consoleOutputHook.bind(InspectorTest, "error");
    1313console.info = consoleOutputHook.bind(InspectorTest, "info");
     14
     15InspectorTest.Output = {   // override in window.initialize_yourName
     16    testComplete: function()
     17    {
     18        RuntimeAgent.evaluate("didEvaluateForTestInFrontend(" + InspectorTest.completeTestCallId + ", \"\")", "test");
     19    },
     20
     21    addResult: function(text)
     22    {
     23        InspectorTest.evaluateInPage("output(unescape('" + escape(text) + "'))");
     24    },
     25   
     26    clearResults: function()
     27    {
     28        InspectorTest.evaluateInPage("clearOutput()");
     29    }
     30};
    1431
    1532InspectorTest.completeTest = function()
     
    2138            return;
    2239        }
    23         RuntimeAgent.evaluate("didEvaluateForTestInFrontend(" + InspectorTest.completeTestCallId + ", \"\")", "test");
     40        InspectorTest.Output.testComplete();
    2441    }
    2542    testDispatchQueueIsEmpty();
     
    7491    results.push(text);
    7592    if (resultsSynchronized)
    76         addResultToPage(text);
     93        InspectorTest.Output.addResult(text);
    7794    else {
    78         clearResults();
     95        InspectorTest.Output.clearResults();
    7996        for (var i = 0; i < results.length; ++i)
    80             addResultToPage(results[i]);
     97            InspectorTest.Output.addResult(results[i]);
    8198        resultsSynchronized = true;
    82     }
    83 
    84     function clearResults()
    85     {
    86         InspectorTest.evaluateInPage("clearOutput()");
    87     }
    88 
    89     function addResultToPage(text)
    90     {
    91         InspectorTest.evaluateInPage("output(unescape('" + escape(text) + "'))");
    9299    }
    93100}
Note: See TracChangeset for help on using the changeset viewer.