Changeset 61906 in webkit


Ignore:
Timestamp:
Jun 25, 2010 2:40:12 PM (14 years ago)
Author:
weinig@apple.com
Message:

Patch for https://bugs.webkit.org/show_bug.cgi?id=41226
Flesh out injected bundle code for WebKitTestRunner and add basic LayoutTestController.

Reviewed by Anders Carlsson.

  • WebKitTestRunner/InjectedBundle/InjectedBundle.cpp: Added.

(WTR::InjectedBundle::shared):
(WTR::InjectedBundle::InjectedBundle):
(WTR::InjectedBundle::_didCreatePage):
(WTR::InjectedBundle::_willDestroyPage):
(WTR::InjectedBundle::_didRecieveMessage):
(WTR::InjectedBundle::initialize):
(WTR::InjectedBundle::didCreatePage):
(WTR::InjectedBundle::willDestroyPage):
(WTR::InjectedBundle::didRecieveMessage):

  • WebKitTestRunner/InjectedBundle/InjectedBundle.h: Added.

(WTR::InjectedBundle::layoutTestController):

  • WebKitTestRunner/InjectedBundle/InjectedBundleMain.cpp:

(WKBundleInitialize):

  • WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp: Added.

(WTR::InjectedBundlePage::InjectedBundlePage):
(WTR::InjectedBundlePage::~InjectedBundlePage):
(WTR::InjectedBundlePage::_didStartProvisionalLoadForFrame):
(WTR::InjectedBundlePage::_didReceiveServerRedirectForProvisionalLoadForFrame):
(WTR::InjectedBundlePage::_didFailProvisionalLoadWithErrorForFrame):
(WTR::InjectedBundlePage::_didCommitLoadForFrame):
(WTR::InjectedBundlePage::_didFinishLoadForFrame):
(WTR::InjectedBundlePage::_didFailLoadWithErrorForFrame):
(WTR::InjectedBundlePage::_didReceiveTitleForFrame):
(WTR::InjectedBundlePage::_didClearWindowForFrame):
(WTR::InjectedBundlePage::didStartProvisionalLoadForFrame):
(WTR::InjectedBundlePage::didReceiveServerRedirectForProvisionalLoadForFrame):
(WTR::InjectedBundlePage::didFailProvisionalLoadWithErrorForFrame):
(WTR::InjectedBundlePage::didCommitLoadForFrame):
(WTR::InjectedBundlePage::didFinishLoadForFrame):
(WTR::InjectedBundlePage::didFailLoadWithErrorForFrame):
(WTR::InjectedBundlePage::didReceiveTitleForFrame):
(WTR::InjectedBundlePage::didClearWindowForFrame):

  • WebKitTestRunner/InjectedBundle/InjectedBundlePage.h: Added.

(WTR::InjectedBundlePage::page):

  • WebKitTestRunner/InjectedBundle/LayoutTestController.cpp: Added.

(WTR::LayoutTestController::create):
(WTR::LayoutTestController::LayoutTestController):
(WTR::LayoutTestController::~LayoutTestController):
(WTR::dumpAsTextCallback):
(WTR::layoutTestControllerObjectFinalize):
(WTR::LayoutTestController::makeWindowObject):
(WTR::LayoutTestController::getJSClass):
(WTR::LayoutTestController::staticFunctions):

  • WebKitTestRunner/InjectedBundle/LayoutTestController.h: Added.

(WTR::LayoutTestController::dumpAsText):
(WTR::LayoutTestController::setDumpAsText):

  • WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj:
