Changeset 91302 in webkit
- Timestamp:
- Jul 19, 2011 2:31:17 PM (13 years ago)
- Location:
- trunk/Source/WebKit/qt
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/qt/ChangeLog
r91193 r91302 1 2011-07-19 Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org> 2 3 [Qt] Fix leak of QWebPage in errorPageExtension tests 4 https://bugs.webkit.org/show_bug.cgi?id=64814 5 6 Reviewed by Noam Rosenthal. 7 8 QWebView::setPage() doesn't take ownership, so the ErrorPages were leaking. So now 9 allocate them on the stack. This shouldn't change any behavior. 10 11 * tests/qwebpage/tst_qwebpage.cpp: 12 (tst_QWebPage::errorPageExtension): 13 (tst_QWebPage::errorPageExtensionInIFrames): 14 (tst_QWebPage::errorPageExtensionInFrameset): 15 1 16 2011-07-18 Hui Huang <hui.2.huang@nokia.com> 2 17 -
trunk/Source/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
r90341 r91302 2512 2512 void tst_QWebPage::errorPageExtension() 2513 2513 { 2514 ErrorPage * page = new ErrorPage;2515 m_view->setPage( page);2514 ErrorPage page; 2515 m_view->setPage(&page); 2516 2516 2517 2517 QSignalSpy spyLoadFinished(m_view, SIGNAL(loadFinished(bool))); … … 2520 2520 QTRY_COMPARE(spyLoadFinished.count(), 1); 2521 2521 2522 page ->mainFrame()->setUrl(QUrl("http://non.existent/url"));2522 page.mainFrame()->setUrl(QUrl("http://non.existent/url")); 2523 2523 QTRY_COMPARE(spyLoadFinished.count(), 2); 2524 QCOMPARE(page ->mainFrame()->toPlainText(), QString("error"));2525 QCOMPARE(page ->history()->count(), 2);2526 QCOMPARE(page ->history()->currentItem().url(), QUrl("http://non.existent/url"));2527 QCOMPARE(page ->history()->canGoBack(), true);2528 QCOMPARE(page ->history()->canGoForward(), false);2529 2530 page ->triggerAction(QWebPage::Back);2531 QTRY_COMPARE(page ->history()->canGoBack(), false);2532 QTRY_COMPARE(page ->history()->canGoForward(), true);2533 2534 page ->triggerAction(QWebPage::Forward);2535 QTRY_COMPARE(page ->history()->canGoBack(), true);2536 QTRY_COMPARE(page ->history()->canGoForward(), false);2537 2538 page ->triggerAction(QWebPage::Back);2539 QTRY_COMPARE(page ->history()->canGoBack(), false);2540 QTRY_COMPARE(page ->history()->canGoForward(), true);2541 QTRY_COMPARE(page ->history()->currentItem().url(), QUrl("data:text/html,foo"));2524 QCOMPARE(page.mainFrame()->toPlainText(), QString("error")); 2525 QCOMPARE(page.history()->count(), 2); 2526 QCOMPARE(page.history()->currentItem().url(), QUrl("http://non.existent/url")); 2527 QCOMPARE(page.history()->canGoBack(), true); 2528 QCOMPARE(page.history()->canGoForward(), false); 2529 2530 page.triggerAction(QWebPage::Back); 2531 QTRY_COMPARE(page.history()->canGoBack(), false); 2532 QTRY_COMPARE(page.history()->canGoForward(), true); 2533 2534 page.triggerAction(QWebPage::Forward); 2535 QTRY_COMPARE(page.history()->canGoBack(), true); 2536 QTRY_COMPARE(page.history()->canGoForward(), false); 2537 2538 page.triggerAction(QWebPage::Back); 2539 QTRY_COMPARE(page.history()->canGoBack(), false); 2540 QTRY_COMPARE(page.history()->canGoForward(), true); 2541 QTRY_COMPARE(page.history()->currentItem().url(), QUrl("data:text/html,foo")); 2542 2542 2543 2543 m_view->setPage(0); … … 2546 2546 void tst_QWebPage::errorPageExtensionInIFrames() 2547 2547 { 2548 ErrorPage * page = new ErrorPage;2549 m_view->setPage( page);2548 ErrorPage page; 2549 m_view->setPage(&page); 2550 2550 2551 2551 m_view->page()->mainFrame()->load(QUrl( … … 2557 2557 QTRY_COMPARE(spyLoadFinished.count(), 1); 2558 2558 2559 QCOMPARE(page ->mainFrame()->childFrames()[1]->toPlainText(), QString("error"));2559 QCOMPARE(page.mainFrame()->childFrames()[1]->toPlainText(), QString("error")); 2560 2560 2561 2561 m_view->setPage(0); … … 2564 2564 void tst_QWebPage::errorPageExtensionInFrameset() 2565 2565 { 2566 ErrorPage * page = new ErrorPage;2567 m_view->setPage( page);2566 ErrorPage page; 2567 m_view->setPage(&page); 2568 2568 2569 2569 m_view->load(QUrl("qrc:///resources/index.html")); … … 2571 2571 QSignalSpy spyLoadFinished(m_view, SIGNAL(loadFinished(bool))); 2572 2572 QTRY_COMPARE(spyLoadFinished.count(), 1); 2573 QCOMPARE(page ->mainFrame()->childFrames().count(), 2);2574 QCOMPARE(page ->mainFrame()->childFrames()[1]->toPlainText(), QString("error"));2573 QCOMPARE(page.mainFrame()->childFrames().count(), 2); 2574 QCOMPARE(page.mainFrame()->childFrames()[1]->toPlainText(), QString("error")); 2575 2575 2576 2576 m_view->setPage(0);
Note: See TracChangeset
for help on using the changeset viewer.