Changeset 39231 in webkit
- Timestamp:
- Dec 12, 2008, 12:22:35 AM (16 years ago)
- Location:
- trunk/WebKit/qt
- Files:
-
- 3 edited
-
ChangeLog (modified) (1 diff)
-
WebCoreSupport/FrameLoaderClientQt.cpp (modified) (1 diff)
-
tests/qwebpage/tst_qwebpage.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKit/qt/ChangeLog
r39210 r39231 1 2008-12-11 Ariya Hidayat <ariya.hidayat@trolltech.com> 2 3 Reviewed by Tor Arne Vestbø. 4 5 When the web page is navigated away, delete the instance 6 of the native plugin. 7 8 http://trolltech.com/developer/task-tracker/index_html?id=214946&method=entry 9 10 * WebCoreSupport/FrameLoaderClientQt.cpp: 11 (WebCore::): 12 * tests/qwebpage/tst_qwebpage.cpp: 13 (PluginTrackedPage::PluginTrackedPage): 14 (PluginTrackedPage::createPlugin): 15 (tst_QWebPage::destroyPlugin): 16 1 17 2008-12-11 Yael Aharon <yael.aharon@nokia.com> 2 18 -
trunk/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
r39210 r39231 997 997 public: 998 998 QtPluginWidget(QWidget* w = 0): Widget(w) {} 999 ~QtPluginWidget() 1000 { 1001 if (platformWidget()) 1002 platformWidget()->deleteLater(); 1003 } 999 1004 virtual void invalidateRect(const IntRect& r) 1000 1005 { -
trunk/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
r39210 r39231 99 99 void database(); 100 100 void createPlugin(); 101 void destroyPlugin(); 101 102 102 103 private: … … 548 549 } 549 550 551 class PluginTrackedPage : public QWebPage 552 { 553 public: 554 555 int count; 556 QPointer<QWidget> widget; 557 558 PluginTrackedPage(QWidget *parent = 0) : QWebPage(parent), count(0) { 559 settings()->setAttribute(QWebSettings::PluginsEnabled, true); 560 } 561 562 virtual QObject* createPlugin(const QString&, const QUrl&, const QStringList&, const QStringList&) { 563 count++; 564 QWidget *w = new QWidget; 565 widget = w; 566 return w; 567 } 568 }; 569 570 void tst_QWebPage::destroyPlugin() 571 { 572 PluginTrackedPage* page = new PluginTrackedPage(m_view); 573 m_view->setPage(page); 574 575 // we create the plugin, so the widget should be constructed 576 QString content("<html><body><object type=\"application/x-qt-plugin\" classid=\"QProgressBar\"></object></body></html>"); 577 m_view->setHtml(content); 578 QVERIFY(page->widget != 0); 579 QCOMPARE(page->count, 1); 580 581 // navigate away, the plugin widget should be destructed 582 m_view->setHtml("<html><body>Hi</body></html>"); 583 QTestEventLoop::instance().enterLoop(1); 584 QVERIFY(page->widget == 0); 585 } 586 550 587 QTEST_MAIN(tst_QWebPage) 551 588 #include "tst_qwebpage.moc"
Note:
See TracChangeset
for help on using the changeset viewer.