Changeset 133266 in webkit


Ignore:
Timestamp:
Nov 1, 2012 10:54:31 PM (11 years ago)
Author:
commit-queue@webkit.org
Message:

[EFL][DRT] Support Geolocation
https://bugs.webkit.org/show_bug.cgi?id=97427

Source/WebKit:

Patch by Seonae Kim <sunaeluv.kim@samsung.com> on 2012-11-01
Reviewed by Gyuyoung Kim.

Add a mock directory to use GeolocationClientMock in DumpRenderTree.

  • PlatformEfl.cmake:

Source/WebKit/efl:

Patch by Seonae Kim <sunaeluv.kim@samsung.com> on 2012-11-01
Reviewed by Gyuyoung Kim.

Implement methods to use GeolocationClientMock in DumpRenderTree.
This client attaches to the page whenever a view is created.

  • WebCoreSupport/DumpRenderTreeSupportEfl.cpp:

(DumpRenderTreeSupportEfl::attachClientToPage):
(DumpRenderTreeSupportEfl::resetGeolocationClientMock):
(DumpRenderTreeSupportEfl::setMockGeolocationPermission):
(DumpRenderTreeSupportEfl::setMockGeolocationPosition):
(DumpRenderTreeSupportEfl::setMockGeolocationPositionUnavailableError):
(DumpRenderTreeSupportEfl::numberOfPendingGeolocationPermissionRequests):

  • WebCoreSupport/DumpRenderTreeSupportEfl.h:

Tools:

Patch by Seonae Kim <sunaeluv.kim@samsung.com> on 2012-11-01
Reviewed by Gyuyoung Kim.

Implement methods to use GeolocationClientMock in DumpRenderTree.
This client attaches to the page whenever a view is created.

  • DumpRenderTree/efl/DumpRenderTreeChrome.cpp:

(DumpRenderTreeChrome::createView):
(DumpRenderTreeChrome::resetDefaultsToConsistentValues):

  • DumpRenderTree/efl/TestRunnerEfl.cpp:

(TestRunner::setMockGeolocationPosition):
(TestRunner::setMockGeolocationPositionUnavailableError):
(TestRunner::setGeolocationPermission):
(TestRunner::numberOfPendingGeolocationPermissionRequests):

LayoutTests:

Patch by Seonae Kim <sunaeluv.kim@samsung.com> on 2012-11-01
Reviewed by Gyuyoung Kim.

Change the comment of Geolocation test cases.

  • platform/efl/TestExpectations:
