Changeset 80319 in webkit


Ignore:
Timestamp:
Mar 3, 2011 9:13:10 PM (13 years ago)
Author:
commit-queue@webkit.org
Message:

2011-03-03 Mahesh Kulkarni <mahesh.kulkarni@nokia.com>

Reviewed by Kenneth Rohde Christiansen.

[QT] Implement mock client-based geolocation for layout testing
https://bugs.webkit.org/show_bug.cgi?id=54334

Re-enable geolocation layout testing for qt port. Also enable a long pending
failure with geolocation as it works with client-based geolocation.
Skipped one last case related to multiple window which needs some code cleanup in qt DRT.

  • platform/qt/Skipped:

2011-03-03 Mahesh Kulkarni <mahesh.kulkarni@nokia.com>

Reviewed by Kenneth Rohde Christiansen.

[QT] Implement mock client-based geolocation for layout testing
https://bugs.webkit.org/show_bug.cgi?id=54334

Implements client() to GeolocationController to re-use geolocationClientMock class
for layout testing purpose.

  • page/GeolocationController.h: (WebCore::GeolocationController::client):

2011-03-03 Mahesh Kulkarni <mahesh.kulkarni@nokia.com>

Reviewed by Kenneth Rohde Christiansen.

[QT] Implement mock client-based geolocation for layout testing
https://bugs.webkit.org/show_bug.cgi?id=54334

Implement layout testing for Client-Based geolocation. If drt_run is set
then create mock geolocationClient and update the same with controller.

  • Api/qwebpage.cpp: (QWebPagePrivate::QWebPagePrivate):
  • WebCoreSupport/DumpRenderTreeSupportQt.cpp: (DumpRenderTreeSupportQt::mockGeolocationReset): (DumpRenderTreeSupportQt::setMockGeolocationPermission): (DumpRenderTreeSupportQt::setMockGeolocationPosition): (DumpRenderTreeSupportQt::setMockGeolocationError):
  • WebCoreSupport/DumpRenderTreeSupportQt.h:
  • WebCoreSupport/GeolocationClientQt.cpp: (WebCore::GeolocationClientQt::GeolocationClientQt):
  • WebCoreSupport/GeolocationClientQt.h:

2011-03-03 Mahesh Kulkarni <mahesh.kulkarni@nokia.com>

Reviewed by Kenneth Rohde Christiansen.

[QT] Implement mock client-based geolocation for layout testing
https://bugs.webkit.org/show_bug.cgi?id=54334

Implement testing for Client-Based geolocation for QtWebkit.

  • DumpRenderTree/qt/DumpRenderTreeQt.cpp: (WebCore::DumpRenderTree::DumpRenderTree):
  • DumpRenderTree/qt/LayoutTestControllerQt.cpp: (LayoutTestController::reset): (LayoutTestController::setGeolocationPermission): (LayoutTestController::setMockGeolocationError): (LayoutTestController::setMockGeolocationPosition):
