Changeset 65270 in webkit


Ignore:
Timestamp:
Aug 12, 2010 3:03:00 PM (14 years ago)
Author:
jhoneycutt@apple.com
Message:

WebKitTestRunner needs to run tests without using native controls
https://bugs.webkit.org/show_bug.cgi?id=43772

Reviewed by Sam Weinig.

WebKit2:

  • Shared/CoreIPCSupport/WebProcessMessageKinds.h:

(WebProcessMessage::):
Add a new message.

  • UIProcess/API/C/win/WKContextPrivateWin.h: Added.

Declare WKContextSetShouldPaintNativeControls().

  • UIProcess/API/C/win/WKContextWin.cpp: Added.

(WKContextSetShouldPaintNativeControls):
Call the WebContext's setShouldPaintNativeControls().

  • UIProcess/WebContext.cpp:

(WebKit::WebContext::WebContext):
Initialize m_shouldPaintNativeControls.
(WebKit::WebContext::ensureWebProcess):
If we created a web process, call platformSetUpWebProcess().

  • UIProcess/WebContext.h:

Declare new functions and a member to store whether we should paint
native controls.

  • UIProcess/mac/WebContextMac.mm:

(WebKit::WebContext::platformSetUpWebProcess):
Stubbed.

  • UIProcess/win/WebContextWin.cpp:

(WebKit::WebContext::setShouldPaintNativeControls):
Set m_shouldPaintNativeControls. If we have a valid web process, send a
SetShouldPaintNativeControls message.
(WebKit::WebContext::platformSetUpWebProcess):
Send a SetShouldPaintNativeControls message.

  • WebProcess/WebProcess.cpp:

(WebKit::WebProcess::didReceiveMessage):
If this is a SetShouldPaintNativeControls message, decode the argument,
and call Settings::setShouldPaintNativeControls().

  • win/WebKit2.vcproj:

Add WKContextPrivateWin.h and WKContextWin.cpp to project.

  • win/WebKit2Generated.make:

Copy WKContextPrivateWin.h.

WebKitTools:

  • WebKitTestRunner/TestController.cpp:

(WTR::TestController::initialize):
Call platformInitializeContext().

  • WebKitTestRunner/TestController.h:

Declare platformInitializeContext().

  • WebKitTestRunner/mac/TestControllerMac.mm:

(WTR::TestController::platformInitializeContext):
Stubbed.

  • WebKitTestRunner/win/TestControllerWin.cpp:

(WTR::TestController::platformInitializeContext):
Call WKContextSetShouldPaintNativeControls() to disable native control
drawing.

Location:
trunk
Files:
1 added
14 edited
2 copied

Legend:

