2009-11-19 Jocelyn Turcotte <jocelyn.turcotte@nokia.com>
authoreric@webkit.org <eric@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 19 Nov 2009 14:12:05 +0000 (14:12 +0000)
committereric@webkit.org <eric@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 19 Nov 2009 14:12:05 +0000 (14:12 +0000)
        Reviewed by Kenneth Rohde Christiansen.

        [Qt] Add instantiation tests for QWebInspector.

        * tests/qwebinspector/qwebinspector.pro: Added.
        * tests/qwebinspector/tst_qwebinspector.cpp: Added.
        (tst_QWebInspector::attachAndDestroy):
        * tests/tests.pro:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@51186 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebKit/qt/ChangeLog
WebKit/qt/tests/qwebinspector/qwebinspector.pro [new file with mode: 0644]
WebKit/qt/tests/qwebinspector/tst_qwebinspector.cpp [new file with mode: 0644]
WebKit/qt/tests/tests.pro

index 7be049de7aa8a79dda64c8b9002b3c5df50ca292..7ed361b80819aec9a76aa429d96600bbaa3fd818 100644 (file)
@@ -1,3 +1,14 @@
+2009-11-19  Jocelyn Turcotte  <jocelyn.turcotte@nokia.com>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        [Qt] Add instantiation tests for QWebInspector.
+
+        * tests/qwebinspector/qwebinspector.pro: Added.
+        * tests/qwebinspector/tst_qwebinspector.cpp: Added.
+        (tst_QWebInspector::attachAndDestroy):
+        * tests/tests.pro:
+
 2009-11-19  Jocelyn Turcotte  <jocelyn.turcotte@nokia.com>
 
         Reviewed by Kenneth Rohde Christiansen.
diff --git a/WebKit/qt/tests/qwebinspector/qwebinspector.pro b/WebKit/qt/tests/qwebinspector/qwebinspector.pro
new file mode 100644 (file)
index 0000000..520887e
--- /dev/null
@@ -0,0 +1,6 @@
+TEMPLATE = app
+TARGET = tst_qwebinspector
+include(../../../../WebKit.pri)
+SOURCES  += tst_qwebinspector.cpp
+QT += testlib network
+QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR
diff --git a/WebKit/qt/tests/qwebinspector/tst_qwebinspector.cpp b/WebKit/qt/tests/qwebinspector/tst_qwebinspector.cpp
new file mode 100644 (file)
index 0000000..12cd630
--- /dev/null
@@ -0,0 +1,68 @@
+/*
+    Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Library General Public
+    License as published by the Free Software Foundation; either
+    version 2 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Library General Public License for more details.
+
+    You should have received a copy of the GNU Library General Public License
+    along with this library; see the file COPYING.LIB.  If not, write to
+    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+    Boston, MA 02110-1301, USA.
+*/
+
+#include <QtTest/QtTest>
+
+#include <qdir.h>
+#include <qwebinspector.h>
+#include <qwebpage.h>
+#include <qwebsettings.h>
+
+class tst_QWebInspector : public QObject {
+    Q_OBJECT
+
+private slots:
+    void attachAndDestroy();
+};
+
+void tst_QWebInspector::attachAndDestroy()
+{
+    {   // External inspector + manual destruction of page first
+        QWebPage* page = new QWebPage();
+        page->settings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, true);
+        QWebInspector* inspector = new QWebInspector();
+        inspector->setPage(page);
+        page->updatePositionDependentActions(QPoint(0, 0));
+        page->triggerAction(QWebPage::InspectElement);
+
+        delete page;
+        delete inspector;
+    }
+    {   // External inspector + manual destruction of inspector first
+        QWebPage* page = new QWebPage();
+        page->settings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, true);
+        QWebInspector* inspector = new QWebInspector();
+        inspector->setPage(page);
+        page->updatePositionDependentActions(QPoint(0, 0));
+        page->triggerAction(QWebPage::InspectElement);
+
+        delete inspector;
+        delete page;
+    }
+    {   // Internal inspector
+        QWebPage page;
+        page.settings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, true);
+        page.updatePositionDependentActions(QPoint(0, 0));
+        page.triggerAction(QWebPage::InspectElement);
+    }
+}
+
+QTEST_MAIN(tst_QWebInspector)
+
+#include "tst_qwebinspector.moc"
index 939cd224ab7a09e95fa40167981a1b2a85200814..b967ca95c5fc2361d13807effdf472e8011a21ad 100644 (file)
@@ -1,4 +1,4 @@
 
 TEMPLATE = subdirs
-SUBDIRS = qwebframe qwebpage qwebelement qgraphicswebview qwebhistoryinterface qwebview qwebhistory
+SUBDIRS = qwebframe qwebpage qwebelement qgraphicswebview qwebhistoryinterface qwebview qwebhistory qwebinspector
 greaterThan(QT_MINOR_VERSION, 4): SUBDIRS += benchmarks/painting/tst_painting.pro benchmarks/loading/tst_loading.pro