Changeset 73862 in webkit


Ignore:
Timestamp:
Dec 11, 2010 10:49:09 AM (13 years ago)
Author:
diegohcg@webkit.org
Message:

[Qt] Mock DeviceOrientation client for DRT
https://bugs.webkit.org/show_bug.cgi?id=47490

Reviewed by Kenneth Rohde Christiansen.

WebCore:

  • WebCore.pro:

WebKit/qt:

  • WebCoreSupport/DeviceOrientationClientMockQt.cpp: Added.

(WebCore::DeviceOrientationClientMockQt::client):
(WebCore::DeviceOrientationClientMockQt::DeviceOrientationClientMockQt):
(WebCore::DeviceOrientationClientMockQt::~DeviceOrientationClientMockQt):
(WebCore::DeviceOrientationClientMockQt::setController):
(WebCore::DeviceOrientationClientMockQt::startUpdating):
(WebCore::DeviceOrientationClientMockQt::stopUpdating):
(WebCore::DeviceOrientationClientMockQt::lastOrientation):
(WebCore::DeviceOrientationClientMockQt::deviceOrientationControllerDestroyed):
(WebCore::DeviceOrientationClientMockQt::setOrientation):

  • WebCoreSupport/DeviceOrientationClientMockQt.h: Added.
  • WebCoreSupport/DeviceOrientationClientQt.cpp:
  • WebCoreSupport/DeviceOrientationProviderQt.cpp:

(WebCore::DeviceOrientationProviderQt::DeviceOrientationProviderQt):
(WebCore::DeviceOrientationProviderQt::~DeviceOrientationProviderQt):
(WebCore::DeviceOrientationProviderQt::changeDeviceOrientation):

  • WebCoreSupport/DeviceOrientationProviderQt.h:
  • WebCoreSupport/DumpRenderTreeSupportQt.cpp:

(DumpRenderTreeSupportQt::activeMockDeviceOrientationClient):
(DumpRenderTreeSupportQt::removeMockDeviceOrientation):
(DumpRenderTreeSupportQt::setMockDeviceOrientation):

  • WebCoreSupport/DumpRenderTreeSupportQt.h:

WebKitTools:

  • DumpRenderTree/qt/DumpRenderTreeQt.cpp:

(WebCore::DumpRenderTree::DumpRenderTree):
(WebCore::DumpRenderTree::~DumpRenderTree):

  • DumpRenderTree/qt/LayoutTestControllerQt.cpp:

(LayoutTestController::setMockDeviceOrientation):

LayoutTests:

  • platform/qt/Skipped:
