Changeset 75934 in webkit


Ignore:
Timestamp:
Jan 17, 2011 4:21:55 AM (13 years ago)
Author:
jknotten@chromium.org
Message:

2011-01-17 John Knottenbelt <jknotten@chromium.org>

Reviewed by Jeremy Orlow.

GeolocationController should call stopUpdating on destruction
https://bugs.webkit.org/show_bug.cgi?id=52216

fast/dom/window-close-crash.html tests that we do not fail the
assertion in the mock GeolocationClient that the GeolocationClient
is not updating when the GeolocationController is destroyed.

  • fast/dom/Geolocation/resources/window-close-popup.html: Added.
  • fast/dom/Geolocation/script-tests/window-close-crash.js: Added. (gotPosition): (waitForWindowToClose): (failedToCreateWatch):
  • fast/dom/Geolocation/window-close-crash-expected.txt: Added.
  • fast/dom/Geolocation/window-close-crash.html: Added.
  • platform/gtk/Skipped:
  • platform/mac-wk2/Skipped:
  • platform/qt-wk2/Skipped:

2011-01-17 John Knottenbelt <jknotten@chromium.org>

Reviewed by Jeremy Orlow.

GeolocationController should call stopUpdating on destruction
https://bugs.webkit.org/show_bug.cgi?id=52216

Test: fast/dom/Geolocation/window-close-crash.html

  • page/GeolocationController.cpp: (WebCore::GeolocationController::~GeolocationController):

2011-01-17 John Knottenbelt <jknotten@chromium.org>

Reviewed by Jeremy Orlow.

GeolocationController should call stopUpdating on destruction
https://bugs.webkit.org/show_bug.cgi?id=52216

fast/dom/Geolocation/window-close-crash.html requires that a
Geolocation watch be started in a secondary window. Consequently,
we need to allow geolocation permission and provide a mock
geolocation position for the secondary window's
GeolocationClientMock.

  • DumpRenderTree/chromium/LayoutTestController.cpp: (LayoutTestController::setGeolocationPermission): (LayoutTestController::setMockGeolocationPosition): (LayoutTestController::setMockGeolocationError):
  • DumpRenderTree/chromium/TestShell.h: (TestShell::windowList):
