Changeset 75411 in webkit


Ignore:
Timestamp:
Jan 10, 2011 12:30:14 PM (13 years ago)
Author:
benjamin.poulain@nokia.com
Message:

2011-01-10 Benjamin Poulain <benjamin.poulain@nokia.com>

Reviewed by Kenneth Rohde Christiansen.

[Qt] Navigator.cookiesEnabled return true for Qt even if there is no cookie jar
https://bugs.webkit.org/show_bug.cgi?id=52081

Test for the availability of cookie jar to return if cookies are enabled or not.

  • platform/qt/CookieJarQt.cpp: (WebCore::cookiesEnabled):

2011-01-10 Benjamin Poulain <benjamin.poulain@nokia.com>

Reviewed by Kenneth Rohde Christiansen.

[Qt] Navigator.cookiesEnabled return true for Qt even if there is no cookie jar
https://bugs.webkit.org/show_bug.cgi?id=52081

Add an autotest for checking the result of Navigator.cookiesEnabled depending
on the status of the cookie jar.

  • tests/qwebpage/tst_qwebpage.cpp: (tst_QWebPage::navigatorCookieEnabled):
Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r75410 r75411  
     12011-01-10  Benjamin Poulain  <benjamin.poulain@nokia.com>
     2
     3        Reviewed by Kenneth Rohde Christiansen.
     4
     5        [Qt] Navigator.cookiesEnabled return true for Qt even if there is no cookie jar
     6        https://bugs.webkit.org/show_bug.cgi?id=52081
     7
     8        Test for the availability of cookie jar to return if cookies are enabled or not.
     9
     10        * platform/qt/CookieJarQt.cpp:
     11        (WebCore::cookiesEnabled):
     12
    1132011-01-10  W. James MacLean  <wjmaclean@chromium.org>
    214
  • trunk/Source/WebCore/platform/qt/CookieJarQt.cpp

    r75359 r75411  
    115115bool cookiesEnabled(const Document* document)
    116116{
    117     return !!networkAccessManager(document);
     117    if (QNetworkAccessManager* manager = networkAccessManager(document))
     118        return !!manager->cookieJar();
     119
     120    return false;
    118121}
    119122
  • trunk/WebKit/qt/ChangeLog

    r75359 r75411  
     12011-01-10  Benjamin Poulain  <benjamin.poulain@nokia.com>
     2
     3        Reviewed by Kenneth Rohde Christiansen.
     4
     5        [Qt] Navigator.cookiesEnabled return true for Qt even if there is no cookie jar
     6        https://bugs.webkit.org/show_bug.cgi?id=52081
     7
     8        Add an autotest for checking the result of Navigator.cookiesEnabled depending
     9        on the status of the cookie jar.
     10
     11        * tests/qwebpage/tst_qwebpage.cpp:
     12        (tst_QWebPage::navigatorCookieEnabled):
     13
    1142011-01-09  Sheriff Bot  <webkit.review.bot@gmail.com>
    215
  • trunk/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp

    r75359 r75411  
    3535#include <qgraphicsview.h>
    3636#include <qgraphicswebview.h>
     37#include <qnetworkcookiejar.h>
    3738#include <qnetworkrequest.h>
    3839#include <qwebdatabase.h>
     
    132133    void infiniteLoopJS();
    133134    void networkAccessManagerOnDifferentThread();
     135    void navigatorCookieEnabled();
    134136
    135137#ifdef Q_OS_MAC
     
    27112713}
    27122714
     2715void tst_QWebPage::navigatorCookieEnabled()
     2716{
     2717    m_page->networkAccessManager()->setCookieJar(0);
     2718    QVERIFY(!m_page->networkAccessManager()->cookieJar());
     2719    QVERIFY(!m_page->mainFrame()->evaluateJavaScript("navigator.cookieEnabled").toBool());
     2720
     2721    m_page->networkAccessManager()->setCookieJar(new QNetworkCookieJar());
     2722    QVERIFY(m_page->networkAccessManager()->cookieJar());
     2723    QVERIFY(m_page->mainFrame()->evaluateJavaScript("navigator.cookieEnabled").toBool());
     2724}
     2725
    27132726#ifdef Q_OS_MAC
    27142727void tst_QWebPage::macCopyUnicodeToClipboard()
Note: See TracChangeset for help on using the changeset viewer.