Changeset 123316 in webkit


Ignore:
Timestamp:
Jul 23, 2012 1:33:26 AM (12 years ago)
Author:
commit-queue@webkit.org
Message:

WebKit2 needs layoutTestController.setAlwaysAcceptCookies
https://bugs.webkit.org/show_bug.cgi?id=42778

Patch by Christophe Dumez <Christophe Dumez> on 2012-07-23
Reviewed by Kenneth Rohde Christiansen.

Source/WebKit2:

Add setAlwaysAcceptCookies() method to InjectedBundle
so that we can use it in LayoutTestController.
The method uses WebCookieManager::setHTTPCookieAcceptPolicy()
internally.

  • WebProcess/InjectedBundle/API/c/WKBundle.cpp:

(WKBundleSetAlwaysAcceptCookies):

  • WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
  • WebProcess/InjectedBundle/InjectedBundle.cpp:

(WebKit::InjectedBundle::setAlwaysAcceptCookies):
(WebKit):

  • WebProcess/InjectedBundle/InjectedBundle.h:

(InjectedBundle):

Tools:

Add support for layoutTestController.setAlwaysAcceptCookies()
since it is required by some tests.

  • WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl:
  • WebKitTestRunner/InjectedBundle/LayoutTestController.cpp:

(WTR::LayoutTestController::setAlwaysAcceptCookies):
(WTR):

  • WebKitTestRunner/InjectedBundle/LayoutTestController.h:

(LayoutTestController):

Location:
trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r123315 r123316  
     12012-07-23  Christophe Dumez  <christophe.dumez@intel.com>
     2
     3        WebKit2 needs layoutTestController.setAlwaysAcceptCookies
     4        https://bugs.webkit.org/show_bug.cgi?id=42778
     5
     6        Reviewed by Kenneth Rohde Christiansen.
     7
     8        Add setAlwaysAcceptCookies() method to InjectedBundle
     9        so that we can use it in LayoutTestController.
     10        The method uses WebCookieManager::setHTTPCookieAcceptPolicy()
     11        internally.
     12
     13        * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
     14        (WKBundleSetAlwaysAcceptCookies):
     15        * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
     16        * WebProcess/InjectedBundle/InjectedBundle.cpp:
     17        (WebKit::InjectedBundle::setAlwaysAcceptCookies):
     18        (WebKit):
     19        * WebProcess/InjectedBundle/InjectedBundle.h:
     20        (InjectedBundle):
     21
    1222012-07-23  Thiago Marcos P. Santos  <thiago.santos@intel.com>
    223
  • trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundle.cpp

    r118937 r123316  
    9292}
    9393
     94void WKBundleSetAlwaysAcceptCookies(WKBundleRef bundleRef, bool accept)
     95{
     96    toImpl(bundleRef)->setAlwaysAcceptCookies(accept);
     97}
     98
    9499void WKBundleAddUserScript(WKBundleRef bundleRef, WKBundlePageGroupRef pageGroupRef, WKBundleScriptWorldRef scriptWorldRef, WKStringRef sourceRef, WKURLRef urlRef, WKArrayRef whitelistRef, WKArrayRef blacklistRef, WKUserScriptInjectionTime injectionTimeRef, WKUserContentInjectedFrames injectedFramesRef)
    95100{
  • trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePrivate.h

    r118937 r123316  
    8787WK_EXPORT void WKBundleRemoveOriginAccessWhitelistEntry(WKBundleRef bundle, WKStringRef, WKStringRef, WKStringRef, bool);
    8888WK_EXPORT void WKBundleResetOriginAccessWhitelists(WKBundleRef bundle);
     89WK_EXPORT void WKBundleSetAlwaysAcceptCookies(WKBundleRef bundle, bool);
    8990
    9091WK_EXPORT bool WKBundleIsProcessingUserGesture(WKBundleRef bundle);
  • trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp

    r123315 r123316  
    3737#include "WebApplicationCacheManager.h"
    3838#include "WebContextMessageKinds.h"
     39#include "WebCookieManager.h"
    3940#include "WebCoreArgumentCoders.h"
    4041#include "WebDatabaseManager.h"
     
    115116}
    116117
     118void InjectedBundle::setAlwaysAcceptCookies(bool accept)
     119{
     120    WebCookieManager::shared().setHTTPCookieAcceptPolicy(accept ? HTTPCookieAcceptPolicyAlways : HTTPCookieAcceptPolicyOnlyFromMainDocumentDomain);
     121}
     122
    117123void InjectedBundle::removeAllVisitedLinks()
    118124{
  • trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.h

    r118937 r123316  
    102102    // TestRunner only SPI
    103103    void setShouldTrackVisitedLinks(bool);
     104    void setAlwaysAcceptCookies(bool);
    104105    void removeAllVisitedLinks();
    105106    void activateMacFontAscentHack();
  • trunk/Tools/ChangeLog

    r123300 r123316  
     12012-07-23  Christophe Dumez  <christophe.dumez@intel.com>
     2
     3        WebKit2 needs layoutTestController.setAlwaysAcceptCookies
     4        https://bugs.webkit.org/show_bug.cgi?id=42778
     5
     6        Reviewed by Kenneth Rohde Christiansen.
     7
     8        Add support for layoutTestController.setAlwaysAcceptCookies()
     9        since it is required by some tests.
     10
     11        * WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl:
     12        * WebKitTestRunner/InjectedBundle/LayoutTestController.cpp:
     13        (WTR::LayoutTestController::setAlwaysAcceptCookies):
     14        (WTR):
     15        * WebKitTestRunner/InjectedBundle/LayoutTestController.h:
     16        (LayoutTestController):
     17
    1182012-07-23  Kent Tamura  <tkent@chromium.org>
    219
  • trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl

    r122204 r123316  
    140140        void setWindowIsKey(in boolean isKey);
    141141
     142        // Cookies testing
     143        void setAlwaysAcceptCookies(in boolean accept);
     144
    142145        // FIXME: handle non-boolean preferences.
    143146        void overridePreference(in DOMString preference, in boolean value);
  • trunk/Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp

    r122204 r123316  
    614614}
    615615
     616void LayoutTestController::setAlwaysAcceptCookies(bool accept)
     617{
     618    WKBundleSetAlwaysAcceptCookies(InjectedBundle::shared().bundle(), accept);
     619}
     620
    616621double LayoutTestController::preciseTime()
    617622{
  • trunk/Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.h

    r122204 r123316  
    207207    void overridePreference(JSStringRef preference, bool value);
    208208
     209    // Cookies testing
     210    void setAlwaysAcceptCookies(bool);
     211
    209212    // Custom full screen behavior.
    210213    void setHasCustomFullScreenBehavior(bool value) { m_customFullScreenBehavior = value; }
Note: See TracChangeset for help on using the changeset viewer.