Location:
trunk
Files:
2 added
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r73861 r73862  
     12010-10-11  Diego Gonzalez  <diegohcg@webkit.org>
     2
     3        Reviewed by Kenneth Rohde Christiansen.
     4
     5        [Qt] Mock DeviceOrientation client for DRT
     6        https://bugs.webkit.org/show_bug.cgi?id=47490
     7
     8        * platform/qt/Skipped:
     9
    1102010-12-11  Pavel Feldman  <pfeldman@chromium.org>
    211
  • trunk/LayoutTests/platform/qt/Skipped

    r73789 r73862  
    7575# This test is for clients that choose to make the missing plugin indicator a button
    7676plugins/clicking-missing-plugin-fires-delegate.html
    77 
    78 # =========================================================================== #
    79 #       Feature not supported... yet
    80 # =========================================================================== #
    81 
    82 # This port doesn't support DeviceMotion or DeviceOrientation.
    83 fast/dom/DeviceMotion
    84 fast/dom/DeviceOrientation
    85 fast/dom/Window/window-properties-device-orientation.html
    8677
    8778# IndexedDB is not yet enabled.
     
    30553046fast/dom/stripNullFromTextNodes.html
    30563047fast/dom/wrapper-classes.html
     3048fast/dom/Window/window-properties-device-orientation.html
    30573049fast/dynamic/002.html
    30583050fast/dynamic/004.html
  • trunk/WebCore/ChangeLog

    r73860 r73862  
     12010-10-11  Diego Gonzalez  <diegohcg@webkit.org>
     2
     3        Reviewed by Kenneth Rohde Christiansen.
     4
     5        [Qt] Mock DeviceOrientation client for DRT
     6        https://bugs.webkit.org/show_bug.cgi?id=47490
     7
     8        * WebCore.pro:
     9
    1102010-12-11  Joone Hur  <joone@kldp.org>
    211
  • trunk/WebCore/WebCore.pro

    r73806 r73862  
    34193419        ../WebKit/qt/WebCoreSupport/DeviceMotionProviderQt.h \
    34203420        ../WebKit/qt/WebCoreSupport/DeviceOrientationClientQt.h \
     3421        ../WebKit/qt/WebCoreSupport/DeviceOrientationClientMockQt.h \
    34213422        ../WebKit/qt/WebCoreSupport/DeviceOrientationProviderQt.h \
    34223423        bindings/generic/RuntimeEnabledFeatures.h
     
    34253426        ../WebKit/qt/WebCoreSupport/DeviceMotionProviderQt.cpp \
    34263427        ../WebKit/qt/WebCoreSupport/DeviceOrientationClientQt.cpp \
     3428        ../WebKit/qt/WebCoreSupport/DeviceOrientationClientMockQt.cpp \
    34273429        ../WebKit/qt/WebCoreSupport/DeviceOrientationProviderQt.cpp \
    34283430        bindings/generic/RuntimeEnabledFeatures.cpp
  • trunk/WebKit/qt/ChangeLog

    r73789 r73862  
     12010-10-11  Diego Gonzalez  <diegohcg@webkit.org>
     2
     3        Reviewed by Kenneth Rohde Christiansen.
     4
     5        [Qt] Mock DeviceOrientation client for DRT
     6        https://bugs.webkit.org/show_bug.cgi?id=47490
     7
     8        * WebCoreSupport/DeviceOrientationClientMockQt.cpp: Added.
     9        (WebCore::DeviceOrientationClientMockQt::client):
     10        (WebCore::DeviceOrientationClientMockQt::DeviceOrientationClientMockQt):
     11        (WebCore::DeviceOrientationClientMockQt::~DeviceOrientationClientMockQt):
     12        (WebCore::DeviceOrientationClientMockQt::setController):
     13        (WebCore::DeviceOrientationClientMockQt::startUpdating):
     14        (WebCore::DeviceOrientationClientMockQt::stopUpdating):
     15        (WebCore::DeviceOrientationClientMockQt::lastOrientation):
     16        (WebCore::DeviceOrientationClientMockQt::deviceOrientationControllerDestroyed):
     17        (WebCore::DeviceOrientationClientMockQt::setOrientation):
     18        * WebCoreSupport/DeviceOrientationClientMockQt.h: Added.
     19        * WebCoreSupport/DeviceOrientationClientQt.cpp:
     20        * WebCoreSupport/DeviceOrientationProviderQt.cpp:
     21        (WebCore::DeviceOrientationProviderQt::DeviceOrientationProviderQt):
     22        (WebCore::DeviceOrientationProviderQt::~DeviceOrientationProviderQt):
     23        (WebCore::DeviceOrientationProviderQt::changeDeviceOrientation):
     24        * WebCoreSupport/DeviceOrientationProviderQt.h:
     25        * WebCoreSupport/DumpRenderTreeSupportQt.cpp:
     26        (DumpRenderTreeSupportQt::activeMockDeviceOrientationClient):
     27        (DumpRenderTreeSupportQt::removeMockDeviceOrientation):
     28        (DumpRenderTreeSupportQt::setMockDeviceOrientation):
     29        * WebCoreSupport/DumpRenderTreeSupportQt.h:
     30
    1312010-12-10  Krithigassree Sambamurthy  <krithigassree.sambamurthy@nokia.com>
    232
  • trunk/WebKit/qt/WebCoreSupport/DeviceOrientationClientQt.cpp

    r69024 r73862  
    2121#include "DeviceOrientationClientQt.h"
    2222
     23#include "DeviceOrientationClientMockQt.h"
    2324#include "DeviceOrientationController.h"
    2425#include "DeviceOrientationProviderQt.h"
  • trunk/WebKit/qt/WebCoreSupport/DeviceOrientationProviderQt.cpp

    r69024 r73862  
    2121#include "DeviceOrientationProviderQt.h"
    2222
     23#include "DeviceOrientationClientMockQt.h"
     24
    2325namespace WebCore {
    2426
     
    2729    m_rotation.addFilter(this);
    2830    m_orientation = DeviceOrientation::create();
     31
     32    if (DeviceOrientationClientMockQt::mockIsActive)
     33        activeClientMock();
    2934}
    3035
    3136DeviceOrientationProviderQt::~DeviceOrientationProviderQt()
    3237{
     38    disconnect();
    3339}
    3440
     
    6470}
    6571
     72void DeviceOrientationProviderQt::changeDeviceOrientation(DeviceOrientation* orientation)
     73{
     74    m_orientation = orientation;
     75}
     76
     77void DeviceOrientationProviderQt::activeClientMock()
     78{
     79    connect(DeviceOrientationClientMockQt::client(), SIGNAL(mockOrientationChanged(DeviceOrientation*)), SLOT(changeDeviceOrientation(DeviceOrientation*)));
     80}
     81
    6682}
    6783
  • trunk/WebKit/qt/WebCoreSupport/DeviceOrientationProviderQt.h

    r69024 r73862  
    4949    void deviceOrientationChanged(DeviceOrientation*);
    5050
     51public Q_SLOTS:
     52    void changeDeviceOrientation(DeviceOrientation*);
     53
    5154private:
     55    void activeClientMock();
     56
    5257    RefPtr<DeviceOrientation> m_orientation;
    5358    QRotationSensor m_rotation;
  • trunk/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp

    r73789 r73862  
    3030#include "ContextMenuClientQt.h"
    3131#include "ContextMenuController.h"
     32#include "DeviceOrientation.h"
     33#include "DeviceOrientationClientMockQt.h"
    3234#include "Editor.h"
    3335#include "EditorClientQt.h"
     
    694696}
    695697
     698void DumpRenderTreeSupportQt::activeMockDeviceOrientationClient(bool b)
     699{
     700#if ENABLE(DEVICE_ORIENTATION)
     701    DeviceOrientationClientMockQt::mockIsActive = b;
     702#endif
     703}
     704
     705void DumpRenderTreeSupportQt::removeMockDeviceOrientation()
     706{
     707#if ENABLE(DEVICE_ORIENTATION)
     708    DeviceOrientationClientMockQt* client = DeviceOrientationClientMockQt::client();
     709    delete client;
     710#endif
     711}
     712
     713void DumpRenderTreeSupportQt::setMockDeviceOrientation(bool canProvideAlpha, double alpha, bool canProvideBeta, double beta, bool canProvideGamma, double gamma)
     714{
     715#if ENABLE(DEVICE_ORIENTATION)
     716    DeviceOrientationClientMockQt::client()->setOrientation(canProvideAlpha, alpha, canProvideBeta, beta, canProvideGamma, gamma);
     717#endif
     718}
     719
    696720void DumpRenderTreeSupportQt::setMockGeolocationPosition(double latitude, double longitude, double accuracy)
    697721{
  • trunk/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h

    r73789 r73862  
    9595    static void resetOriginAccessWhiteLists();
    9696
     97    static void activeMockDeviceOrientationClient(bool b);
     98    static void removeMockDeviceOrientation();
     99    static void setMockDeviceOrientation(bool canProvideAlpha, double alpha, bool canProvideBeta, double beta, bool canProvideGamma, double gamma);
     100
    97101    static void setMockGeolocationPosition(double latitude, double longitude, double accuracy);
    98102    static void setMockGeolocationError(int errorCode, const QString& message);
  • trunk/WebKitTools/ChangeLog

    r73859 r73862  
     12010-10-11  Diego Gonzalez  <diegohcg@webkit.org>
     2
     3        Reviewed by Kenneth Rohde Christiansen.
     4
     5        [Qt] Mock DeviceOrientation client for DRT
     6        https://bugs.webkit.org/show_bug.cgi?id=47490
     7
     8        * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
     9        (WebCore::DumpRenderTree::DumpRenderTree):
     10        (WebCore::DumpRenderTree::~DumpRenderTree):
     11        * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
     12        (LayoutTestController::setMockDeviceOrientation):
     13
    1142010-12-11  Philippe Normand  <pnormand@igalia.com>
    215
  • trunk/WebKitTools/DumpRenderTree/qt/DumpRenderTreeQt.cpp

    r73789 r73862  
    421421
    422422    DumpRenderTreeSupportQt::overwritePluginDirectories();
    423 
     423    DumpRenderTreeSupportQt::activeMockDeviceOrientationClient(true);
    424424    QWebSettings::enablePersistentStorage(m_persistentStoragePath);
    425425
     
    497497    delete m_mainView;
    498498    delete m_stdin;
     499    DumpRenderTreeSupportQt::removeMockDeviceOrientation();
    499500}
    500501
  • trunk/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.cpp

    r73789 r73862  
    751751void LayoutTestController::setMockDeviceOrientation(bool canProvideAlpha, double alpha, bool canProvideBeta, double beta, bool canProvideGamma, double gamma)
    752752{
    753     // FIXME: Implement for DeviceOrientation layout tests.
    754     // See https://bugs.webkit.org/show_bug.cgi?id=30335.
     753    DumpRenderTreeSupportQt::setMockDeviceOrientation(canProvideAlpha, alpha, canProvideBeta, beta, canProvideGamma, gamma);
    755754}
    756755
Note: See TracChangeset for help on using the changeset viewer.