[webkit-help] What do I need to initialize before using WebFrame on chromium's port?

Amarin Phaosawasdi amchiclet at yahoo.com
Fri Sep 2 10:19:12 PDT 2011


Hi All,

I'm testing out the chromium port of WebKit. I'm using Debian linux.

Here's what I've done so far.
    - installed required libraries
    - downloaded the tar source code from the website
    - Tools/Scripts/update-webkit
    - Tools/Scripts/build-webkit --chromium

Everything builds fine and the unit tests pass.

To avoid all the build configuration, I modified
    Source/WebKit/chromium/tests
to just have one main .cpp file so I can simply build it with
    Tools/Scripts/build-webkit --chromium

I'm trying to create a WebFrame and load a web page that has Javascript (I tried Google).

int main() {
    webkit_support::SetUpTestEnvironment();


    TestWebFrameClient webFrameClient;
    WebView *webView = WebView::create(0);
    webView->initializeMainFrame(&webFrameClient);
    WebFrame *frame = webView->mainFrame();

    // set up urlRequest
    frame->loadRequest(urlRequest); 

    webkit_support::TearDownTestEnvironment();

}

This seems to work fine (doesn't crash).

As soon as I take out SetUpTestEnvironment(), I get  a segmentation fault at
    WebView::create(0)

I figured that at least I needed to call WebKit::initialize() before anything else, so I added
    WebKit::initialize(new webkit_glue::WebKitClientImpl());

Then I got a segmentation fault at 
    webView->initializeMainFrame(&webFrameClient);


What am I missing here? Any pointers are appreciated.

Russell
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-help/attachments/20110902/da84f8b3/attachment.html>


More information about the webkit-help mailing list