2011-03-14 Daniel Sievers <sievers@google.com>

        Reviewed by Simon Fraser.

        [Chromium] Make RenderAsTextBehavior and LayerTreeAsTextBehavior tweakable from the DumpRenderTree commandline
        https://bugs.webkit.org/show_bug.cgi?id=56139

        * WebCore.exp.in:
        * WebCore.order:
        * page/Frame.cpp:
        (WebCore::Frame::layerTreeAsText):
        * page/Frame.h:
        * rendering/RenderLayerCompositor.cpp:
        (WebCore::RenderLayerCompositor::layerTreeAsText):
        * rendering/RenderLayerCompositor.h:
2011-03-14  Daniel Sievers  <sievers@google.com>

        Reviewed by Simon Fraser.

        [Chromium] Make RenderAsTextBehavior and LayerTreeAsTextBehavior tweakable from the DumpRenderTree commandline
        https://bugs.webkit.org/show_bug.cgi?id=56139

        * public/WebFrame.h:
        * src/WebFrameImpl.cpp:
        (WebKit::WebFrameImpl::renderTreeAsText):
        (WebKit::WebFrameImpl::layerTreeAsText):
        * src/WebFrameImpl.h:
2011-03-14  Daniel Sievers  <sievers@google.com>

        Reviewed by Simon Fraser.

        [Chromium] Make RenderAsTextBehavior and LayerTreeAsTextBehavior tweakable from the DumpRenderTree commandline
        https://bugs.webkit.org/show_bug.cgi?id=56139

        * DumpRenderTree/chromium/DumpRenderTree.cpp:
        (main):
        * DumpRenderTree/chromium/LayoutTestController.cpp:
        (LayoutTestController::LayoutTestController):
        (LayoutTestController::layerTreeAsText):
        * DumpRenderTree/chromium/LayoutTestController.h:
        (LayoutTestController::setShowDebugLayerTree):
        * DumpRenderTree/chromium/TestShell.cpp:
        (TestShell::runFileTest):
        (TestShell::dump):
        * DumpRenderTree/chromium/TestShell.h:
        (TestParams::TestParams):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@81094 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 676594a7
