Changeset 79403 in webkit


Ignore:
Timestamp:
Feb 22, 2011 9:54:13 PM (13 years ago)
Author:
commit-queue@webkit.org
Message:

2011-02-22 Vsevolod Vlasov <vsevik@chromium.org>

Reviewed by Pavel Feldman.

DumpRenderTree should dump as text if test path contains "dumpAsText/"
https://bugs.webkit.org/show_bug.cgi?id=54873

  • DumpRenderTree/chromium/LayoutTestController.h: (LayoutTestController::setShouldDumpAsText): (LayoutTestController::setShouldGeneratePixelResults):
  • DumpRenderTree/chromium/TestShell.cpp: (TestShell::runFileTest):
  • DumpRenderTree/gtk/DumpRenderTree.cpp: (shouldDumpAsText): (dump): (runTest):
  • DumpRenderTree/mac/DumpRenderTree.mm: (shouldDumpAsText): (runTest):
  • DumpRenderTree/qt/DumpRenderTreeQt.cpp: (WebCore::isDumpAsTextTest): (WebCore::DumpRenderTree::open):
  • DumpRenderTree/win/DumpRenderTree.cpp: (shouldDumpAsText): (runTest):
  • WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp: (WTR::InjectedBundlePage::dump):
Location:
trunk/Tools
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r79387 r79403  
     12011-02-22  Vsevolod Vlasov  <vsevik@chromium.org>
     2
     3        Reviewed by Pavel Feldman.
     4
     5        DumpRenderTree should dump as text if test path contains "dumpAsText/"
     6        https://bugs.webkit.org/show_bug.cgi?id=54873
     7
     8        * DumpRenderTree/chromium/LayoutTestController.h:
     9        (LayoutTestController::setShouldDumpAsText):
     10        (LayoutTestController::setShouldGeneratePixelResults):
     11        * DumpRenderTree/chromium/TestShell.cpp:
     12        (TestShell::runFileTest):
     13        * DumpRenderTree/gtk/DumpRenderTree.cpp:
     14        (shouldDumpAsText):
     15        (dump):
     16        (runTest):
     17        * DumpRenderTree/mac/DumpRenderTree.mm:
     18        (shouldDumpAsText):
     19        (runTest):
     20        * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
     21        (WebCore::isDumpAsTextTest):
     22        (WebCore::DumpRenderTree::open):
     23        * DumpRenderTree/win/DumpRenderTree.cpp:
     24        (shouldDumpAsText):
     25        (runTest):
     26        * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
     27        (WTR::InjectedBundlePage::dump):
     28
    1292011-02-22  Kenneth Russell  <kbr@google.com>
    230
  • trunk/Tools/DumpRenderTree/chromium/LayoutTestController.h

    r78620 r79403  
    344344    WebKit::WebSpeechInputController* speechInputController(WebKit::WebSpeechInputListener*);
    345345    bool shouldDumpAsText() { return m_dumpAsText; }
     346    void setShouldDumpAsText(bool value) { m_dumpAsText = value; }
    346347    bool shouldDumpEditingCallbacks() { return m_dumpEditingCallbacks; }
    347348    bool shouldDumpFrameLoadCallbacks() { return m_dumpFrameLoadCallbacks; }
     
    359360    bool shouldDumpChildFramesAsText() { return m_dumpChildFramesAsText; }
    360361    bool shouldGeneratePixelResults() { return m_generatePixelResults; }
     362    void setShouldGeneratePixelResults(bool value) { m_generatePixelResults = value; }
    361363    bool acceptsEditing() { return m_acceptsEditing; }
    362364    bool canOpenWindows() { return m_canOpenWindows; }
  • trunk/Tools/DumpRenderTree/chromium/TestShell.cpp

    r78699 r79403  
    174174    string testUrl = m_params.testUrl.spec();
    175175
    176     bool inspectorTestMode = testUrl.find("/inspector/") != string::npos
    177         || testUrl.find("\\inspector\\") != string::npos;
    178 
    179     m_prefs.developerExtrasEnabled =  inspectorTestMode
    180         || testUrl.find("/inspector-enabled/") != string::npos
    181         || testUrl.find("\\inspector-enabled\\") != string::npos;
    182 
     176    m_prefs.developerExtrasEnabled = true;
    183177    applyPreferences();
    184178
     
    187181        m_layoutTestController->setShouldDumpFrameLoadCallbacks(true);
    188182
    189     if (inspectorTestMode)
     183    if (testUrl.find("/dumpAsText/") != string::npos
     184        || testUrl.find("\\dumpAsText\\") != string::npos) {
     185        m_layoutTestController->setShouldDumpAsText(true);
     186        m_layoutTestController->setShouldGeneratePixelResults(false);
     187    }
     188
     189    if (testUrl.find("/inspector/") != string::npos
     190        || testUrl.find("\\inspector\\") != string::npos)
    190191        showDevTools();
    191192
  • trunk/Tools/DumpRenderTree/gtk/DumpRenderTree.cpp

    r79329 r79403  
    104104{
    105105    return pathOrURL.find("inspector/") != string::npos;
     106}
     107
     108static bool shouldDumpAsText(const string& pathOrURL)
     109{
     110    return pathOrURL.find("dumpAsText/") != string::npos;
    106111}
    107112
     
    514519
    515520        if (g_str_equal(responseMimeType, "text/plain")) {
    516             gLayoutTestController->setDumpAsText(true);       
     521            gLayoutTestController->setDumpAsText(true);
    517522            gLayoutTestController->setGeneratePixelResults(false);
    518523        }
     
    640645        if (shouldOpenWebInspector(testURL))
    641646            gLayoutTestController->showWebInspector();
     647        if (shouldDumpAsText(testURL)) {
     648            gLayoutTestController->setDumpAsText(true);
     649            gLayoutTestController->setGeneratePixelResults(false);
     650        }
    642651    }
    643652
  • trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm

    r78947 r79403  
    997997}
    998998
     999static bool shouldDumpAsText(const char* pathOrURL)
     1000{
     1001    return strstr(pathOrURL, "dumpAsText/");
     1002}
     1003
    9991004static bool shouldEnableDeveloperExtras(const char* pathOrURL)
    10001005{
     
    10911096        if (shouldOpenWebInspector(pathOrURL.c_str()))
    10921097            gLayoutTestController->showWebInspector();
     1098        if (shouldDumpAsText(pathOrURL.c_str())) {
     1099            gLayoutTestController->setDumpAsText(true);
     1100            gLayoutTestController->setGeneratePixelResults(false);
     1101        }
    10931102    }
    10941103
  • trunk/Tools/DumpRenderTree/qt/DumpRenderTreeQt.cpp

    r78620 r79403  
    597597}
    598598
     599static bool isDumpAsTextTest(const QUrl& url)
     600{
     601    if (url.path().contains("dumpAsText/"))
     602        return true;
     603    return false;
     604}
     605
     606
    599607void DumpRenderTree::open(const QUrl& url)
    600608{
     
    607615    if (isWebInspectorTest(url))
    608616        layoutTestController()->showWebInspector();
     617
     618    if (isDumpAsTextTest(url)) {
     619        layoutTestController()->dumpAsText();
     620        setDumpPixels(false);
     621    }
    609622
    610623    if (isGlobalHistoryTest(url))
  • trunk/Tools/DumpRenderTree/win/DumpRenderTree.cpp

    r78620 r79403  
    764764}
    765765
     766static bool shouldDumpAsText(const char* pathOrURL)
     767{
     768    return strstr(pathOrURL, "/dumpAsText/") || strstr(pathOrURL, "\\dumpAsText\\");
     769}
     770
    766771static bool shouldEnableDeveloperExtras(const char* pathOrURL)
    767772{
     
    959964            gLayoutTestController->showWebInspector();
    960965    }
     966    if (shouldDumpAsText(pathOrURL.c_str())) {
     967        gLayoutTestController->setDumpAsText(true);
     968        gLayoutTestController->setGeneratePixelResults(false);
     969    }
    961970
    962971    prevTestBFItem = 0;
  • trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp

    r77908 r79403  
    494494    InjectedBundle::shared().layoutTestController()->invalidateWaitToDumpWatchdogTimer();
    495495
     496    WKBundleFrameRef frame = WKBundlePageGetMainFrame(m_page);
     497    string url = toSTD(adoptWK(WKURLCopyString(adoptWK(WKBundleFrameCopyURL(frame)).get())));
     498    if (strstr(url.c_str(), "dumpAsText/"))
     499        InjectedBundle::shared().layoutTestController()->dumpAsText();
     500
    496501    switch (InjectedBundle::shared().layoutTestController()->whatToDump()) {
    497502    case LayoutTestController::RenderTree: {
Note: See TracChangeset for help on using the changeset viewer.