Location:
trunk
Files:
4 added
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r75930 r75934  
     12011-01-17  John Knottenbelt  <jknotten@chromium.org>
     2
     3        Reviewed by Jeremy Orlow.
     4
     5        GeolocationController should call stopUpdating on destruction
     6        https://bugs.webkit.org/show_bug.cgi?id=52216
     7
     8        fast/dom/window-close-crash.html tests that we do not fail the
     9        assertion in the mock GeolocationClient that the GeolocationClient
     10        is not updating when the GeolocationController is destroyed.
     11
     12        * fast/dom/Geolocation/resources/window-close-popup.html: Added.
     13        * fast/dom/Geolocation/script-tests/window-close-crash.js: Added.
     14        (gotPosition):
     15        (waitForWindowToClose):
     16        (failedToCreateWatch):
     17        * fast/dom/Geolocation/window-close-crash-expected.txt: Added.
     18        * fast/dom/Geolocation/window-close-crash.html: Added.
     19        * platform/gtk/Skipped:
     20        * platform/mac-wk2/Skipped:
     21        * platform/qt-wk2/Skipped:
     22
    1232011-01-14  Ilya Tikhonovsky  <loislo@chromium.org>
    224
  • trunk/LayoutTests/platform/gtk/Skipped

    r75924 r75934  
    49104910fast/dom/Geolocation/timestamp.html
    49114911fast/dom/Geolocation/watch.html
     4912fast/dom/Geolocation/window-close-crash.html
    49124913
    49134914# We're not quite ready to run these tests, because the slaves need
  • trunk/LayoutTests/platform/mac-wk2/Skipped

    r75841 r75934  
    15851585fast/dom/Geolocation/timestamp.html
    15861586fast/dom/Geolocation/watch.html
     1587fast/dom/Geolocation/window-close-crash.html
    15871588
    15881589# WebKitTestRunner needs layoutTestController.setMockGeolocationPosition
  • trunk/LayoutTests/platform/qt-wk2/Skipped

    r74605 r75934  
    17381738fast/dom/Geolocation/timeout.html
    17391739fast/dom/Geolocation/watch.html
     1740fast/dom/Geolocation/window-close-crash.html
    17401741
    17411742# WebKitTestRunner needs layoutTestController.setMockGeolocationPosition
  • trunk/Source/WebCore/ChangeLog

    r75933 r75934  
     12011-01-17  John Knottenbelt  <jknotten@chromium.org>
     2
     3        Reviewed by Jeremy Orlow.
     4
     5        GeolocationController should call stopUpdating on destruction
     6        https://bugs.webkit.org/show_bug.cgi?id=52216
     7
     8        Test: fast/dom/Geolocation/window-close-crash.html
     9
     10        * page/GeolocationController.cpp:
     11        (WebCore::GeolocationController::~GeolocationController):
     12
    1132011-01-17  Pavel Feldman  <pfeldman@chromium.org>
    214
  • trunk/Source/WebCore/page/GeolocationController.cpp

    r73163 r75934  
    4242GeolocationController::~GeolocationController()
    4343{
    44     if (m_client)
     44    if (m_client) {
     45        if (!m_observers.isEmpty())
     46            m_client->stopUpdating();
     47
    4548        m_client->geolocationDestroyed();
     49    }
    4650}
    4751
  • trunk/Tools/ChangeLog

    r75918 r75934  
     12011-01-17  John Knottenbelt  <jknotten@chromium.org>
     2
     3        Reviewed by Jeremy Orlow.
     4
     5        GeolocationController should call stopUpdating on destruction
     6        https://bugs.webkit.org/show_bug.cgi?id=52216
     7
     8        fast/dom/Geolocation/window-close-crash.html requires that a
     9        Geolocation watch be started in a secondary window. Consequently,
     10        we need to allow geolocation permission and provide a mock
     11        geolocation position for the secondary window's
     12        GeolocationClientMock.
     13
     14        * DumpRenderTree/chromium/LayoutTestController.cpp:
     15        (LayoutTestController::setGeolocationPermission):
     16        (LayoutTestController::setMockGeolocationPosition):
     17        (LayoutTestController::setMockGeolocationError):
     18        * DumpRenderTree/chromium/TestShell.h:
     19        (TestShell::windowList):
     20
    1212011-01-16  Adam Barth  <abarth@webkit.org>
    222
  • trunk/Tools/DumpRenderTree/chromium/LayoutTestController.cpp

    r75367 r75934  
    15161516}
    15171517
     1518// FIXME: For greater test flexibility, we should be able to set each page's geolocation mock individually.
     1519// https://bugs.webkit.org/show_bug.cgi?id=52368
    15181520void LayoutTestController::setGeolocationPermission(const CppArgumentList& arguments, CppVariant* result)
    15191521{
     
    15211523    if (arguments.size() < 1 || !arguments[0].isBool())
    15221524        return;
    1523     m_shell->webViewHost()->geolocationClientMock()->setPermission(arguments[0].toBoolean());
     1525    Vector<WebViewHost*> windowList = m_shell->windowList();
     1526    for (size_t i = 0; i < windowList.size(); i++)
     1527        windowList[i]->geolocationClientMock()->setPermission(arguments[0].toBoolean());
    15241528}
    15251529
     
    15291533    if (arguments.size() < 3 || !arguments[0].isNumber() || !arguments[1].isNumber() || !arguments[2].isNumber())
    15301534        return;
    1531     m_shell->webViewHost()->geolocationClientMock()->setPosition(arguments[0].toDouble(), arguments[1].toDouble(), arguments[2].toDouble());
     1535    Vector<WebViewHost*> windowList = m_shell->windowList();
     1536    for (size_t i = 0; i < windowList.size(); i++)
     1537        windowList[i]->geolocationClientMock()->setPosition(arguments[0].toDouble(), arguments[1].toDouble(), arguments[2].toDouble());
    15321538}
    15331539
     
    15371543    if (arguments.size() < 2 || !arguments[0].isNumber() || !arguments[1].isString())
    15381544        return;
    1539     m_shell->webViewHost()->geolocationClientMock()->setError(arguments[0].toInt32(), cppVariantToWebString(arguments[1]));
     1545    Vector<WebViewHost*> windowList = m_shell->windowList();
     1546    for (size_t i = 0; i < windowList.size(); i++)
     1547        windowList[i]->geolocationClientMock()->setError(arguments[0].toInt32(), cppVariantToWebString(arguments[1]));
    15401548}
    15411549
  • trunk/Tools/DumpRenderTree/chromium/TestShell.h

    r75036 r75934  
    167167    static const int virtualWindowBorder = 3;
    168168
     169    typedef Vector<WebViewHost*> WindowList;
     170    WindowList windowList() const { return m_windowList; }
     171
    169172private:
    170173    WebViewHost* createNewWindow(const WebKit::WebURL&, DRTDevToolsAgent*);
     
    208211    // List of all windows in this process.
    209212    // The main window should be put into windowList[0].
    210     typedef Vector<WebViewHost*> WindowList;
    211213    WindowList m_windowList;
    212214
Note: See TracChangeset for help on using the changeset viewer.