Changeset 92963 in webkit
- Timestamp:
- Aug 12, 2011 8:15:16 AM (13 years ago)
- Location:
- trunk/Source/WebKit/qt
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/qt/ChangeLog
r92960 r92963 1 2011-08-12 Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org> 2 3 [Qt] Add test for correct order of load signals in QWebPage 4 https://bugs.webkit.org/show_bug.cgi?id=66016 5 6 Reviewed by Benjamin Poulain. 7 8 Add API test to ensure the order of load signals: loadStarted() needs to be emitted 9 first, then loadProgress(100), followed by loadFinished(). 10 11 The test is skipped since this right now is broken, the bug 12 https://bugs.webkit.org/show_bug.cgi?id=28851 tracks one possible way to fix. 13 14 * tests/qwebpage/tst_qwebpage.cpp: 15 (SpyForLoadSignalsOrder::SpyForLoadSignalsOrder): 16 (SpyForLoadSignalsOrder::isFinished): 17 (SpyForLoadSignalsOrder::onLoadProgress): 18 (tst_QWebPage::loadSignalsOrder_data): 19 (tst_QWebPage::loadSignalsOrder): 20 1 21 2011-08-12 Alexis Menard <alexis.menard@openbossa.org> 2 22 -
trunk/Source/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
r92182 r92963 29 29 #include <QMenu> 30 30 #include <QPushButton> 31 #include <QStateMachine> 31 32 #include <QStyle> 32 33 #include <QtTest/QtTest> … … 160 161 void deleteQWebViewTwice(); 161 162 void renderOnRepaintRequestedShouldNotRecurse(); 163 void loadSignalsOrder_data(); 164 void loadSignalsOrder(); 162 165 163 166 #ifdef Q_OS_MAC … … 3142 3145 } 3143 3146 3147 class SpyForLoadSignalsOrder : public QStateMachine { 3148 Q_OBJECT 3149 public: 3150 SpyForLoadSignalsOrder(QWebPage* page, QObject* parent = 0) 3151 : QStateMachine(parent) 3152 { 3153 connect(page, SIGNAL(loadProgress(int)), SLOT(onLoadProgress(int))); 3154 3155 QState* waitingForLoadStarted = new QState(this); 3156 QState* waitingForLastLoadProgress = new QState(this); 3157 QState* waitingForLoadFinished = new QState(this); 3158 QFinalState* final = new QFinalState(this); 3159 3160 waitingForLoadStarted->addTransition(page, SIGNAL(loadStarted()), waitingForLastLoadProgress); 3161 waitingForLastLoadProgress->addTransition(this, SIGNAL(lastLoadProgress()), waitingForLoadFinished); 3162 waitingForLoadFinished->addTransition(page, SIGNAL(loadFinished(bool)), final); 3163 3164 setInitialState(waitingForLoadStarted); 3165 start(); 3166 } 3167 bool isFinished() const 3168 { 3169 return !isRunning(); 3170 } 3171 public Q_SLOTS: 3172 void onLoadProgress(int progress) 3173 { 3174 if (progress == 100) 3175 emit lastLoadProgress(); 3176 } 3177 signals: 3178 void lastLoadProgress(); 3179 }; 3180 3181 void tst_QWebPage::loadSignalsOrder_data() 3182 { 3183 QTest::addColumn<QUrl>("url"); 3184 QTest::newRow("inline data") << QUrl("data:text/html,This is first page"); 3185 QTest::newRow("simple page") << QUrl("qrc:///resources/content.html"); 3186 QTest::newRow("frameset page") << QUrl("qrc:///resources/index.html"); 3187 } 3188 3189 void tst_QWebPage::loadSignalsOrder() 3190 { 3191 QSKIP("https://bugs.webkit.org/show_bug.cgi?id=28851", SkipAll); 3192 3193 QFETCH(QUrl, url); 3194 QWebPage page; 3195 SpyForLoadSignalsOrder loadSpy(&page); 3196 waitForSignal(&loadSpy, SIGNAL(started())); 3197 page.mainFrame()->load(url); 3198 QTRY_VERIFY(loadSpy.isFinished()); 3199 } 3200 3144 3201 QTEST_MAIN(tst_QWebPage) 3145 3202 #include "tst_qwebpage.moc"
Note: See TracChangeset
for help on using the changeset viewer.