Add a dummy plugin to DRT to fix fast/dom/Window/Plug-Ins.html.
authorlars <lars@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 5 Oct 2007 08:57:06 +0000 (08:57 +0000)
committerlars <lars@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 5 Oct 2007 08:57:06 +0000 (08:57 +0000)
Add support for layoutTextController.setCanOpenWindows() to DRT
fixing another 2 test cases in fast/dom/Window.

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

LayoutTests/ChangeLog
LayoutTests/platform/qt/Skipped
WebKitTools/ChangeLog
WebKitTools/DumpRenderTree/qt/DumpRenderTree.cpp
WebKitTools/DumpRenderTree/qt/DumpRenderTree.h
WebKitTools/DumpRenderTree/qt/DumpRenderTree.pro
WebKitTools/DumpRenderTree/qt/jsobjects.cpp
WebKitTools/DumpRenderTree/qt/jsobjects.h
WebKitTools/DumpRenderTree/qt/main.cpp

index 59a136bd15af268992fd1b17a763bf2fd4ee52e9..0f21969ae9f1d142f300850a98fc2679be038c4c 100644 (file)
@@ -1,3 +1,13 @@
+2007-10-05  Lars Knoll  <lars@trolltech.com>
+
+        Add a dummy plugin to DRT  to fix fast/dom/Window/Plug-Ins.html.
+        Add support for layoutTextController.setCanOpenWindows() to DRT
+        fixing another 2 test cases in fast/dom/Window.
+
+        Reviewed by Maciej.
+
+        * platform/qt/Skipped:
+
 2007-10-04  Sam Weinig  <sam@webkit.org>
 
         Rubber-stamped by Darin.
index cc4256b70d923f8ebad1ff86dcc39efd6f659db4..7f33d000b8cac2d8fab85f9d8520ce562c4a90b9 100644 (file)
@@ -8,13 +8,16 @@ dom/xhtml/level3/core/nodelookupprefix19.xhtml
 fast/parser/entities-in-attributes.xhtml
 fast/xpath/string-value.html
 
+# ------- failures due to missing XSLT support
+fast/dom/Window/get-set-properties.html
+fast/dom/Window/window-properties.html
+
 # ------- infinite hangs
 editing/selection/extend-by-word-002.html
 
 # ------- failures for tests with results
 fast/dom/open-and-close-by-DOM.html
 fast/dom/xmlhttprequest-html-response-encoding.html
-fast/dom/Window/new-window-opener.html
 fast/dom/Window/window-early-properties.html
 fast/forms/drag-out-of-textarea.html
 fast/forms/select-double-onchange.html
@@ -95,11 +98,7 @@ fast/dom/Document/early-document-access.html
 fast/dom/Element/onclick-case.html
 fast/dom/HTMLButtonElement/value/getset.html
 fast/dom/HTMLHeadElement/head-check.html
-fast/dom/Window/Plug-ins.html
-fast/dom/Window/get-set-properties.html
-fast/dom/Window/setting-properties-on-closed-window.html
 fast/dom/Window/window-onFocus.html
-fast/dom/Window/window-properties.html
 fast/dynamic/containing-block-change.html
 fast/dynamic/layer-hit-test-crash.html
 fast/encoding/char-decoding.html
index 233109643794c4d511ad364a35624217a947917c..91baa7e38a29465db2a7bb4f3e35d1b1e65e741c 100644 (file)
@@ -1,3 +1,24 @@
+2007-10-05  Lars Knoll  <lars@trolltech.com>
+
+        Add a dummy plugin to DRT  to fix fast/dom/Window/Plug-Ins.html.
+        Add support for layoutTextController.setCanOpenWindows() to DRT
+        fixing another 2 test cases in fast/dom/Window.
+
+        Reviewed by Maciej.
+
+        * DumpRenderTree/qt/DumpRenderTree.cpp:
+        (WebCore::WebPage::WebPage):
+        (WebCore::WebPage::createWindow):
+        (WebCore::DumpRenderTree::resetJSObjects):
+        (WebCore::DumpRenderTree::createWindow):
+        * DumpRenderTree/qt/DumpRenderTree.h:
+        * DumpRenderTree/qt/DumpRenderTree.pro:
+        * DumpRenderTree/qt/jsobjects.cpp:
+        (LayoutTestController::LayoutTestController):
+        (LayoutTestController::reset):
+        * DumpRenderTree/qt/jsobjects.h:
+        * DumpRenderTree/qt/main.cpp:
+
 2007-10-04  Sam Weinig  <sam@webkit.org>
 
         Rubber stamped by Adam.
index dc75140771054ee0053e5de2d9c84cae8c32fbc3..4c64528f974ffed9cc5eb9896ba4be54b1e90c9b 100644 (file)
@@ -40,6 +40,7 @@
 
 #include <qwebpage.h>
 #include <qwebframe.h>
+#include <qwebsettings.h>
 
 #include <unistd.h>
 #include <qdebug.h>
@@ -60,10 +61,10 @@ public:
 
 class WebPage : public QWebPage {
 public:
-    WebPage(QWidget *parent, DumpRenderTree *drt)
-        : QWebPage(parent), m_drt(drt) {}
+    WebPage(QWidget *parent, DumpRenderTree *drt);
 
     QWebFrame *createFrame(QWebFrame *parentFrame, QWebFrameData *frameData);
+    QWebPage *createWindow();
 
     void javaScriptAlert(QWebFrame *frame, const QString& message);
     void javaScriptConsoleMessage(const QString& message, unsigned int lineNumber, const QString& sourceID);
@@ -72,6 +73,14 @@ private:
     DumpRenderTree *m_drt;
 };
 
+WebPage::WebPage(QWidget *parent, DumpRenderTree *drt)
+    : QWebPage(parent), m_drt(drt)
+{
+    QWebSettings s = settings();
+    s.setAttribute(QWebSettings::JavascriptCanOpenWindows, true);
+    setSettings(s);
+}
+
 QWebFrame *WebPage::createFrame(QWebFrame *parentFrame, QWebFrameData *frameData)
 {
     if (parentFrame) {
@@ -96,6 +105,11 @@ QWebFrame *WebPage::createFrame(QWebFrame *parentFrame, QWebFrameData *frameData
     return f;
 }
 
+QWebPage *WebPage::createWindow()
+{
+    return m_drt->createWindow();
+}
+
 void WebPage::javaScriptAlert(QWebFrame *frame, const QString& message)
 {
     fprintf(stdout, "ALERT: %s\n", message.toUtf8().constData());
@@ -167,6 +181,9 @@ void DumpRenderTree::readStdin(int /* socket */)
 void DumpRenderTree::resetJSObjects()
 {
     m_controller->reset();
+    foreach(QWidget *widget, windows)
+        delete widget;
+    windows.clear();
 }
 
 void DumpRenderTree::initJSObjects()
@@ -237,5 +254,19 @@ void DumpRenderTree::dump()
     }
 }
 
+
+QWebPage *DumpRenderTree::createWindow()
+{
+    if (!m_controller->canOpenWindows())
+        return 0;
+    QWidget *container = new QWidget(0);
+    container->resize(0, 0);
+    container->move(-1, -1);
+    container->hide();
+    QWebPage *page = new QWebPage(container);
+    windows.append(container);
+    return page;
+}
+    
 }
 
index f0cec70d156e7ca89687f9dd2ba830c41f8ed28b..8aa5ee874f71ab078ab0840444eb0b46c644ec2f 100644 (file)
@@ -62,6 +62,7 @@ public:
     LayoutTestController *layoutTestController() const { return m_controller; }
     EventSender *eventSender() const { return m_eventSender; }
 
+    QWebPage *createWindow();
 public Q_SLOTS:
     void initJSObjects();
     void readStdin(int);
@@ -80,6 +81,8 @@ private:
 
     QFile *m_stdin;
     QSocketNotifier* m_notifier;
+
+    QList<QWidget *> windows;
 };
 
 }
index fb9b02ccca8e8e8a0ab5b96c1473ff61ab432e2f..5a42cb44f9dcb8516e3d1958bf2d638ea470383d 100644 (file)
@@ -9,8 +9,8 @@ DESTDIR = ../../../bin
 QT = core gui
 macx: QT += xml network
 
-HEADERS = DumpRenderTree.h jsobjects.h
-SOURCES = DumpRenderTree.cpp main.cpp jsobjects.cpp
+HEADERS = DumpRenderTree.h jsobjects.h testplugin.h
+SOURCES = DumpRenderTree.cpp main.cpp jsobjects.cpp testplugin.cpp
 
 unix:!mac {
     QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR
index ccfd4330d5aaf9d09efcb3761cac5e1c1ccdd942..66bce92a9eae2698a33c8f0fcc8ab76e493218d4 100644 (file)
@@ -52,12 +52,8 @@ protected:
 
 LayoutTestController::LayoutTestController() : QObject()
 {
-    m_isLoading = true;
-    m_textDump = false;
-    m_dumpChildrenAsText = false;
-    m_waitForDone = false;
     m_timeoutTimer = 0;
-    m_topLoadingFrame = 0;
+    reset();
 }
 
 void LayoutTestController::reset()
@@ -65,6 +61,7 @@ void LayoutTestController::reset()
     m_isLoading = true;
     m_textDump = false;
     m_dumpChildrenAsText = false;
+    m_canOpenWindows = false;
     m_waitForDone = false;
     if (m_timeoutTimer) {
         killTimer(m_timeoutTimer);
index da693973cfc1b979d48be39967f0cd2e1f469eb4..7bd314c929fea9d2f87f5e918dd03f1b4562d1ba 100644 (file)
@@ -46,6 +46,7 @@ public:
     bool shouldDumpAsText() const { return m_textDump; }
     bool shouldDumpChildrenAsText() const { return m_dumpChildrenAsText; }
     bool shouldWaitUntilDone() const { return m_waitForDone; }
+    bool canOpenWindows() const { return m_canOpenWindows; }
 
     void reset();
 
@@ -59,6 +60,7 @@ public slots:
     void maybeDump(bool ok);
     void dumpAsText() { m_textDump = true; }
     void dumpChildFramesAsText() { m_dumpChildrenAsText = true; }
+    void setCanOpenWindows() { m_canOpenWindows = true; }
     void waitUntilDone();
     void notifyDone();
     void dumpEditingCallbacks();
@@ -69,6 +71,7 @@ private:
     bool m_isLoading;
     bool m_textDump;
     bool m_dumpChildrenAsText;
+    bool m_canOpenWindows;
     bool m_waitForDone;
     int m_timeoutTimer;
     QWebFrame *m_topLoadingFrame;
index b935d203e834153f4b2d06836f777384ee342b44..6c02c18c8e1c5d2886e431a08fe9fd0c6b1fac60 100644 (file)
@@ -1,5 +1,6 @@
 /*
  * Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org>
+ * Copyright (C) 2007 Trolltech ASA
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -27,6 +28,7 @@
  */
 
 #include "DumpRenderTree.h"
+#include "testplugin.h"
 
 #include <qstringlist.h>
 #include <qapplication.h>
@@ -42,6 +44,8 @@
 
 #include <signal.h>
 
+Q_IMPORT_PLUGIN(testplugin)
+
 void messageHandler(QtMsgType type, const char *message)
 {
     if (type == QtCriticalMsg) {