Commit 2fd9b576 authored by kenneth@webkit.org's avatar kenneth@webkit.org

WebKitTools: Implement the Qt version of DRT dumpBackForwardList().

Patch by Kenneth Rohde Christiansen <kenneth@webkit.org> on 2009-10-29
Reviewed by Oliver Hunt.

* DumpRenderTree/qt/DumpRenderTree.cpp:
(WebCore::dumpHistoryItem):
(WebCore::DumpRenderTree::dumpBackForwardList):

LayoutTests: Removed test that passes after implementing the Qt DRT version
of dumpBackForwardList().

Patch by Kenneth Rohde Christiansen <kenneth@webkit.org> on 2009-10-29
Reviewed by Oliver Hunt.

* platform/qt/Skipped:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@50307 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent ea49f92f
......@@ -30,6 +30,15 @@
* platform/mac/fast/text/script-tests/TEMPLATE.html: Copied from LayoutTests/fast/js/script-tests/TEMPLATE.html.
* platform/mac/fast/text/script-tests/ligature-subdivision.js: Added.
2009-10-29 Kenneth Rohde Christiansen <kenneth@webkit.org>
Reviewed by Oliver Hunt.
Removed test that passes after implementing the Qt DRT version
of dumpBackForwardList().
* platform/qt/Skipped:
2009-10-29 Kenneth Rohde Christiansen <kenneth@webkit.org>
Rubberstamped by Adam Roben.
......@@ -130,9 +130,6 @@ fast/events/pageshow-pagehide-on-back-cached-with-frames.html
# layoutTestController.waitForPolicyDelegate() does not report the origin node
fast/encoding/mailto-always-utf-8.html
# Missing layoutTestController.dumpBackForwardList()
fast/loader/fragment-after-redirect-gets-back-entry.html
# Missing layoutTestController.setAlwaysAcceptCookies()
http/tests/xmlhttprequest/access-control-basic-allow-preflight-cache-timeout.html
......
......@@ -10,6 +10,16 @@
(runTest):
(webViewLoadFinished):
2009-10-29 Kenneth Rohde Christiansen <kenneth@webkit.org>
Reviewed by Oliver Hunt.
Implement the Qt version of DRT dumpBackForwardList().
* DumpRenderTree/qt/DumpRenderTree.cpp:
(WebCore::dumpHistoryItem):
(WebCore::DumpRenderTree::dumpBackForwardList):
2009-10-29 Kenneth Rohde Christiansen <kenneth@webkit.org>
Reviewed by Adam Roben.
......
......@@ -419,11 +419,67 @@ QString DumpRenderTree::dumpFramesAsText(QWebFrame* frame)
return result;
}
static QString dumpHistoryItem(const QWebHistoryItem& item, int indent, bool current)
{
QString result;
int start = 0;
if (current) {
result.append(QLatin1String("curr->"));
start = 6;
}
for (int i = start; i < indent; i++)
result.append(' ');
QString url = item.url().toString();
if (url.contains("file://")) {
static QString layoutTestsString("/LayoutTests/");
static QString fileTestString("(file test):");
QString res = url.mid(url.indexOf(layoutTestsString) + layoutTestsString.length());
if (res.isEmpty())
return result;
result.append(fileTestString);
result.append(res);
// FIXME: Wrong, need (private?) API for determining this.
result.append(QLatin1String(" **nav target**"));
}
result.append(QLatin1String("\n"));
return result;
}
QString DumpRenderTree::dumpBackForwardList()
{
QWebHistory* history = webPage()->history();
QString result;
result.append(QLatin1String("\n============== Back Forward List ==============\n"));
result.append(QLatin1String("FIXME: Unimplemented!\n"));
// FORMAT:
// " (file test):fast/loader/resources/click-fragment-link.html **nav target**"
// "curr-> (file test):fast/loader/resources/click-fragment-link.html#testfragment **nav target**"
int maxItems = history->maximumItemCount();
foreach (const QWebHistoryItem item, history->backItems(maxItems)) {
if (!item.isValid())
continue;
result.append(dumpHistoryItem(item, 8, false));
}
QWebHistoryItem item = history->currentItem();
if (item.isValid())
result.append(dumpHistoryItem(item, 8, true));
foreach (const QWebHistoryItem item, history->forwardItems(maxItems)) {
if (!item.isValid())
continue;
result.append(dumpHistoryItem(item, 8, false));
}
result.append(QLatin1String("===============================================\n"));
return result;
}
......
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