Title: [135302] trunk/Tools
Revision
135302
Author
commit-qu...@webkit.org
Date
2012-11-20 11:29:54 -0800 (Tue, 20 Nov 2012)

Log Message

[WTR][Qt] Enable fixedLayout when needed by the test
https://bugs.webkit.org/show_bug.cgi?id=102811

Patch by Thiago Marcos P. Santos <thiago.san...@intel.com> on 2012-11-20
Reviewed by Kenneth Rohde Christiansen.

Create a flickable view for CSS Device Adaptation tests. This is
crucial for testing them since they will change the size of the
viewport.

* WebKitTestRunner/PlatformWebView.h:
(PlatformWebView):
* WebKitTestRunner/qt/PlatformWebViewQt.cpp:
(WTR::PlatformWebView::PlatformWebView):
(WTR::PlatformWebView::viewSupportsOptions):
(WTR):
* WebKitTestRunner/qt/main.cpp:
(main):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (135301 => 135302)


--- trunk/Tools/ChangeLog	2012-11-20 19:12:26 UTC (rev 135301)
+++ trunk/Tools/ChangeLog	2012-11-20 19:29:54 UTC (rev 135302)
@@ -1,5 +1,25 @@
 2012-11-20  Thiago Marcos P. Santos  <thiago.san...@intel.com>
 
+        [WTR][Qt] Enable fixedLayout when needed by the test
+        https://bugs.webkit.org/show_bug.cgi?id=102811
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Create a flickable view for CSS Device Adaptation tests. This is
+        crucial for testing them since they will change the size of the
+        viewport.
+
+        * WebKitTestRunner/PlatformWebView.h:
+        (PlatformWebView):
+        * WebKitTestRunner/qt/PlatformWebViewQt.cpp:
+        (WTR::PlatformWebView::PlatformWebView):
+        (WTR::PlatformWebView::viewSupportsOptions):
+        (WTR):
+        * WebKitTestRunner/qt/main.cpp:
+        (main):
+
+2012-11-20  Thiago Marcos P. Santos  <thiago.san...@intel.com>
+
         [WTR] WebKitTestRunner should be able to run tests using fixed layout
         https://bugs.webkit.org/show_bug.cgi?id=102517
 

Modified: trunk/Tools/WebKitTestRunner/PlatformWebView.h (135301 => 135302)


--- trunk/Tools/WebKitTestRunner/PlatformWebView.h	2012-11-20 19:12:26 UTC (rev 135301)
+++ trunk/Tools/WebKitTestRunner/PlatformWebView.h	2012-11-20 19:29:54 UTC (rev 135302)
@@ -89,7 +89,7 @@
     void setWindowIsKey(bool isKey) { m_windowIsKey = isKey; }
     bool windowIsKey() const { return m_windowIsKey; }
 
-#if PLATFORM(MAC) || PLATFORM(EFL)
+#if PLATFORM(MAC) || PLATFORM(EFL) || PLATFORM(QT)
     bool viewSupportsOptions(WKDictionaryRef) const;
 #else
     bool viewSupportsOptions(WKDictionaryRef) const { return true; }
@@ -101,7 +101,7 @@
     PlatformWKView m_view;
     PlatformWindow m_window;
     bool m_windowIsKey;
-#if PLATFORM(EFL)
+#if PLATFORM(EFL) || PLATFORM(QT)
     bool m_usingFixedLayout;
 #endif
 #if PLATFORM(QT)

Modified: trunk/Tools/WebKitTestRunner/qt/PlatformWebViewQt.cpp (135301 => 135302)


--- trunk/Tools/WebKitTestRunner/qt/PlatformWebViewQt.cpp	2012-11-20 19:12:26 UTC (rev 135301)
+++ trunk/Tools/WebKitTestRunner/qt/PlatformWebViewQt.cpp	2012-11-20 19:29:54 UTC (rev 135302)
@@ -77,14 +77,19 @@
     QQuickWebView* m_view;
 };
 
-PlatformWebView::PlatformWebView(WKContextRef contextRef, WKPageGroupRef pageGroupRef, WKDictionaryRef /*options*/)
-    : m_view(new QQuickWebView(contextRef, pageGroupRef))
-    , m_window(new WrapperWindow(m_view))
-    , m_windowIsKey(true)
+PlatformWebView::PlatformWebView(WKContextRef contextRef, WKPageGroupRef pageGroupRef, WKDictionaryRef options)
+    : m_windowIsKey(true)
     , m_modalEventLoop(0)
 {
+    WKRetainPtr<WKStringRef> useFixedLayoutKey(AdoptWK, WKStringCreateWithUTF8CString("UseFixedLayout"));
+    m_usingFixedLayout = options ? WKBooleanGetValue(static_cast<WKBooleanRef>(WKDictionaryGetItemForKey(options, useFixedLayoutKey.get()))) : false;
+    QQuickWebViewExperimental::setFlickableViewportEnabled(m_usingFixedLayout);
+
+    m_view = new QQuickWebView(contextRef, pageGroupRef);
     m_view->setAllowAnyHTTPSCertificateForLocalHost(true);
     m_view->componentComplete();
+
+    m_window = new WrapperWindow(m_view);
 }
 
 PlatformWebView::~PlatformWebView()
@@ -172,6 +177,13 @@
     return result;
 }
 
+bool PlatformWebView::viewSupportsOptions(WKDictionaryRef options) const
+{
+    WKRetainPtr<WKStringRef> useFixedLayoutKey(AdoptWK, WKStringCreateWithUTF8CString("UseFixedLayout"));
+
+    return m_usingFixedLayout == (options ? WKBooleanGetValue(static_cast<WKBooleanRef>(WKDictionaryGetItemForKey(options, useFixedLayoutKey.get()))) : false);
+}
+
 } // namespace WTR
 
 #include "PlatformWebViewQt.moc"

Modified: trunk/Tools/WebKitTestRunner/qt/main.cpp (135301 => 135302)


--- trunk/Tools/WebKitTestRunner/qt/main.cpp	2012-11-20 19:12:26 UTC (rev 135301)
+++ trunk/Tools/WebKitTestRunner/qt/main.cpp	2012-11-20 19:29:54 UTC (rev 135302)
@@ -122,7 +122,6 @@
     WebKit::QtTestSupport::initializeTestFonts();
     QCoreApplication::setAttribute(Qt::AA_Use96Dpi, true);
 
-    QQuickWebViewExperimental::setFlickableViewportEnabled(false);
     QApplication app(argc, argv);
     Launcher launcher(argc, argv);
     QTimer::singleShot(0, &launcher, SLOT(launch()));
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to