2011-03-14 Daniel Sievers <sievers@google.com>
Reviewed by Simon Fraser.
[Chromium] Make RenderAsTextBehavior and LayerTreeAsTextBehavior tweakable from the DumpRenderTree commandline
https://bugs.webkit.org/show_bug.cgi?id=56139
* WebCore.exp.in:
* WebCore.order:
* page/Frame.cpp:
(WebCore::Frame::layerTreeAsText):
* page/Frame.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::layerTreeAsText):
* rendering/RenderLayerCompositor.h:
2011-03-14 Adam Barth <abarth@webkit.org>
Reviewed by Dimitri Glazkov.
......
......@@ -1179,7 +1179,7 @@ __ZNK7WebCore5Color7getRGBAERdS1_S1_S1_
__ZNK7WebCore5Frame13ownerRendererEv
__ZNK7WebCore5Frame14selectionImageEb
__ZNK7WebCore5Frame15contentRendererEv
__ZNK7WebCore5Frame15layerTreeAsTextEv
__ZNK7WebCore5Frame15layerTreeAsTextEb
__ZNK7WebCore5Frame18documentTypeStringEv
__ZNK7WebCore5Frame8settingsEv
__ZNK7WebCore5Frame9domWindowEv
......
......@@ -906,7 +906,7 @@ Color Frame::tiledBackingStoreBackgroundColor() const
}
#endif
String Frame::layerTreeAsText() const
String Frame::layerTreeAsText(bool showDebugInfo) const
{
#if USE(ACCELERATED_COMPOSITING)
document()->updateLayout();
......@@ -914,7 +914,7 @@ String Frame::layerTreeAsText() const
if (!contentRenderer())
return String();
return contentRenderer()->compositor()->layerTreeAsText();
return contentRenderer()->compositor()->layerTreeAsText(showDebugInfo);
#else
return String();
#endif
......
......@@ -127,7 +127,7 @@ namespace WebCore {
void injectUserScripts(UserScriptInjectionTime);
String layerTreeAsText() const;
String layerTreeAsText(bool showDebugInfo = false) const;
// Unlike most accessors in this class, domWindow() always creates a new DOMWindow if m_domWindow is null.
// Callers that don't need a new DOMWindow to be created should use existingDOMWindow().
......
......@@ -880,7 +880,7 @@ void RenderLayerCompositor::frameViewDidScroll(const IntPoint& scrollPosition)
m_scrollLayer->setPosition(FloatPoint(-scrollPosition.x(), -scrollPosition.y()));
}
String RenderLayerCompositor::layerTreeAsText()
String RenderLayerCompositor::layerTreeAsText(bool showDebugInfo)
{
if (compositingLayerUpdatePending())
updateCompositingLayers();
......@@ -890,7 +890,7 @@ String RenderLayerCompositor::layerTreeAsText()
// We skip dumping the scroll and clip layers to keep layerTreeAsText output
// similar between platforms.
return m_rootPlatformLayer->layerTreeAsText();
return m_rootPlatformLayer->layerTreeAsText(showDebugInfo ? LayerTreeAsTextDebug : LayerTreeAsTextBehaviorNormal);
}
RenderLayerCompositor* RenderLayerCompositor::iframeContentsCompositor(RenderIFrame* renderer)
......
......@@ -175,7 +175,7 @@ public:
void frameViewDidChangeSize(const IntPoint& contentsOffset = IntPoint());
void frameViewDidScroll(const IntPoint& = IntPoint());
String layerTreeAsText();
String layerTreeAsText(bool showDebugInfo = false);
// These are named to avoid conflicts with the functions in GraphicsLayerClient
// These return the actual internal variables.
......
2011-03-14 Daniel Sievers <sievers@google.com>
Reviewed by Simon Fraser.
[Chromium] Make RenderAsTextBehavior and LayerTreeAsTextBehavior tweakable from the DumpRenderTree commandline
https://bugs.webkit.org/show_bug.cgi?id=56139
* public/WebFrame.h:
* src/WebFrameImpl.cpp:
(WebKit::WebFrameImpl::renderTreeAsText):
(WebKit::WebFrameImpl::layerTreeAsText):
* src/WebFrameImpl.h:
2011-03-14 John Knottenbelt <jknotten@chromium.org>
Reviewed by Steve Block.
......
......@@ -549,7 +549,7 @@ public:
// Returns a text representation of the render tree. This method is used
// to support layout tests.
virtual WebString renderTreeAsText() const = 0;
virtual WebString renderTreeAsText(bool showDebugInfo = false) const = 0;
// Returns the counter value for the specified element. This method is
// used to support layout tests.
......@@ -582,7 +582,7 @@ public:
// Dumps the layer tree, used by the accelerated compositor, in
// text form. This is used only by layout tests.
virtual WebString layerTreeAsText() const = 0;
virtual WebString layerTreeAsText(bool showDebugInfo = false) const = 0;
protected:
~WebFrame() { }
......
......@@ -1742,9 +1742,18 @@ WebString WebFrameImpl::contentAsMarkup() const
return createFullMarkup(m_frame->document());
}
WebString WebFrameImpl::renderTreeAsText() const
WebString WebFrameImpl::renderTreeAsText(bool showDebugInfo) const
{
return externalRepresentation(m_frame);
RenderAsTextBehavior behavior = RenderAsTextBehaviorNormal;
if (showDebugInfo) {
behavior |= RenderAsTextShowCompositedLayers
| RenderAsTextShowAddresses
| RenderAsTextShowIDAndClass
| RenderAsTextShowLayerNesting;
}
return externalRepresentation(m_frame, behavior);
}
WebString WebFrameImpl::counterValueForElementById(const WebString& id) const
......@@ -1814,11 +1823,11 @@ bool WebFrameImpl::pauseSVGAnimation(const WebString& animationId, double time,
#endif
}
WebString WebFrameImpl::layerTreeAsText() const
WebString WebFrameImpl::layerTreeAsText(bool showDebugInfo) const
{
if (!m_frame)
return WebString();
return WebString(m_frame->layerTreeAsText());
return WebString(m_frame->layerTreeAsText(showDebugInfo));
}
// WebFrameImpl public ---------------------------------------------------------
......
......@@ -187,7 +187,7 @@ public:
virtual WebString contentAsText(size_t maxChars) const;
virtual WebString contentAsMarkup() const;
virtual WebString renderTreeAsText() const;
virtual WebString renderTreeAsText(bool showDebugInfo = false) const;
virtual WebString counterValueForElementById(const WebString& id) const;
virtual WebString markerTextForListItem(const WebElement&) const;
virtual int pageNumberForElementById(const WebString& id,
......@@ -199,7 +199,7 @@ public:
virtual bool pauseSVGAnimation(const WebString& animationId,
double time,
const WebString& elementId);
virtual WebString layerTreeAsText() const;
virtual WebString layerTreeAsText(bool showDebugInfo = false) const;
static PassRefPtr<WebFrameImpl> create(WebFrameClient* client);
~WebFrameImpl();
......
2011-03-14 Daniel Sievers <sievers@google.com>
Reviewed by Simon Fraser.
[Chromium] Make RenderAsTextBehavior and LayerTreeAsTextBehavior tweakable from the DumpRenderTree commandline
https://bugs.webkit.org/show_bug.cgi?id=56139
* DumpRenderTree/chromium/DumpRenderTree.cpp:
(main):
* DumpRenderTree/chromium/LayoutTestController.cpp:
(LayoutTestController::LayoutTestController):
(LayoutTestController::layerTreeAsText):
* DumpRenderTree/chromium/LayoutTestController.h:
(LayoutTestController::setShowDebugLayerTree):
* DumpRenderTree/chromium/TestShell.cpp:
(TestShell::runFileTest):
(TestShell::dump):
* DumpRenderTree/chromium/TestShell.h:
(TestParams::TestParams):
2011-03-14 Balazs Kelemen <kbalazs@webkit.org>
Reviewed by Adam Roben.
......
......@@ -43,7 +43,8 @@ static const char optionDumpAllPixels[] = "--dump-all-pixels";
static const char optionNotree[] = "--notree";
static const char optionPixelTests[] = "--pixel-tests";
static const char optionThreaded[] = "--threaded";
static const char optionTree[] = "--tree";
static const char optionDebugRenderTree[] = "--debug-render-tree";
static const char optionDebugLayerTree[] = "--debug-layer-tree";
static const char optionPixelTestsWithName[] = "--pixel-tests=";
static const char optionTestShell[] = "--test-shell";
......@@ -148,7 +149,11 @@ int main(int argc, char* argv[])
else if (!argument.find(optionPixelTestsWithName)) {
params.dumpPixels = true;
params.pixelFileName = argument.substr(strlen(optionPixelTestsWithName));
} else if (argument == optionTestShell) {
} else if (argument == optionDebugRenderTree)
params.debugRenderTree = true;
else if (argument == optionDebugLayerTree)
params.debugLayerTree = true;
else if (argument == optionTestShell) {
testShellMode = true;
serverMode = true;
} else if (argument == optionAllowExternalPages)
......
......@@ -73,6 +73,7 @@ LayoutTestController::LayoutTestController(TestShell* shell)
: m_shell(shell)
, m_closeRemainingWindows(false)
, m_deferMainResourceDataLoad(false)
, m_showDebugLayerTree(false)
, m_workQueue(this)
{
......@@ -1593,7 +1594,7 @@ void LayoutTestController::addMockSpeechInputResult(const CppArgumentList& argum
void LayoutTestController::layerTreeAsText(const CppArgumentList& args, CppVariant* result)
{
result->set(m_shell->webView()->mainFrame()->layerTreeAsText().utf8());
result->set(m_shell->webView()->mainFrame()->layerTreeAsText(m_showDebugLayerTree).utf8());
}
void LayoutTestController::markerTextForListItem(const CppArgumentList& args, CppVariant* result)
......
......@@ -378,6 +378,7 @@ public:
bool shouldAddFileToPasteboard() { return m_shouldAddFileToPasteboard; }
bool stopProvisionalFrameLoads() { return m_stopProvisionalFrameLoads; }
bool deferMainResourceDataLoad() { return m_deferMainResourceDataLoad; }
void setShowDebugLayerTree(bool value) { m_showDebugLayerTree = value; }
bool testRepaint() const { return m_testRepaint; }
bool sweepHorizontally() const { return m_sweepHorizontally; }
......@@ -551,6 +552,9 @@ private:
// If false, all new requests will not defer the main resource data load.
bool m_deferMainResourceDataLoad;
// If true, we will show extended information in the graphics layer tree.
bool m_showDebugLayerTree;
WorkQueue m_workQueue;
CppVariant m_globalFlag;
......
......@@ -188,6 +188,9 @@ void TestShell::runFileTest(const TestParams& params)
|| testUrl.find("\\inspector\\") != string::npos)
showDevTools();
if (m_params.debugLayerTree)
m_layoutTestController->setShowDebugLayerTree(true);
if (m_dumpWhenFinished)
m_printer->handleTestHeader(testUrl.c_str());
loadURL(m_params.testUrl);
......@@ -454,7 +457,7 @@ void TestShell::dump()
if (fwrite(dataUtf8.c_str(), 1, dataUtf8.size(), stdout) != dataUtf8.size())
FATAL("Short write to stdout, disk full?\n");
} else {
printf("%s", frame->renderTreeAsText().utf8().data());
printf("%s", frame->renderTreeAsText(m_params.debugRenderTree).utf8().data());
bool recursive = m_layoutTestController->shouldDumpChildFrameScrollPositions();
dumpFrameScrollPosition(frame, recursive);
}
......
......@@ -65,6 +65,8 @@ class DRTDevToolsClient;
struct TestParams {
bool dumpTree;
bool dumpPixels;
bool debugRenderTree;
bool debugLayerTree;
bool printSeparators;
WebKit::WebURL testUrl;
// Resultant image file name. Required only if the test_shell mode.
......@@ -74,6 +76,8 @@ struct TestParams {
TestParams()
: dumpTree(true)
, dumpPixels(false)
, debugRenderTree(false)
, debugLayerTree(false)
, printSeparators(false) {}
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment