Commit df4a2f37 authored by eric@webkit.org's avatar eric@webkit.org

2009-03-27 Benjamin C Meyer <benjamin.meyer@torchmobile.com>

        Reviewed by Simon Hausmann.

        Update the page actions when a finishing loading even if the frame is
        not the top frame such as when browsing inside of a website with frames.
        https://bugs.webkit.org/show_bug.cgi?id=24890

        * WebCoreSupport/FrameLoaderClientQt.cpp:
        (WebCore::FrameLoaderClientQt::dispatchDidFinishLoad):
        * tests/qwebpage/frametest/frame_a.html: Added.
        * tests/qwebpage/frametest/index.html: Added.
        * tests/qwebpage/tst_qwebpage.cpp:
        (tst_QWebPage::backActionUpdate):

git-svn-id: svn://svn.chromium.org/blink/trunk@43015 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 6e82feb0
2009-03-27 Benjamin C Meyer <benjamin.meyer@torchmobile.com>
Reviewed by Simon Hausmann.
Update the page actions when a finishing loading even if the frame is
not the top frame such as when browsing inside of a website with frames.
https://bugs.webkit.org/show_bug.cgi?id=24890
* WebCoreSupport/FrameLoaderClientQt.cpp:
(WebCore::FrameLoaderClientQt::dispatchDidFinishLoad):
* tests/qwebpage/frametest/frame_a.html: Added.
* tests/qwebpage/frametest/index.html: Added.
* tests/qwebpage/tst_qwebpage.cpp:
(tst_QWebPage::backActionUpdate):
2009-04-29 Ariya Hidayat <ariya.hidayat@nokia.com> 2009-04-29 Ariya Hidayat <ariya.hidayat@nokia.com>
Reviewed by Simon Hausmann. Reviewed by Simon Hausmann.
......
...@@ -387,7 +387,7 @@ void FrameLoaderClientQt::dispatchDidFinishLoad() ...@@ -387,7 +387,7 @@ void FrameLoaderClientQt::dispatchDidFinishLoad()
m_loadSucceeded = true; m_loadSucceeded = true;
if (m_frame->tree()->parent() || !m_webFrame) if (!m_webFrame)
return; return;
m_webFrame->page()->d->updateNavigationActions(); m_webFrame->page()->d->updateNavigationActions();
} }
......
<a href="http://google.com" target="frame_b"><img src="" width=100 height=100 alt="Google"></a>
<a href="http://yahoo.com" target="frame_b"><img src="" width=100 height=100 alt="Yahoo"></a>
<frameset cols="25%,75%">
<frame src="frame_a.html" name="frame_a">
<frame src="frame_b.html" name="frame_b">
</frameset>
...@@ -2,5 +2,6 @@ TEMPLATE = app ...@@ -2,5 +2,6 @@ TEMPLATE = app
TARGET = tst_qwebpage TARGET = tst_qwebpage
include(../../../../WebKit.pri) include(../../../../WebKit.pri)
SOURCES += tst_qwebpage.cpp SOURCES += tst_qwebpage.cpp
RESOURCES += tst_qwebpage.qrc
QT += testlib network QT += testlib network
QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR
...@@ -105,6 +105,7 @@ private slots: ...@@ -105,6 +105,7 @@ private slots:
void cursorMovements(); void cursorMovements();
void textSelection(); void textSelection();
void textEditing(); void textEditing();
void backActionUpdate();
void requestCache(); void requestCache();
...@@ -1098,5 +1099,22 @@ void tst_QWebPage::requestCache() ...@@ -1098,5 +1099,22 @@ void tst_QWebPage::requestCache()
(int)QNetworkRequest::PreferCache); (int)QNetworkRequest::PreferCache);
} }
void tst_QWebPage::backActionUpdate()
{
QWebView view;
QWebPage *page = view.page();
QAction *action = page->action(QWebPage::Back);
QVERIFY(!action->isEnabled());
QSignalSpy loadSpy(page, SIGNAL(loadFinished(bool)));
QUrl url = QUrl("qrc:///frametest/index.html");
page->mainFrame()->load(url);
QTRY_COMPARE(loadSpy.count(), 1);
QVERIFY(!action->isEnabled());
QTest::mouseClick(&view, Qt::LeftButton, 0, QPoint(10, 10));
QTRY_COMPARE(loadSpy.count(), 2);
QVERIFY(action->isEnabled());
}
QTEST_MAIN(tst_QWebPage) QTEST_MAIN(tst_QWebPage)
#include "tst_qwebpage.moc" #include "tst_qwebpage.moc"
<!DOCTYPE RCC><RCC version="1.0">
<qresource>
<file>frametest/index.html</file>
<file>frametest/frame_a.html</file>
</qresource>
</RCC>
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