Location:
trunk/WebKitTools
Files:
6 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKitTools/ChangeLog

    r61902 r61906  
     12010-06-25  Sam Weinig  <sam@webkit.org>
     2
     3        Reviewed by Anders Carlsson.
     4
     5        Patch for https://bugs.webkit.org/show_bug.cgi?id=41226
     6        Flesh out injected bundle code for WebKitTestRunner and add basic LayoutTestController.
     7
     8        * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp: Added.
     9        (WTR::InjectedBundle::shared):
     10        (WTR::InjectedBundle::InjectedBundle):
     11        (WTR::InjectedBundle::_didCreatePage):
     12        (WTR::InjectedBundle::_willDestroyPage):
     13        (WTR::InjectedBundle::_didRecieveMessage):
     14        (WTR::InjectedBundle::initialize):
     15        (WTR::InjectedBundle::didCreatePage):
     16        (WTR::InjectedBundle::willDestroyPage):
     17        (WTR::InjectedBundle::didRecieveMessage):
     18        * WebKitTestRunner/InjectedBundle/InjectedBundle.h: Added.
     19        (WTR::InjectedBundle::layoutTestController):
     20        * WebKitTestRunner/InjectedBundle/InjectedBundleMain.cpp:
     21        (WKBundleInitialize):
     22        * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp: Added.
     23        (WTR::InjectedBundlePage::InjectedBundlePage):
     24        (WTR::InjectedBundlePage::~InjectedBundlePage):
     25        (WTR::InjectedBundlePage::_didStartProvisionalLoadForFrame):
     26        (WTR::InjectedBundlePage::_didReceiveServerRedirectForProvisionalLoadForFrame):
     27        (WTR::InjectedBundlePage::_didFailProvisionalLoadWithErrorForFrame):
     28        (WTR::InjectedBundlePage::_didCommitLoadForFrame):
     29        (WTR::InjectedBundlePage::_didFinishLoadForFrame):
     30        (WTR::InjectedBundlePage::_didFailLoadWithErrorForFrame):
     31        (WTR::InjectedBundlePage::_didReceiveTitleForFrame):
     32        (WTR::InjectedBundlePage::_didClearWindowForFrame):
     33        (WTR::InjectedBundlePage::didStartProvisionalLoadForFrame):
     34        (WTR::InjectedBundlePage::didReceiveServerRedirectForProvisionalLoadForFrame):
     35        (WTR::InjectedBundlePage::didFailProvisionalLoadWithErrorForFrame):
     36        (WTR::InjectedBundlePage::didCommitLoadForFrame):
     37        (WTR::InjectedBundlePage::didFinishLoadForFrame):
     38        (WTR::InjectedBundlePage::didFailLoadWithErrorForFrame):
     39        (WTR::InjectedBundlePage::didReceiveTitleForFrame):
     40        (WTR::InjectedBundlePage::didClearWindowForFrame):
     41        * WebKitTestRunner/InjectedBundle/InjectedBundlePage.h: Added.
     42        (WTR::InjectedBundlePage::page):
     43        * WebKitTestRunner/InjectedBundle/LayoutTestController.cpp: Added.
     44        (WTR::LayoutTestController::create):
     45        (WTR::LayoutTestController::LayoutTestController):
     46        (WTR::LayoutTestController::~LayoutTestController):
     47        (WTR::dumpAsTextCallback):
     48        (WTR::layoutTestControllerObjectFinalize):
     49        (WTR::LayoutTestController::makeWindowObject):
     50        (WTR::LayoutTestController::getJSClass):
     51        (WTR::LayoutTestController::staticFunctions):
     52        * WebKitTestRunner/InjectedBundle/LayoutTestController.h: Added.
     53        (WTR::LayoutTestController::dumpAsText):
     54        (WTR::LayoutTestController::setDumpAsText):
     55        * WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj:
     56
    1572010-06-25  Sam Weinig  <sam@webkit.org>
    258
  • trunk/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundleMain.cpp

    r61769 r61906  
    2424 */
    2525
    26 #include <WebKit2/WKBundle.h>
     26#include "InjectedBundle.h"
    2727#include <WebKit2/WKBundleInitialize.h>
    28 #include <WebKit2/WKBundlePage.h>
    29 #include <WebKit2/WebKit2.h>
    30 
    31 static WKBundleRef globalBundle;
    32 
    33 // WKBundlePageClient
    34 
    35 void _didStartProvisionalLoadForFrame(WKBundlePageRef page, WKBundleFrameRef frame, const void *clientInfo)
    36 {
    37 }
    38 
    39 void _didReceiveServerRedirectForProvisionalLoadForFrame(WKBundlePageRef page, WKBundleFrameRef frame, const void *clientInfo)
    40 {
    41 }
    42 
    43 void _didFailProvisionalLoadWithErrorForFrame(WKBundlePageRef page, WKBundleFrameRef frame, const void *clientInfo)
    44 {
    45 }
    46 
    47 void _didCommitLoadForFrame(WKBundlePageRef page, WKBundleFrameRef frame, const void *clientInfo)
    48 {
    49 }
    50 
    51 void _didFinishLoadForFrame(WKBundlePageRef page, WKBundleFrameRef frame, const void *clientInfo)
    52 {
    53 }
    54 
    55 void _didFailLoadWithErrorForFrame(WKBundlePageRef page, WKBundleFrameRef frame, const void *clientInfo)
    56 {
    57 }
    58 
    59 void _didReceiveTitleForFrame(WKBundlePageRef page, WKStringRef title, WKBundleFrameRef frame, const void *clientInfo)
    60 {
    61 }
    62 
    63 void _didClearWindow(WKBundlePageRef page, WKBundleFrameRef frame, JSContextRef ctx, JSObjectRef window, const void *clientInfo)
    64 {
    65 }
    66 
    67 // WKBundleClient
    68 
    69 void _didCreatePage(WKBundleRef bundle, WKBundlePageRef page, const void* clientInfo)
    70 {
    71     WKBundlePageClient client = {
    72         0,
    73         0,
    74         _didStartProvisionalLoadForFrame,
    75         _didReceiveServerRedirectForProvisionalLoadForFrame,
    76         _didFailProvisionalLoadWithErrorForFrame,
    77         _didCommitLoadForFrame,
    78         _didFinishLoadForFrame,
    79         _didFailLoadWithErrorForFrame,
    80         _didReceiveTitleForFrame,
    81         _didClearWindow
    82     };
    83     WKBundlePageSetClient(page, &client);
    84 }
    85 
    86 void _willDestroyPage(WKBundleRef bundle, WKBundlePageRef page, const void* clientInfo)
    87 {
    88 }
    89 
    90 void _didRecieveMessage(WKBundleRef bundle, WKStringRef message, const void *clientInfo)
    91 {
    92 }
    9328
    9429extern "C" void WKBundleInitialize(WKBundleRef bundle)
    9530{
    96     globalBundle = bundle;
    97 
    98     WKBundleClient client = {
    99         0,
    100         0,
    101         _didCreatePage,
    102         _willDestroyPage,
    103         _didRecieveMessage
    104     };
    105     WKBundleSetClient(bundle, &client);
     31    WTR::InjectedBundle::shared().initialize(bundle);
    10632}
  • trunk/WebKitTools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj

    r61769 r61906  
    1818                BC7934E811906846005EA8E2 /* PlatformWebViewMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = BC7934E711906846005EA8E2 /* PlatformWebViewMac.mm */; };
    1919                BC8C795C11D2785D004535A1 /* TestControllerMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = BC8C795B11D2785D004535A1 /* TestControllerMac.mm */; };
     20                BCC997A411D3C8F60017BCA2 /* InjectedBundle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCC997A011D3C8F60017BCA2 /* InjectedBundle.cpp */; };
     21                BCC997A511D3C8F60017BCA2 /* InjectedBundlePage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCC997A211D3C8F60017BCA2 /* InjectedBundlePage.cpp */; };
     22                BCC9981811D3F51E0017BCA2 /* LayoutTestController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCC9981711D3F51E0017BCA2 /* LayoutTestController.cpp */; };
    2023                BCD7D2F811921278006DB7EE /* TestInvocation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCD7D2F711921278006DB7EE /* TestInvocation.cpp */; };
    2124                BCDA2ABF1190B51A00C3BC47 /* TestInvocationMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = BCDA2ABE1190B51A00C3BC47 /* TestInvocationMac.mm */; };
     
    6366                BC7934E711906846005EA8E2 /* PlatformWebViewMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PlatformWebViewMac.mm; sourceTree = "<group>"; };
    6467                BC8C795B11D2785D004535A1 /* TestControllerMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = TestControllerMac.mm; sourceTree = "<group>"; };
     68                BCC997A011D3C8F60017BCA2 /* InjectedBundle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InjectedBundle.cpp; sourceTree = "<group>"; };
     69                BCC997A111D3C8F60017BCA2 /* InjectedBundle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InjectedBundle.h; sourceTree = "<group>"; };
     70                BCC997A211D3C8F60017BCA2 /* InjectedBundlePage.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InjectedBundlePage.cpp; sourceTree = "<group>"; };
     71                BCC997A311D3C8F60017BCA2 /* InjectedBundlePage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InjectedBundlePage.h; sourceTree = "<group>"; };
     72                BCC9981611D3F51E0017BCA2 /* LayoutTestController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LayoutTestController.h; sourceTree = "<group>"; };
     73                BCC9981711D3F51E0017BCA2 /* LayoutTestController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LayoutTestController.cpp; sourceTree = "<group>"; };
    6574                BCD7D2F611921278006DB7EE /* TestInvocation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TestInvocation.h; sourceTree = "<group>"; };
    6675                BCD7D2F711921278006DB7EE /* TestInvocation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TestInvocation.cpp; sourceTree = "<group>"; };
     
    142151                        isa = PBXGroup;
    143152                        children = (
     153                                BCC997A011D3C8F60017BCA2 /* InjectedBundle.cpp */,
     154                                BCC997A111D3C8F60017BCA2 /* InjectedBundle.h */,
    144155                                BC25184611D15767002EBC01 /* InjectedBundleMain.cpp */,
     156                                BCC997A211D3C8F60017BCA2 /* InjectedBundlePage.cpp */,
     157                                BCC997A311D3C8F60017BCA2 /* InjectedBundlePage.h */,
     158                                BCC9981611D3F51E0017BCA2 /* LayoutTestController.h */,
     159                                BCC9981711D3F51E0017BCA2 /* LayoutTestController.cpp */,
    145160                        );
    146161                        path = InjectedBundle;
     
    263278                        files = (
    264279                                BC251A3E11D16831002EBC01 /* InjectedBundleMain.cpp in Sources */,
     280                                BCC997A411D3C8F60017BCA2 /* InjectedBundle.cpp in Sources */,
     281                                BCC997A511D3C8F60017BCA2 /* InjectedBundlePage.cpp in Sources */,
     282                                BCC9981811D3F51E0017BCA2 /* LayoutTestController.cpp in Sources */,
    265283                        );
    266284                        runOnlyForDeploymentPostprocessing = 0;
Note: See TracChangeset for help on using the changeset viewer.