Unmodified
Added
Removed
  • trunk/WebKit2/ChangeLog

    r65210 r65270  
     12010-08-12  Jon Honeycutt  <jhoneycutt@apple.com>
     2
     3        WebKitTestRunner needs to run tests without using native controls
     4        https://bugs.webkit.org/show_bug.cgi?id=43772
     5
     6        Reviewed by Sam Weinig.
     7
     8        * Shared/CoreIPCSupport/WebProcessMessageKinds.h:
     9        (WebProcessMessage::):
     10        Add a new message.
     11
     12        * UIProcess/API/C/win/WKContextPrivateWin.h: Added.
     13        Declare WKContextSetShouldPaintNativeControls().
     14
     15        * UIProcess/API/C/win/WKContextWin.cpp: Added.
     16        (WKContextSetShouldPaintNativeControls):
     17        Call the WebContext's setShouldPaintNativeControls().
     18
     19        * UIProcess/WebContext.cpp:
     20        (WebKit::WebContext::WebContext):
     21        Initialize m_shouldPaintNativeControls.
     22        (WebKit::WebContext::ensureWebProcess):
     23        If we created a web process, call platformSetUpWebProcess().
     24
     25        * UIProcess/WebContext.h:
     26        Declare new functions and a member to store whether we should paint
     27        native controls.
     28
     29        * UIProcess/mac/WebContextMac.mm:
     30        (WebKit::WebContext::platformSetUpWebProcess):
     31        Stubbed.
     32
     33        * UIProcess/win/WebContextWin.cpp:
     34        (WebKit::WebContext::setShouldPaintNativeControls):
     35        Set m_shouldPaintNativeControls. If we have a valid web process, send a
     36        SetShouldPaintNativeControls message.
     37        (WebKit::WebContext::platformSetUpWebProcess):
     38        Send a SetShouldPaintNativeControls message.
     39
     40        * WebProcess/WebProcess.cpp:
     41        (WebKit::WebProcess::didReceiveMessage):
     42        If this is a SetShouldPaintNativeControls message, decode the argument,
     43        and call Settings::setShouldPaintNativeControls().
     44
     45        * win/WebKit2.vcproj:
     46        Add WKContextPrivateWin.h and WKContextWin.cpp to project.
     47
     48        * win/WebKit2Generated.make:
     49        Copy WKContextPrivateWin.h.
     50
    1512010-08-11  Sam Weinig  <sam@webkit.org>
    252
  • trunk/WebKit2/Shared/CoreIPCSupport/WebProcessMessageKinds.h

    r64797 r65270  
    4444    RegisterURLSchemeAsEmptyDocument,
    4545#if PLATFORM(MAC)
    46     SetupAcceleratedCompositingPort
     46    SetupAcceleratedCompositingPort,
     47#endif
     48#if PLATFORM(WIN)
     49    SetShouldPaintNativeControls,
    4750#endif
    4851};
  • trunk/WebKit2/UIProcess/API/C/win/WKContextPrivateWin.h

    r65269 r65270  
    2424 */
    2525
    26 #include "WebContext.h"
     26#ifndef WKContextPrivateWin_h
     27#define WKContextPrivateWin_h
    2728
    28 #include <WebCore/FileSystem.h>
     29#include <WebKit2/WKBase.h>
     30#include <WebKit2/WKContext.h>
    2931
    30 using namespace WebCore;
     32#ifndef __cplusplus
     33#include <stdbool.h>
     34#endif
    3135
    32 namespace WebKit {
     36#ifdef __cplusplus
     37extern "C" {
     38#endif
    3339
    34 String WebContext::applicationCacheDirectory()
    35 {
    36     return localUserSpecificStorageDirectory();
     40// Defaults to true.
     41WK_EXPORT void WKContextSetShouldPaintNativeControls(WKContextRef, bool);
     42
     43#ifdef __cplusplus
    3744}
     45#endif
    3846
    39 } // namespace WebKit
    40 
     47#endif /* WKContextPrivateWin_h */
  • trunk/WebKit2/UIProcess/API/C/win/WKContextWin.cpp

    r65269 r65270  
    2424 */
    2525
     26#include "WKContext.h"
     27#include "WKContextPrivateWin.h"
     28
     29#include "WKAPICast.h"
    2630#include "WebContext.h"
    2731
    28 #include <WebCore/FileSystem.h>
     32using namespace WebKit;
    2933
    30 using namespace WebCore;
    31 
    32 namespace WebKit {
    33 
    34 String WebContext::applicationCacheDirectory()
     34void WKContextSetShouldPaintNativeControls(WKContextRef contextRef, bool b)
    3535{
    36     return localUserSpecificStorageDirectory();
     36    toWK(contextRef)->setShouldPaintNativeControls(b);
    3737}
    38 
    39 } // namespace WebKit
    40 
  • trunk/WebKit2/UIProcess/WebContext.cpp

    r65021 r65270  
    197197    , m_injectedBundlePath(injectedBundlePath)
    198198    , m_visitedLinkProvider(this)
     199#if PLATFORM(WIN)
     200    , m_shouldPaintNativeControls(true)
     201#endif
    199202{
    200203    RunLoop::initializeMainRunLoop();
     
    244247    for (HashSet<String>::iterator it = m_schemesToRegisterAsEmptyDocument.begin(), end = m_schemesToRegisterAsEmptyDocument.end(); it != end; ++it)
    245248        m_process->send(WebProcessMessage::RegisterURLSchemeAsEmptyDocument, 0, CoreIPC::In(*it));
     249
     250    platformSetUpWebProcess();
    246251}
    247252
  • trunk/WebKit2/UIProcess/WebContext.h

    r65142 r65270  
    107107    void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
    108108
     109#if PLATFORM(WIN)
     110    void setShouldPaintNativeControls(bool);
     111#endif
     112
    109113private:
    110114    WebContext(ProcessModel, const WTF::String& injectedBundlePath);
     
    114118    void ensureWebProcess();
    115119    bool hasValidProcess() const { return m_process && m_process->isValid(); }
     120    void platformSetUpWebProcess();
    116121
    117122    ProcessModel m_processModel;
     
    132137       
    133138    HashSet<WTF::String> m_schemesToRegisterAsEmptyDocument;
     139
     140#if PLATFORM(WIN)
     141    bool m_shouldPaintNativeControls;
     142#endif
    134143};
    135144
  • trunk/WebKit2/UIProcess/mac/WebContextMac.mm

    r63664 r65270  
    6060}
    6161
     62void WebContext::platformSetUpWebProcess()
     63{
     64}
     65
    6266} // namespace WebKit
    6367
  • trunk/WebKit2/UIProcess/win/WebContextWin.cpp

    r63664 r65270  
    2626#include "WebContext.h"
    2727
     28#include "WebProcessMessageKinds.h"
    2829#include <WebCore/FileSystem.h>
    2930
     
    3738}
    3839
     40void WebContext::setShouldPaintNativeControls(bool b)
     41{
     42    m_shouldPaintNativeControls = b;
     43
     44    if (!hasValidProcess())
     45        return;
     46
     47    m_process->send(WebProcessMessage::SetShouldPaintNativeControls, 0, CoreIPC::In(m_shouldPaintNativeControls));
     48}
     49
     50void WebContext::platformSetUpWebProcess()
     51{
     52    m_process->send(WebProcessMessage::SetShouldPaintNativeControls, 0, CoreIPC::In(m_shouldPaintNativeControls));
     53}
     54
    3955} // namespace WebKit
    4056
  • trunk/WebKit2/WebProcess/WebProcess.cpp

    r65021 r65270  
    4040#include <WebCore/PageGroup.h>
    4141#include <WebCore/SchemeRegistry.h>
     42#include <WebCore/Settings.h>
    4243#include <wtf/PassRefPtr.h>
    4344
     
    289290            }
    290291#endif
     292#if PLATFORM(WIN)
     293            case WebProcessMessage::SetShouldPaintNativeControls: {
     294                bool b;
     295                if (!arguments->decode(b))
     296                    return;
     297#if USE(SAFARI_THEME)
     298                Settings::setShouldPaintNativeControls(b);
     299#endif
     300                return;
     301            }
     302#endif
    291303        }
    292304    }
  • trunk/WebKit2/win/WebKit2.vcproj

    r64888 r65270  
    12001200                                        </File>
    12011201                                        <File
     1202                                                RelativePath="..\UIProcess\API\C\win\WKContextPrivateWin.h"
     1203                                                >
     1204                                        </File>
     1205                                        <File
     1206                                                RelativePath="..\UIProcess\API\C\win\WKContextWin.cpp"
     1207                                                >
     1208                                        </File>
     1209                                        <File
    12021210                                                RelativePath="..\UIProcess\API\C\WKData.cpp"
    12031211                                                >
  • trunk/WebKit2/win/WebKit2Generated.make

    r64888 r65270  
    2323    xcopy /y /d "..\UIProcess\API\C\cf\WKStringCF.h" "$(WEBKITOUTPUTDIR)\include\WebKit2"
    2424    xcopy /y /d "..\UIProcess\API\C\cf\WKURLCF.h" "$(WEBKITOUTPUTDIR)\include\WebKit2"
     25    xcopy /y /d "..\UIProcess\API\C\win\WKContextPrivateWin.h" "$(WEBKITOUTPUTDIR)\include\WebKit2"
    2526    xcopy /y /d "..\UIProcess\API\cpp\WKRetainPtr.h" "$(WEBKITOUTPUTDIR)\include\WebKit2"
    2627    xcopy /y /d "..\UIProcess\API\win\WKBaseWin.h" "$(WEBKITOUTPUTDIR)\include\WebKit2"
  • trunk/WebKitTools/ChangeLog

    r65267 r65270  
     12010-08-12  Jon Honeycutt  <jhoneycutt@apple.com>
     2
     3        WebKitTestRunner needs to run tests without using native controls
     4        https://bugs.webkit.org/show_bug.cgi?id=43772
     5
     6        Reviewed by Sam Weinig.
     7
     8        * WebKitTestRunner/TestController.cpp:
     9        (WTR::TestController::initialize):
     10        Call platformInitializeContext().
     11
     12        * WebKitTestRunner/TestController.h:
     13        Declare platformInitializeContext().
     14
     15        * WebKitTestRunner/mac/TestControllerMac.mm:
     16        (WTR::TestController::platformInitializeContext):
     17        Stubbed.
     18
     19        * WebKitTestRunner/win/TestControllerWin.cpp:
     20        (WTR::TestController::platformInitializeContext):
     21        Call WKContextSetShouldPaintNativeControls() to disable native control
     22        drawing.
     23
    1242010-08-12  Sam Weinig  <sam@webkit.org>
    225
  • trunk/WebKitTools/WebKitTestRunner/TestController.cpp

    r65267 r65270  
    124124
    125125    m_context.adopt(WKContextCreateWithInjectedBundlePath(injectedBundlePath()));
     126    platformInitializeContext();
    126127
    127128    WKContextInjectedBundleClient injectedBundleClient = {
     
    133134
    134135    _WKContextSetAdditionalPluginsDirectory(m_context.get(), testPluginDirectory());
    135    
     136
    136137    m_pageNamespace.adopt(WKPageNamespaceCreate(m_context.get()));
    137138    m_mainWebView = adoptPtr(new PlatformWebView(m_pageNamespace.get()));
  • trunk/WebKitTools/WebKitTestRunner/TestController.h

    r65267 r65270  
    6565
    6666    void platformInitialize();
     67    void platformInitializeContext();
    6768    void initializeInjectedBundlePath();
    6869    void initializeTestPluginDirectory();
  • trunk/WebKitTools/WebKitTestRunner/mac/TestControllerMac.mm

    r65267 r65270  
    5252}
    5353
     54void TestController::platformInitializeContext()
     55{
     56}
     57
    5458} // namespace WTR
  • trunk/WebKitTools/WebKitTestRunner/win/TestControllerWin.cpp

    r65267 r65270  
    3030#include <shlwapi.h>
    3131#include <string>
     32#include <WebKit2/WKContextPrivateWin.h>
    3233#include <WebKit2/WKStringCF.h>
    3334#include <wtf/RetainPtr.h>
     
    126127}
    127128
     129void TestController::platformInitializeContext()
     130{
     131    // FIXME: Make DRT pass with Windows native controls. <http://webkit.org/b/25592>
     132    WKContextSetShouldPaintNativeControls(m_context.get(), false);
     133}
     134
    128135} // namespace WTR
Note: See TracChangeset for help on using the changeset viewer.