Location:
trunk
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r133264 r133266  
     12012-11-01  Seonae Kim  <sunaeluv.kim@samsung.com>
     2
     3        [EFL][DRT] Support Geolocation
     4        https://bugs.webkit.org/show_bug.cgi?id=97427
     5
     6        Reviewed by Gyuyoung Kim.
     7
     8        Change the comment of Geolocation test cases.
     9
     10        * platform/efl/TestExpectations:
     11
    1122012-11-01  Simon Fraser  <simon.fraser@apple.com>
    213
  • trunk/LayoutTests/platform/efl/TestExpectations

    r133224 r133266  
    13381338webkit.org/b/68591 http/tests/inspector/filesystem
    13391339
    1340 # The EFL port has no support for the Geolocation
     1340# EFL's TestRunner should support for the Geolocation API
    13411341webkit.org/b/82140 fast/dom/Geolocation [ Skip ]
    13421342webkit.org/b/82140 fast/dom/Window/window-properties-geolocation.html [ Failure ]
  • trunk/Source/WebKit/ChangeLog

    r133094 r133266  
     12012-11-01  Seonae Kim  <sunaeluv.kim@samsung.com>
     2
     3        [EFL][DRT] Support Geolocation
     4        https://bugs.webkit.org/show_bug.cgi?id=97427
     5
     6        Reviewed by Gyuyoung Kim.
     7
     8        Add a mock directory to use GeolocationClientMock in DumpRenderTree.
     9
     10        * PlatformEfl.cmake:
     11
    1122012-10-31  Otto Derek Cheung  <otcheung@rim.com>
    213
  • trunk/Source/WebKit/PlatformEfl.cmake

    r133000 r133266  
    88    "${WEBCORE_DIR}/platform/graphics/cairo"
    99    "${WEBCORE_DIR}/platform/graphics/efl"
     10    "${WEBCORE_DIR}/platform/mock"
    1011    "${WEBCORE_DIR}/platform/network/soup"
    1112    ${CAIRO_INCLUDE_DIRS}
     
    8485    "${WEBCORE_DIR}/platform/graphics/texmap"
    8586    "${THIRDPARTY_DIR}/ANGLE/include/GLSLANG"
     87  )
     88ENDIF ()
     89
     90IF (ENABLE_GEOLOCATION)
     91  LIST(APPEND WebKit_INCLUDE_DIRECTORIES
     92    "${WEBCORE_DIR}/Modules/geolocation"
    8693  )
    8794ENDIF ()
  • trunk/Source/WebKit/efl/ChangeLog

    r133000 r133266  
     12012-11-01  Seonae Kim  <sunaeluv.kim@samsung.com>
     2
     3        [EFL][DRT] Support Geolocation
     4        https://bugs.webkit.org/show_bug.cgi?id=97427
     5
     6        Reviewed by Gyuyoung Kim.
     7
     8        Implement methods to use GeolocationClientMock in DumpRenderTree.
     9        This client attaches to the page whenever a view is created.
     10
     11        * WebCoreSupport/DumpRenderTreeSupportEfl.cpp:
     12        (DumpRenderTreeSupportEfl::attachClientToPage):
     13        (DumpRenderTreeSupportEfl::resetGeolocationClientMock):
     14        (DumpRenderTreeSupportEfl::setMockGeolocationPermission):
     15        (DumpRenderTreeSupportEfl::setMockGeolocationPosition):
     16        (DumpRenderTreeSupportEfl::setMockGeolocationPositionUnavailableError):
     17        (DumpRenderTreeSupportEfl::numberOfPendingGeolocationPermissionRequests):
     18        * WebCoreSupport/DumpRenderTreeSupportEfl.h:
     19
    1202012-10-31  Michał Pakuła vel Rutka  <m.pakula@samsung.com>
    221
  • trunk/Source/WebKit/efl/WebCoreSupport/DumpRenderTreeSupportEfl.cpp

    r131991 r133266  
    6363#include <wtf/HashMap.h>
    6464
     65#if ENABLE(GEOLOCATION)
     66#include <GeolocationClientMock.h>
     67#include <GeolocationController.h>
     68#include <GeolocationError.h>
     69#include <GeolocationPosition.h>
     70#include <wtf/CurrentTime.h>
     71#endif
     72
    6573#define DRT_SUPPORT_FRAME_GET_OR_RETURN(ewkFrame, frame, ...) \
    6674    WebCore::Frame* frame = EWKPrivate::coreFrame(ewkFrame);  \
     
    7280    if (!page)                                            \
    7381        return __VA_ARGS__;
    74    
     82
     83bool DumpRenderTreeSupportEfl::s_drtRun = false;
     84
     85void DumpRenderTreeSupportEfl::setDumpRenderTreeModeEnabled(bool enabled)
     86{
     87    s_drtRun = enabled;
     88}
     89
     90bool DumpRenderTreeSupportEfl::dumpRenderTreeModeEnabled()
     91{
     92    return s_drtRun;
     93}
     94
    7595unsigned DumpRenderTreeSupportEfl::activeAnimationsCount(const Evas_Object* ewkFrame)
    7696{
     
    780800    WebCore::SchemeRegistry::setDomainRelaxationForbiddenForURLScheme(forbidden, scheme);
    781801}
     802
     803void DumpRenderTreeSupportEfl::resetGeolocationClientMock(const Evas_Object* ewkView)
     804{
     805#if ENABLE(GEOLOCATION)
     806    DRT_SUPPRT_PAGE_GET_OR_RETURN(ewkView, page);
     807
     808    WebCore::GeolocationClientMock* mock = static_cast<WebCore::GeolocationClientMock*>(WebCore::GeolocationController::from(page)->client());
     809    mock->reset();
     810#else
     811    UNUSED_PARAM(ewkView);
     812#endif
     813}
     814
     815void DumpRenderTreeSupportEfl::setMockGeolocationPermission(const Evas_Object* ewkView, bool allowed)
     816{
     817#if ENABLE(GEOLOCATION)
     818    DRT_SUPPRT_PAGE_GET_OR_RETURN(ewkView, page);
     819
     820    WebCore::GeolocationClientMock* mock = static_cast<WebCore::GeolocationClientMock*>(WebCore::GeolocationController::from(page)->client());
     821    mock->setPermission(allowed);
     822#else
     823    UNUSED_PARAM(ewkView);
     824    UNUSED_PARAM(allowed);
     825#endif
     826}
     827
     828void DumpRenderTreeSupportEfl::setMockGeolocationPosition(const Evas_Object* ewkView, double latitude, double longitude, double accuracy, bool canProvideAltitude, double altitude, bool canProvideAltitudeAccuracy, double altitudeAccuracy, bool canProvideHeading, double heading, bool canProvideSpeed, double speed)
     829{
     830#if ENABLE(GEOLOCATION)
     831    DRT_SUPPRT_PAGE_GET_OR_RETURN(ewkView, page);
     832
     833    WebCore::GeolocationClientMock* mock = static_cast<WebCore::GeolocationClientMock*>(WebCore::GeolocationController::from(page)->client());
     834    mock->setPosition(WebCore::GeolocationPosition::create(currentTime(), latitude, longitude, accuracy, canProvideAltitude, altitude, canProvideAltitudeAccuracy, altitudeAccuracy, canProvideHeading, heading, canProvideSpeed, speed));
     835#else
     836    UNUSED_PARAM(ewkView);
     837    UNUSED_PARAM(latitude);
     838    UNUSED_PARAM(longitude);
     839    UNUSED_PARAM(accuracy);
     840    UNUSED_PARAM(canProvideAltitude);
     841    UNUSED_PARAM(altitude);
     842    UNUSED_PARAM(canProvideAltitudeAccuracy);
     843    UNUSED_PARAM(altitudeAccuracy);
     844    UNUSED_PARAM(canProvideHeading);
     845    UNUSED_PARAM(heading);
     846    UNUSED_PARAM(canProvideSpeed);
     847    UNUSED_PARAM(speed);
     848#endif
     849}
     850
     851void DumpRenderTreeSupportEfl::setMockGeolocationPositionUnavailableError(const Evas_Object* ewkView, const char* errorMessage)
     852{
     853#if ENABLE(GEOLOCATION)
     854    DRT_SUPPRT_PAGE_GET_OR_RETURN(ewkView, page);
     855
     856    WebCore::GeolocationClientMock* mock = static_cast<WebCore::GeolocationClientMock*>(WebCore::GeolocationController::from(page)->client());
     857    mock->setPositionUnavailableError(errorMessage);
     858#else
     859    UNUSED_PARAM(ewkView);
     860    UNUSED_PARAM(errorMessage);
     861#endif
     862}
     863
     864int DumpRenderTreeSupportEfl::numberOfPendingGeolocationPermissionRequests(const Evas_Object* ewkView)
     865{
     866#if ENABLE(GEOLOCATION)
     867    DRT_SUPPRT_PAGE_GET_OR_RETURN(ewkView, page, -1);
     868
     869    WebCore::GeolocationClientMock* mock = static_cast<WebCore::GeolocationClientMock*>(WebCore::GeolocationController::from(page)->client());
     870    return mock->numberOfPendingPermissionRequests();
     871#else
     872    UNUSED_PARAM(ewkView);
     873    return 0;
     874#endif
     875}
  • trunk/Source/WebKit/efl/WebCoreSupport/DumpRenderTreeSupportEfl.h

    r131991 r133266  
    4949
    5050    ~DumpRenderTreeSupportEfl() { }
     51
     52    static void setDumpRenderTreeModeEnabled(bool);
     53    static bool dumpRenderTreeModeEnabled();
    5154
    5255    static unsigned activeAnimationsCount(const Evas_Object* ewkFrame);
     
    128131    static WebCore::IntRect firstRectForCharacterRange(Evas_Object*, int, int);
    129132    static bool selectedRange(Evas_Object*, int*, int*);
     133
     134    // Geolocation
     135    static void resetGeolocationClientMock(const Evas_Object*);
     136    static void setMockGeolocationPermission(const Evas_Object*, bool allowed);
     137    static void setMockGeolocationPosition(const Evas_Object*, double latitude, double longitude, double accuracy, bool canProvideAltitude, double altitude, bool canProvideAltitudeAccuracy, double altitudeAccuracy, bool canProvideHeading, double heading, bool canProvideSpeed, double speed);
     138    static void setMockGeolocationPositionUnavailableError(const Evas_Object*, const char* errorMessage);
     139    static int numberOfPendingGeolocationPermissionRequests(const Evas_Object*);
     140
     141private:
     142    static bool s_drtRun;
    130143};
    131144
  • trunk/Source/WebKit/efl/ewk/ewk_view.cpp

    r133000 r133266  
    3232#include "DocumentLoader.h"
    3333#include "DragClientEfl.h"
     34#include "DumpRenderTreeSupportEfl.h"
    3435#include "EditorClientEfl.h"
    3536#include "EflScreenUtilities.h"
     
    8485#include "DeviceMotionClientEfl.h"
    8586#include "DeviceOrientationClientEfl.h"
     87#endif
     88
     89#if ENABLE(GEOLOCATION)
     90#include "GeolocationClientMock.h"
     91#include "GeolocationController.h"
    8692#endif
    8793
     
    785791#endif
    786792
     793#if ENABLE(GEOLOCATION)
     794    if (DumpRenderTreeSupportEfl::dumpRenderTreeModeEnabled()) {
     795        WebCore::GeolocationClientMock* mock = new WebCore::GeolocationClientMock;
     796        WebCore::provideGeolocationTo(priv->page.get(), mock);
     797        mock->setController(WebCore::GeolocationController::from(priv->page.get()));
     798    }
     799#endif
     800
    787801    priv->pageSettings = priv->page->settings();
    788802
  • trunk/Tools/ChangeLog

    r133260 r133266  
     12012-11-01  Seonae Kim  <sunaeluv.kim@samsung.com>
     2
     3        [EFL][DRT] Support Geolocation
     4        https://bugs.webkit.org/show_bug.cgi?id=97427
     5
     6        Reviewed by Gyuyoung Kim.
     7
     8        Implement methods to use GeolocationClientMock in DumpRenderTree.
     9        This client attaches to the page whenever a view is created.
     10
     11        * DumpRenderTree/efl/DumpRenderTreeChrome.cpp:
     12        (DumpRenderTreeChrome::createView):
     13        (DumpRenderTreeChrome::resetDefaultsToConsistentValues):
     14        * DumpRenderTree/efl/TestRunnerEfl.cpp:
     15        (TestRunner::setMockGeolocationPosition):
     16        (TestRunner::setMockGeolocationPositionUnavailableError):
     17        (TestRunner::setGeolocationPermission):
     18        (TestRunner::numberOfPendingGeolocationPermissionRequests):
     19
    1202012-11-01  Ryosuke Niwa  <rniwa@webkit.org>
    221
  • trunk/Tools/DumpRenderTree/efl/DumpRenderTreeChrome.cpp

    r131991 r133266  
    197197bool DumpRenderTreeChrome::initialize()
    198198{
     199    // Notifies that DRT is running for ewkView to create testable objects.
     200    DumpRenderTreeSupportEfl::setDumpRenderTreeModeEnabled(true);
    199201    DumpRenderTreeSupportEfl::setMockScrollbarsEnabled(true);
    200202
     
    309311    DumpRenderTreeSupportEfl::clearUserScripts(mainView());
    310312    DumpRenderTreeSupportEfl::clearUserStyleSheets(mainView());
     313    DumpRenderTreeSupportEfl::resetGeolocationClientMock(mainView());
    311314    DumpRenderTreeSupportEfl::setInteractiveFormValidationEnabled(mainView(), true);
    312315    DumpRenderTreeSupportEfl::setValidationMessageTimerMagnification(mainView(), -1);
  • trunk/Tools/DumpRenderTree/efl/TestRunnerEfl.cpp

    r131119 r133266  
    366366}
    367367
    368 void TestRunner::setMockGeolocationPosition(double, double, double, bool, double, bool, double, bool, double, bool, double)
    369 {
    370     // FIXME: Implement for Geolocation layout tests.
    371     // See https://bugs.webkit.org/show_bug.cgi?id=28264.
    372     notImplemented();
    373 }
    374 
    375 void TestRunner::setMockGeolocationPositionUnavailableError(JSStringRef)
    376 {
    377     // FIXME: Implement for Geolocation layout tests.
    378     // See https://bugs.webkit.org/show_bug.cgi?id=28264.
    379     notImplemented();
     368void TestRunner::setMockGeolocationPosition(double latitude, double longitude, double accuracy, bool canProvideAltitude, double altitude, bool canProvideAltitudeAccuracy, double altitudeAccuracy, bool canProvideHeading, double heading, bool canProvideSpeed, double speed)
     369{
     370    Evas_Object* view = browser->mainView();
     371    if (browser->extraViews().size() > 0)
     372        view = browser->extraViews().last();
     373
     374    DumpRenderTreeSupportEfl::setMockGeolocationPosition(view, latitude, longitude, accuracy, canProvideAltitude, altitude, canProvideAltitudeAccuracy, altitudeAccuracy, canProvideHeading, heading, canProvideSpeed, speed);
     375}
     376
     377void TestRunner::setMockGeolocationPositionUnavailableError(JSStringRef message)
     378{
     379    Evas_Object* view = browser->mainView();
     380    if (browser->extraViews().size() > 0)
     381        view = browser->extraViews().last();
     382
     383    DumpRenderTreeSupportEfl::setMockGeolocationPositionUnavailableError(view, message->string().utf8().data());
    380384}
    381385
    382386void TestRunner::setGeolocationPermission(bool allow)
    383387{
    384     // FIXME: Implement for Geolocation layout tests.
    385388    setGeolocationPermissionCommon(allow);
     389    Evas_Object* view = browser->mainView();
     390    if (browser->extraViews().size() > 0)
     391        view = browser->extraViews().last();
     392
     393    DumpRenderTreeSupportEfl::setMockGeolocationPermission(view, allow);
    386394}
    387395
    388396int TestRunner::numberOfPendingGeolocationPermissionRequests()
    389397{
    390     // FIXME: Implement for Geolocation layout tests.
    391     return -1;
     398    Evas_Object* view = browser->mainView();
     399    if (browser->extraViews().size() > 0)
     400        view = browser->extraViews().last();
     401
     402    return DumpRenderTreeSupportEfl::numberOfPendingGeolocationPermissionRequests(view);
    392403}
    393404
Note: See TracChangeset for help on using the changeset viewer.