Location:
trunk
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r80318 r80319  
     12011-03-03  Mahesh Kulkarni  <mahesh.kulkarni@nokia.com>
     2
     3        Reviewed by Kenneth Rohde Christiansen.
     4
     5        [QT] Implement mock client-based geolocation for layout testing
     6        https://bugs.webkit.org/show_bug.cgi?id=54334
     7
     8        Re-enable geolocation layout testing for qt port. Also enable a long pending
     9        failure with geolocation as it works with client-based geolocation.
     10        Skipped one last case related to multiple window which needs some code cleanup in qt DRT.
     11
     12        * platform/qt/Skipped:
     13
    1142011-03-03  Fumitoshi Ukai  <ukai@chromium.org>
    215
  • trunk/LayoutTests/platform/qt/Skipped

    r80250 r80319  
    28872887# new skipped tests yet to be sorted
    28882888# ============================================================================= #
    2889 fast/dom/Geolocation/callback-to-remote-context2.html
    28902889
    28912890# Link prefetch is disabled by default
     
    31643163editing/selection/mixed-editability-10.html
    31653164
    3166 # ----- FIXME: QtWebkit supports client based and LayoutTest for the same is yet to be implemented. Tracked in #54334 ------
    3167 fast/dom/Geolocation
    3168 fast/dom/Window/window-properties-geolocation.html
    3169 
    31703165# [Qt] Generate results for media/audio-repaint.html and media/media-document-audio-repaint.html
    31713166# https://bugs.webkit.org/show_bug.cgi?id=54984
     
    31873182http/tests/xmlviewer/dumpAsText/xsl-stylesheet.xml
    31883183http/tests/xmlviewer/dumpAsText/xul.xml
     3184
     3185# [Qt] geolocation case failing as needs implementation in DumpRenderTree : TODO bug
     3186fast/dom/Geolocation/window-close-crash.html
  • trunk/Source/WebCore/ChangeLog

    r80317 r80319  
     12011-03-03  Mahesh Kulkarni  <mahesh.kulkarni@nokia.com>
     2
     3        Reviewed by Kenneth Rohde Christiansen.
     4
     5        [QT] Implement mock client-based geolocation for layout testing
     6        https://bugs.webkit.org/show_bug.cgi?id=54334
     7
     8        Implements client() to GeolocationController to re-use geolocationClientMock class
     9        for layout testing purpose.
     10
     11        * page/GeolocationController.h:
     12        (WebCore::GeolocationController::client):
     13
    1142011-03-03  Ryosuke Niwa  <rniwa@webkit.org>
    215
  • trunk/Source/WebCore/page/GeolocationController.h

    r76248 r80319  
    5858    GeolocationPosition* lastPosition();
    5959
     60    GeolocationClient* client() { return m_client; }
     61
    6062private:
    6163    Page* m_page;
  • trunk/Source/WebKit/qt/Api/qwebpage.cpp

    r80218 r80319  
    6363#include "FrameTree.h"
    6464#include "FrameView.h"
    65 
    66 #if ENABLE(GEOLOCATION)
     65#if ENABLE(CLIENT_BASED_GEOLOCATION)
     66#include "GeolocationClientMock.h"
    6767#include "GeolocationClientQt.h"
    68 #endif
    69 
     68#endif // CLIENT_BASED_GEOLOCATION
    7069#include "GeolocationPermissionClientQt.h"
    7170#include "HTMLFormElement.h"
     
    328327    pageClients.deviceMotionClient = new DeviceMotionClientQt(q);
    329328#endif
    330 #if ENABLE(GEOLOCATION)
    331     pageClients.geolocationClient = new GeolocationClientQt(q);
     329#if ENABLE(CLIENT_BASED_GEOLOCATION)
     330    if (QWebPagePrivate::drtRun)
     331        pageClients.geolocationClient = new GeolocationClientMock();
     332    else
     333        pageClients.geolocationClient = new GeolocationClientQt(q);
    332334#endif
    333335    page = new Page(pageClients);
    334336
     337#if ENABLE(CLIENT_BASED_GEOLOCATION)
     338    // In case running in DumpRenderTree mode set the controller to mock provider.
     339    if (QWebPagePrivate::drtRun)
     340        static_cast<GeolocationClientMock*>(pageClients.geolocationClient)->setController(page->geolocationController());
     341#endif
    335342    settings = new QWebSettings(page->settings());
    336343
  • trunk/Source/WebKit/qt/ChangeLog

    r80314 r80319  
     12011-03-03  Mahesh Kulkarni  <mahesh.kulkarni@nokia.com>
     2
     3        Reviewed by Kenneth Rohde Christiansen.
     4
     5        [QT] Implement mock client-based geolocation for layout testing
     6        https://bugs.webkit.org/show_bug.cgi?id=54334
     7
     8        Implement layout testing for Client-Based geolocation. If drt_run is set
     9        then create mock geolocationClient and update the same with controller.
     10
     11        * Api/qwebpage.cpp:
     12        (QWebPagePrivate::QWebPagePrivate):
     13        * WebCoreSupport/DumpRenderTreeSupportQt.cpp:
     14        (DumpRenderTreeSupportQt::mockGeolocationReset):
     15        (DumpRenderTreeSupportQt::setMockGeolocationPermission):
     16        (DumpRenderTreeSupportQt::setMockGeolocationPosition):
     17        (DumpRenderTreeSupportQt::setMockGeolocationError):
     18        * WebCoreSupport/DumpRenderTreeSupportQt.h:
     19        * WebCoreSupport/GeolocationClientQt.cpp:
     20        (WebCore::GeolocationClientQt::GeolocationClientQt):
     21        * WebCoreSupport/GeolocationClientQt.h:
     22
    1232011-03-03  Caio Marcelo de Oliveira Filho  <caio.oliveira@openbossa.org>
    224
  • trunk/Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp

    r80077 r80319  
    4646#include "V8Proxy.h"
    4747#endif
    48 #include "Geolocation.h"
    49 #include "GeolocationServiceMock.h"
    50 #include "Geoposition.h"
     48#include "GeolocationClient.h"
     49#include "GeolocationClientMock.h"
     50#include "GeolocationController.h"
     51#include "GeolocationError.h"
     52#include "GeolocationPosition.h"
    5153#include "HistoryItem.h"
    5254#include "HTMLInputElement.h"
     
    9092QMap<int, QWebScriptWorld*> m_worldMap;
    9193
     94#if ENABLE(CLIENT_BASED_GEOLOCATION)
     95GeolocationClientMock* toGeolocationClientMock(GeolocationClient* client)
     96{
     97     ASSERT(QWebPagePrivate::drtRun);
     98     return static_cast<GeolocationClientMock*>(client);
     99}
     100#endif
     101
    92102QDRTNode::QDRTNode()
    93103    : m_node(0)
     
    765775}
    766776
    767 void DumpRenderTreeSupportQt::setMockGeolocationPosition(double latitude, double longitude, double accuracy)
    768 {
    769 #if ENABLE(GEOLOCATION)
    770     RefPtr<Geoposition> geoposition = Geoposition::create(Coordinates::create(latitude, longitude, false, 0, accuracy, true, 0, false, 0, false, 0), currentTime() * 1000.0);
    771     GeolocationServiceMock::setPosition(geoposition);
    772 #endif
    773 }
    774 
    775 void DumpRenderTreeSupportQt::setMockGeolocationError(int errorCode, const QString& message)
    776 {
    777 #if ENABLE(GEOLOCATION)
    778     RefPtr<PositionError> positionError = PositionError::create(static_cast<PositionError::ErrorCode>(errorCode), message);
    779     GeolocationServiceMock::setError(positionError);
     777void DumpRenderTreeSupportQt::resetGeolocationMock(QWebPage* page)
     778{
     779#if ENABLE(CLIENT_BASED_GEOLOCATION)
     780    Page* corePage = QWebPagePrivate::core(page);
     781    GeolocationClientMock* mockClient = toGeolocationClientMock(corePage->geolocationController()->client());
     782    mockClient->reset();
     783#endif
     784}
     785
     786void DumpRenderTreeSupportQt::setMockGeolocationPermission(QWebPage* page, bool allowed)
     787{
     788#if ENABLE(CLIENT_BASED_GEOLOCATION)
     789    Page* corePage = QWebPagePrivate::core(page);
     790    GeolocationClientMock* mockClient = toGeolocationClientMock(corePage->geolocationController()->client());
     791    mockClient->setPermission(allowed);
     792#endif
     793}
     794
     795void DumpRenderTreeSupportQt::setMockGeolocationPosition(QWebPage* page, double latitude, double longitude, double accuracy)
     796{
     797#if ENABLE(CLIENT_BASED_GEOLOCATION)
     798    Page* corePage = QWebPagePrivate::core(page);
     799    GeolocationClientMock* mockClient = toGeolocationClientMock(corePage->geolocationController()->client());
     800    mockClient->setPosition(GeolocationPosition::create(currentTime(), latitude, longitude, accuracy));
     801#endif
     802}
     803
     804void DumpRenderTreeSupportQt::setMockGeolocationError(QWebPage* page, int errorCode, const QString& message)
     805{
     806#if ENABLE(CLIENT_BASED_GEOLOCATION)
     807    Page* corePage = QWebPagePrivate::core(page);
     808
     809    GeolocationError::ErrorCode code = GeolocationError::PositionUnavailable;
     810    switch (errorCode) {
     811    case PositionError::PERMISSION_DENIED:
     812        code = GeolocationError::PermissionDenied;
     813        break;
     814    case PositionError::POSITION_UNAVAILABLE:
     815        code = GeolocationError::PositionUnavailable;
     816        break;
     817    }
     818
     819    GeolocationClientMock* mockClient = static_cast<GeolocationClientMock*>(corePage->geolocationController()->client());
     820    mockClient->setError(GeolocationError::create(code, message));
    780821#endif
    781822}
  • trunk/Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h

    r79793 r80319  
    144144    static void setMockDeviceOrientation(bool canProvideAlpha, double alpha, bool canProvideBeta, double beta, bool canProvideGamma, double gamma);
    145145
    146     static void setMockGeolocationPosition(double latitude, double longitude, double accuracy);
    147     static void setMockGeolocationError(int errorCode, const QString& message);
     146    static void resetGeolocationMock(QWebPage*);
     147    static void setMockGeolocationPermission(QWebPage*, bool allowed);
     148    static void setMockGeolocationPosition(QWebPage*, double latitude, double longitude, double accuracy);
     149    static void setMockGeolocationError(QWebPage*, int errorCode, const QString& message);
    148150
    149151    static int workerThreadCount();
  • trunk/Source/WebKit/qt/WebCoreSupport/GeolocationClientQt.cpp

    r79028 r80319  
    4444static const char failedToStartServiceErrorMessage[] = "Failed to start Geolocation service";
    4545
    46 GeolocationClientQt::GeolocationClientQt(QWebPage* page)
     46GeolocationClientQt::GeolocationClientQt(const QWebPage* page)
    4747    : m_page(page)
    4848    , m_lastPosition(0)
  • trunk/Source/WebKit/qt/WebCoreSupport/GeolocationClientQt.h

    r79028 r80319  
    4646
    4747public:
    48     GeolocationClientQt(QWebPage*);
     48    GeolocationClientQt(const QWebPage*);
    4949    virtual ~GeolocationClientQt();
    5050
     
    6464
    6565private:
    66     QWebPage* m_page;
     66    const QWebPage* m_page;
    6767    RefPtr<GeolocationPosition> m_lastPosition;
    6868    QtMobility::QGeoPositionInfoSource* m_location;
  • trunk/Tools/ChangeLog

    r80301 r80319  
     12011-03-03  Mahesh Kulkarni  <mahesh.kulkarni@nokia.com>
     2
     3        Reviewed by Kenneth Rohde Christiansen.
     4
     5        [QT] Implement mock client-based geolocation for layout testing
     6        https://bugs.webkit.org/show_bug.cgi?id=54334
     7
     8        Implement testing for Client-Based geolocation for QtWebkit.
     9
     10        * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
     11        (WebCore::DumpRenderTree::DumpRenderTree):
     12        * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
     13        (LayoutTestController::reset):
     14        (LayoutTestController::setGeolocationPermission):
     15        (LayoutTestController::setMockGeolocationError):
     16        (LayoutTestController::setMockGeolocationPosition):
     17
    1182011-03-03  Sheriff Bot  <webkit.review.bot@gmail.com>
    219
  • trunk/Tools/DumpRenderTree/qt/DumpRenderTreeQt.cpp

    r79793 r80319  
    419419    , m_persistentStoragePath(QString(getenv("DUMPRENDERTREE_TEMP")))
    420420{
    421 
    422421    QByteArray viewMode = getenv("QT_DRT_WEBVIEW_MODE");
    423422    if (viewMode == "graphics")
    424423        setGraphicsBased(true);
    425424
     425    // Set running in DRT mode for qwebpage to create testable objects.
     426    DumpRenderTreeSupportQt::setDumpRenderTreeModeEnabled(true);
    426427    DumpRenderTreeSupportQt::overwritePluginDirectories();
    427428    DumpRenderTreeSupportQt::activeMockDeviceOrientationClient(true);
  • trunk/Tools/DumpRenderTree/qt/LayoutTestControllerQt.cpp

    r80181 r80319  
    8787    DumpRenderTreeSupportQt::dumpHistoryCallbacks(false);
    8888    DumpRenderTreeSupportQt::dumpVisitedLinksCallbacks(false);
     89    DumpRenderTreeSupportQt::resetGeolocationMock(m_drt->webPage());
    8990    setIconDatabaseEnabled(false);
    9091    clearAllDatabases();
     
    763764{
    764765    setGeolocationPermissionCommon(allow);
    765     emit geolocationPermissionSet();
     766    DumpRenderTreeSupportQt::setMockGeolocationPermission(m_drt->webPage(), allow);
    766767}
    767768
     
    774775void LayoutTestController::setMockGeolocationError(int code, const QString& message)
    775776{
    776     DumpRenderTreeSupportQt::setMockGeolocationError(code, message);
     777    DumpRenderTreeSupportQt::setMockGeolocationError(m_drt->webPage(), code, message);
    777778}
    778779
    779780void LayoutTestController::setMockGeolocationPosition(double latitude, double longitude, double accuracy)
    780781{
    781     DumpRenderTreeSupportQt::setMockGeolocationPosition(latitude, longitude, accuracy);
     782    DumpRenderTreeSupportQt::setMockGeolocationPosition(m_drt->webPage(), latitude, longitude, accuracy);
    782783}
    783784
Note: See TracChangeset for help on using the changeset viewer.