Changeset 121463 in webkit


Ignore:
Timestamp:
Jun 28, 2012 1:34:47 PM (12 years ago)
Author:
shawnsingh@chromium.org
Message:

[chromium] Use WEBKIT_IMPLEMENTATION == 1 for webkit_unit_tests
https://bugs.webkit.org/show_bug.cgi?id=90094

Reviewed by Adam Barth.

This patch adds the WEBKIT_IMPLEMENTATION = 1 define to
WebKitUnitTests.gyp. To get it to compile correctly, some string
and URL code was refactored and fixed.

  • WebKit.gypi:
  • WebKitUnitTests.gyp:
  • public/WebDOMMessageEvent.h:

(WebKit::WebDOMMessageEvent::WebDOMMessageEvent):

  • tests/AssociatedURLLoaderTest.cpp:
  • tests/EventListenerTest.cpp:
  • tests/FrameTestHelpers.cpp:

(WebKit::FrameTestHelpers::loadFrame):

  • tests/FrameTestHelpers.h:
  • tests/ListenerLeakTest.cpp:

(WebKit::ListenerLeakTest::RunTest):

  • tests/PopupMenuTest.cpp:
  • tests/RunAllTests.cpp:
  • tests/URLTestHelpers.cpp: Added.

(URLTestHelpers):
(WebKit::URLTestHelpers::registerMockedURLFromBaseURL):
(WebKit::URLTestHelpers::registerMockedURLLoad):

  • tests/URLTestHelpers.h: Copied from Source/WebKit/chromium/public/WebDOMMessageEvent.h.

(WebKit):
(URLTestHelpers):
(WebKit::URLTestHelpers::toKURL):

  • tests/WebFrameTest.cpp:
  • tests/WebPageNewSerializerTest.cpp:
  • tests/WebPageSerializerTest.cpp:
  • tests/WebViewTest.cpp:
Location:
trunk/Source/WebKit/chromium
Files:
1 added
15 edited
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/chromium/ChangeLog

    r121451 r121463  
     12012-06-28  Shawn Singh  <shawnsingh@chromium.org>
     2
     3        [chromium] Use WEBKIT_IMPLEMENTATION == 1 for webkit_unit_tests
     4        https://bugs.webkit.org/show_bug.cgi?id=90094
     5
     6        Reviewed by Adam Barth.
     7
     8        This patch adds the WEBKIT_IMPLEMENTATION = 1 define to
     9        WebKitUnitTests.gyp. To get it to compile correctly, some string
     10        and URL code was refactored and fixed.
     11
     12        * WebKit.gypi:
     13        * WebKitUnitTests.gyp:
     14        * public/WebDOMMessageEvent.h:
     15        (WebKit::WebDOMMessageEvent::WebDOMMessageEvent):
     16        * tests/AssociatedURLLoaderTest.cpp:
     17        * tests/EventListenerTest.cpp:
     18        * tests/FrameTestHelpers.cpp:
     19        (WebKit::FrameTestHelpers::loadFrame):
     20        * tests/FrameTestHelpers.h:
     21        * tests/ListenerLeakTest.cpp:
     22        (WebKit::ListenerLeakTest::RunTest):
     23        * tests/PopupMenuTest.cpp:
     24        * tests/RunAllTests.cpp:
     25        * tests/URLTestHelpers.cpp: Added.
     26        (URLTestHelpers):
     27        (WebKit::URLTestHelpers::registerMockedURLFromBaseURL):
     28        (WebKit::URLTestHelpers::registerMockedURLLoad):
     29        * tests/URLTestHelpers.h: Copied from Source/WebKit/chromium/public/WebDOMMessageEvent.h.
     30        (WebKit):
     31        (URLTestHelpers):
     32        (WebKit::URLTestHelpers::toKURL):
     33        * tests/WebFrameTest.cpp:
     34        * tests/WebPageNewSerializerTest.cpp:
     35        * tests/WebPageSerializerTest.cpp:
     36        * tests/WebViewTest.cpp:
     37
    1382012-06-28  Oli Lan  <olilan@chromium.org>
    239
  • trunk/Source/WebKit/chromium/WebKit.gypi

    r121415 r121463  
    147147            'tests/TreeTestHelpers.cpp',
    148148            'tests/TreeTestHelpers.h',
     149            'tests/URLTestHelpers.cpp',
     150            'tests/URLTestHelpers.h',
    149151            'tests/WebCompositorInputHandlerImplTest.cpp',
    150152            'tests/WebFrameTest.cpp',
  • trunk/Source/WebKit/chromium/WebKitUnitTests.gyp

    r121408 r121463  
    7979                '../../Platform/chromium',
    8080            ],
     81            'defines': [
     82                'WEBKIT_IMPLEMENTATION=1',
     83            ],
    8184            'conditions': [
    8285                ['inside_chromium_build==1 and component=="shared_library"', {
  • trunk/Source/WebKit/chromium/public/WebDOMMessageEvent.h

    r121408 r121463  
    4747class WebDOMMessageEvent : public WebDOMEvent {
    4848public:
     49    WebDOMMessageEvent() { }
    4950    WEBKIT_EXPORT void initMessageEvent(const WebString& type, bool canBubble, bool cancelable, const WebSerializedScriptValue& messageData, const WebString& origin, const WebFrame* sourceFrame, const WebString& lastEventId);
    5051
  • trunk/Source/WebKit/chromium/tests/AssociatedURLLoaderTest.cpp

    r121408 r121463  
    3131#include "config.h"
    3232
     33#include "URLTestHelpers.h"
    3334#include "WebFrame.h"
    3435#include "WebFrameClient.h"
     
    4344#include <wtf/text/WTFString.h>
    4445
    45 #include <googleurl/src/gurl.h>
    4646#include <gtest/gtest.h>
    4747#include <webkit/support/webkit_support.h>
    4848
    4949using namespace WebKit;
     50using WebKit::URLTestHelpers::toKURL;
    5051
    5152namespace {
     
    7778    {
    7879        // Reuse one of the test files from WebFrameTest.
    79         std::string filePath = webkit_support::GetWebKitRootDir().utf8();
     80        std::string filePath = std::string(webkit_support::GetWebKitRootDir().utf8().data());
    8081        filePath += "/Source/WebKit/chromium/tests/data/iframes_test.html";
    81         m_frameFilePath = WebString::fromUTF8(filePath);
     82        m_frameFilePath = WebString::fromUTF8(filePath.c_str());
    8283    }
    8384
     
    8889
    8990        // Load the frame before trying to load resources.
    90         GURL url = GURL("http://www.test.com/iframes_test.html");
     91        WebCore::KURL url = toKURL("http://www.test.com/iframes_test.html");
    9192        WebURLResponse response;
    9293        response.initialize();
     
    185186        WebURLRequest request;
    186187        request.initialize();
    187         request.setURL(GURL("http://www.test.com/success.html"));
     188        request.setURL(toKURL("http://www.test.com/success.html"));
    188189        request.setHTTPMethod(WebString::fromUTF8(unsafeMethod));
    189190        WebURLLoaderOptions options;
     
    201202        WebURLRequest request;
    202203        request.initialize();
    203         request.setURL(GURL("http://www.test.com/success.html"));
     204        request.setURL(toKURL("http://www.test.com/success.html"));
    204205        request.setHTTPHeaderField(WebString::fromUTF8(headerField), WebString::fromUTF8(headerValue));
    205206        WebURLLoaderOptions options;
     
    231232        id.append(".html");
    232233
    233         GURL url = GURL(id);
     234        WebCore::KURL url = toKURL(id);
    234235        WebURLRequest request;
    235236        request.initialize();
     
    283284TEST_F(AssociatedURLLoaderTest, SameOriginSuccess)
    284285{
    285     GURL url = GURL("http://www.test.com/SameOriginSuccess.html");
     286    WebCore::KURL url = toKURL("http://www.test.com/SameOriginSuccess.html");
    286287    WebURLRequest request;
    287288    request.initialize();
     
    306307{
    307308    // This is cross-origin since the frame was loaded from www.test.com.
    308     GURL url = GURL("http://www.other.com/SameOriginRestriction.html");
     309    WebCore::KURL url = toKURL("http://www.other.com/SameOriginRestriction.html");
    309310    WebURLRequest request;
    310311    request.initialize();
     
    317318{
    318319    // This is cross-origin since the frame was loaded from www.test.com.
    319     GURL url = GURL("http://www.other.com/CrossOriginSuccess.html");
     320    WebCore::KURL url = toKURL("http://www.other.com/CrossOriginSuccess.html");
    320321    WebURLRequest request;
    321322    request.initialize();
     
    342343{
    343344    // This is cross-origin since the frame was loaded from www.test.com.
    344     GURL url = GURL("http://www.other.com/CrossOriginWithAccessControlSuccess.html");
     345    WebCore::KURL url = toKURL("http://www.other.com/CrossOriginWithAccessControlSuccess.html");
    345346    WebURLRequest request;
    346347    request.initialize();
     
    368369{
    369370    // This is cross-origin since the frame was loaded from www.test.com.
    370     GURL url = GURL("http://www.other.com/CrossOriginWithAccessControlFailure.html");
     371    WebCore::KURL url = toKURL("http://www.other.com/CrossOriginWithAccessControlFailure.html");
    371372    WebURLRequest request;
    372373    request.initialize();
     
    399400TEST_F(AssociatedURLLoaderTest, RedirectSuccess)
    400401{
    401     GURL url = GURL("http://www.test.com/RedirectSuccess.html");
     402    WebCore::KURL url = toKURL("http://www.test.com/RedirectSuccess.html");
    402403    char redirect[] = "http://www.test.com/RedirectSuccess2.html";  // Same-origin
    403     GURL redirectURL = GURL(redirect);
     404    WebCore::KURL redirectURL = toKURL(redirect);
    404405
    405406    WebURLRequest request;
     
    436437TEST_F(AssociatedURLLoaderTest, RedirectCrossOriginWithAccessControlFailure)
    437438{
    438     GURL url = GURL("http://www.test.com/RedirectCrossOriginWithAccessControlFailure.html");
     439    WebCore::KURL url = toKURL("http://www.test.com/RedirectCrossOriginWithAccessControlFailure.html");
    439440    char redirect[] = "http://www.other.com/RedirectCrossOriginWithAccessControlFailure.html";  // Cross-origin
    440     GURL redirectURL = GURL(redirect);
     441    WebCore::KURL redirectURL = toKURL(redirect);
    441442
    442443    WebURLRequest request;
     
    468469TEST_F(AssociatedURLLoaderTest, RedirectCrossOriginWithAccessControlSuccess)
    469470{
    470     GURL url = GURL("http://www.test.com/RedirectCrossOriginWithAccessControlSuccess.html");
     471    WebCore::KURL url = toKURL("http://www.test.com/RedirectCrossOriginWithAccessControlSuccess.html");
    471472    char redirect[] = "http://www.other.com/RedirectCrossOriginWithAccessControlSuccess.html";  // Cross-origin
    472     GURL redirectURL = GURL(redirect);
     473    WebCore::KURL redirectURL = toKURL(redirect);
    473474
    474475    WebURLRequest request;
     
    591592    WebURLRequest request;
    592593    request.initialize();
    593     GURL url = GURL("http://www.other.com/CrossOriginHeaderAllowResponseHeaders.html");
     594    WebCore::KURL url = toKURL("http://www.other.com/CrossOriginHeaderAllowResponseHeaders.html");
    594595    request.setURL(url);
    595596
  • trunk/Source/WebKit/chromium/tests/EventListenerTest.cpp

    r121408 r121463  
    3232
    3333#include "FrameTestHelpers.h"
     34#include "URLTestHelpers.h"
    3435#include "WebDOMEvent.h"
    3536#include "WebDOMEventListener.h"
     
    7980        std::string fileName("listener/mutation_event_listener.html");
    8081        bool executeScript = true;
    81         FrameTestHelpers::registerMockedURLLoad(baseURL, fileName);
     82        URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(baseURL.c_str()), WebString::fromUTF8(fileName.c_str()));
    8283        m_webView = FrameTestHelpers::createWebViewAndLoad(baseURL + fileName, executeScript);
    8384    }
  • trunk/Source/WebKit/chromium/tests/FrameTestHelpers.cpp

    r121408 r121463  
    3232#include "FrameTestHelpers.h"
    3333
     34#include "URLTestHelpers.h"
    3435#include <wtf/StdLibExtras.h>
    3536#include "WebFrame.h"
     
    4142#include "WebView.h"
    4243#include "WebViewClient.h"
    43 #include <googleurl/src/gurl.h>
    4444#include <webkit/support/webkit_support.h>
    4545
     
    4747namespace FrameTestHelpers {
    4848
    49 void registerMockedURLLoad(const std::string& base, const std::string& fileName)
    50 {
    51     registerMockedURLLoad(GURL(base + fileName), fileName);
    52 }
    53 
    54 void registerMockedURLLoad(GURL url, const std::string& fileName)
    55 {
    56     WebURLResponse response;
    57     response.initialize();
    58     response.setMIMEType("text/html");
    59 
    60     std::string filePath = webkit_support::GetWebKitRootDir().utf8();
    61     filePath += "/Source/WebKit/chromium/tests/data/";
    62     filePath += fileName;
    63 
    64     webkit_support::RegisterMockedURL(url, response, WebString::fromUTF8(filePath));
    65 }
    66 
    6749void loadFrame(WebFrame* frame, const std::string& url)
    6850{
    6951    WebURLRequest urlRequest;
    7052    urlRequest.initialize();
    71     urlRequest.setURL(GURL(url));
     53    urlRequest.setURL(URLTestHelpers::toKURL(url));
    7254    frame->loadRequest(urlRequest);
    7355}
  • trunk/Source/WebKit/chromium/tests/FrameTestHelpers.h

    r121408 r121463  
    3434#include <string>
    3535
    36 class GURL;
    37 
    3836namespace WebKit {
    3937
     
    4543namespace FrameTestHelpers {
    4644
    47 void registerMockedURLLoad(const std::string& base, const std::string& fileName);
    48 // Like the previous overload, but it allows more flexibility in the url since it is given by the caller.
    49 void registerMockedURLLoad(GURL, const std::string& fileName);
    50 
    5145void loadFrame(WebFrame*, const std::string& url);
    5246
  • trunk/Source/WebKit/chromium/tests/ListenerLeakTest.cpp

    r121408 r121463  
    3232
    3333#include "FrameTestHelpers.h"
     34#include "URLTestHelpers.h"
    3435#include "WebView.h"
    3536#include <gtest/gtest.h>
     
    9192        std::string fileName(filename);
    9293        bool executeScript = true;
    93         FrameTestHelpers::registerMockedURLLoad(baseURL, fileName);
     94        URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(baseURL.c_str()), WebString::fromUTF8(fileName.c_str()));
    9495        m_webView = FrameTestHelpers::createWebViewAndLoad(baseURL + fileName, executeScript);
    9596    }
  • trunk/Source/WebKit/chromium/tests/PopupMenuTest.cpp

    r121408 r121463  
    4444#include "PopupMenuChromium.h"
    4545#include "RuntimeEnabledFeatures.h"
     46#include "URLTestHelpers.h"
    4647#include "WebDocument.h"
    4748#include "WebElement.h"
     
    6465using namespace WebCore;
    6566using namespace WebKit;
     67using WebKit::URLTestHelpers::toKURL;
    6668
    6769namespace {
     
    250252    void registerMockedURLLoad(const std::string& fileName)
    251253    {
    252         WebURLResponse response;
    253         response.initialize();
    254         response.setMIMEType("text/html");
    255 
    256         std::string filePath = webkit_support::GetWebKitRootDir().utf8();
    257         filePath += "/Source/WebKit/chromium/tests/data/popup/";
    258         filePath += fileName;
    259 
    260         webkit_support::RegisterMockedURL(WebURL(GURL(baseURL + fileName)), response, WebString::fromUTF8(filePath));
     254        URLTestHelpers::registerMockedURLLoad(toKURL(baseURL + fileName), WebString::fromUTF8(fileName.c_str()), WebString::fromUTF8("popup/"), WebString::fromUTF8("text/html"));
    261255    }
    262256
     
    270264        WebURLRequest urlRequest;
    271265        urlRequest.initialize();
    272         urlRequest.setURL(WebURL(GURL(baseURL + fileName)));
     266        urlRequest.setURL(WebURL(toKURL(baseURL + fileName)));
    273267        frame->loadRequest(urlRequest);
    274268    }
     
    428422    // mousedown event is held by select node, and we don't simulate the event for the node.
    429423    // So we can only see mouseup and click event.
    430     EXPECT_STREQ("upclick", std::string(element.innerText().utf8()).c_str());
     424    EXPECT_STREQ("upclick", element.innerText().utf8().data());
    431425
    432426    // Disable the item at index 1.
     
    440434
    441435    // The item at index 1 is disabled, so the text should not be changed.
    442     EXPECT_STREQ("upclick", std::string(element.innerText().utf8()).c_str());
     436    EXPECT_STREQ("upclick", element.innerText().utf8().data());
    443437
    444438    showPopup();
     
    449443
    450444    // The item is changed to the item at index 2, from index 0, so change event is fired.
    451     EXPECT_STREQ("upclickchangeupclick", std::string(element.innerText().utf8()).c_str());
     445    EXPECT_STREQ("upclickchangeupclick", element.innerText().utf8().data());
    452446}
    453447
     
    470464    WebElement element = m_webView->mainFrame()->document().getElementById("message");
    471465    // We only can see change event but no other mouse related events.
    472     EXPECT_STREQ("change", std::string(element.innerText().utf8()).c_str());
     466    EXPECT_STREQ("change", element.innerText().utf8().data());
    473467}
    474468
     
    492486
    493487    WebElement element = m_webView->mainFrame()->document().getElementById("message");
    494     EXPECT_STREQ("change", std::string(element.innerText().utf8()).c_str());
     488    EXPECT_STREQ("change", element.innerText().utf8().data());
    495489}
    496490
     
    514508
    515509    WebElement element = m_webView->mainFrame()->document().getElementById("message");
    516     EXPECT_STREQ("click", std::string(element.innerText().utf8()).c_str());
     510    EXPECT_STREQ("click", element.innerText().utf8().data());
    517511}
    518512
  • trunk/Source/WebKit/chromium/tests/RunAllTests.cpp

    r121408 r121463  
    2828 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2929 */
     30
     31#include "config.h"
    3032
    3133// FIXME: Avoid this source dependency on Chromium's base module.
  • trunk/Source/WebKit/chromium/tests/URLTestHelpers.h

    r121459 r121463  
    11/*
    2  * Copyright (C) 2011 Google Inc. All rights reserved.
     2 * Copyright (C) 2012 Google Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2828 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2929 */
    30 #ifndef WebDOMMessageEvent_h
    31 #define WebDOMMessageEvent_h
    3230
    33 #include "WebDOMEvent.h"
    34 #include "WebMessagePortChannel.h"
    35 #include "platform/WebSerializedScriptValue.h"
     31#ifndef URLTestHelpers_h
     32#define URLTestHelpers_h
    3633
    37 #if WEBKIT_IMPLEMENTATION
    38 #include "Event.h"
    39 #include "MessageEvent.h"
    40 #endif
     34#include "KURL.h"
     35#include <public/WebString.h>
    4136
    4237namespace WebKit {
    4338
    44 class WebFrame;
    45 class WebString;
     39class WebURL;
    4640
    47 class WebDOMMessageEvent : public WebDOMEvent {
    48 public:
    49     WEBKIT_EXPORT void initMessageEvent(const WebString& type, bool canBubble, bool cancelable, const WebSerializedScriptValue& messageData, const WebString& origin, const WebFrame* sourceFrame, const WebString& lastEventId);
     41namespace URLTestHelpers {
    5042
    51     WEBKIT_EXPORT WebSerializedScriptValue data() const;
    52     WEBKIT_EXPORT WebString origin() const;
     43inline WebCore::KURL toKURL(const std::string& url)
     44{
     45    WTF::String wtfString(url.c_str());
     46    return WebCore::KURL(WebCore::ParsedURLString, wtfString);
     47}
    5348
    54 #if WEBKIT_IMPLEMENTATION
    55     explicit WebDOMMessageEvent(const WTF::PassRefPtr<WebCore::MessageEvent>& e) : WebDOMEvent(e) { }
    56 #endif
    57 };
     49// Helper functions for mock URLs. These functions set up the desired URL and mimeType, with a 200 OK return status.
     50// For the mock URL, fullURL == baseURL + fileName.
     51// For the actual file path:  <WebKit root directory> + relativeBaseDirectory + fileName,
     52// or, if the relative base directory is not specified:  <WebKit root directory> + fileName.
     53//
     54void registerMockedURLFromBaseURL(const WebString& baseURL, const WebString& fileName, const WebString& mimeType = WebString::fromUTF8("text/html"));
     55void registerMockedURLLoad(const WebURL& fullURL, const WebString& fileName, const WebString& mimeType = WebString::fromUTF8("text/html"));
     56void registerMockedURLLoad(const WebURL& fullURL, const WebString& fileName, const WebString& relativeBaseDirectory, const WebString& mimeType);
    5857
     58} // namespace URLTestHelpers
    5959} // namespace WebKit
    6060
  • trunk/Source/WebKit/chromium/tests/WebFrameTest.cpp

    r121434 r121463  
    3737#include "FrameView.h"
    3838#include "ResourceError.h"
     39#include "URLTestHelpers.h"
    3940#include "WebDataSource.h"
    4041#include "WebDocument.h"
     
    5657
    5758using namespace WebKit;
     59using WebKit::URLTestHelpers::toKURL;
    5860
    5961namespace {
     
    7476    void registerMockedHttpURLLoad(const std::string& fileName)
    7577    {
    76         FrameTestHelpers::registerMockedURLLoad(m_baseURL, fileName);
     78        URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c_str()), WebString::fromUTF8(fileName.c_str()));
    7779    }
    7880
    7981    void registerMockedChromeURLLoad(const std::string& fileName)
    8082    {
    81         FrameTestHelpers::registerMockedURLLoad(m_chromeURL, fileName);
     83        URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_chromeURL.c_str()), WebString::fromUTF8(fileName.c_str()));
    8284    }
    8385
     
    9799
    98100    // Now retrieve the frames text and test it only includes visible elements.
    99     std::string content = webView->mainFrame()->contentAsText(1024).utf8();
     101    std::string content = std::string(webView->mainFrame()->contentAsText(1024).utf8().data());
    100102    EXPECT_NE(std::string::npos, content.find(" visible paragraph"));
    101103    EXPECT_NE(std::string::npos, content.find(" visible iframe"));
     
    157159
    158160    // Now retrieve the frame's text and ensure it was modified by running javascript.
    159     std::string content = webView->mainFrame()->contentAsText(1024).utf8();
     161    std::string content = std::string(webView->mainFrame()->contentAsText(1024).utf8().data());
    160162    EXPECT_NE(std::string::npos, content.find("Clobbered"));
    161163}
     
    176178
    177179    // Now retrieve the frame's text and ensure it wasn't modified by running javascript.
    178     std::string content = webView->mainFrame()->contentAsText(1024).utf8();
     180    std::string content = std::string(webView->mainFrame()->contentAsText(1024).utf8().data());
    179181    EXPECT_EQ(std::string::npos, content.find("Clobbered"));
    180182}
     
    188190   
    189191    // Send a message with the correct origin.
    190     WebSecurityOrigin correctOrigin(WebSecurityOrigin::create(GURL(m_baseURL)));
     192    WebSecurityOrigin correctOrigin(WebSecurityOrigin::create(toKURL(m_baseURL)));
    191193    WebDOMEvent event = webView->mainFrame()->document().createEvent("MessageEvent");
    192194    WebDOMMessageEvent message = event.to<WebDOMMessageEvent>();
     
    196198
    197199    // Send another message with incorrect origin.
    198     WebSecurityOrigin incorrectOrigin(WebSecurityOrigin::create(GURL(m_chromeURL)));
     200    WebSecurityOrigin incorrectOrigin(WebSecurityOrigin::create(toKURL(m_chromeURL)));
    199201    webView->mainFrame()->dispatchMessageEventWithOriginCheck(incorrectOrigin, message);
    200202
     
    203205
    204206    // Verify that only the first addition is in the body of the page.
    205     std::string content = webView->mainFrame()->contentAsText(1024).utf8();
     207    std::string content = std::string(webView->mainFrame()->contentAsText(1024).utf8().data());
    206208    EXPECT_NE(std::string::npos, content.find("Message 1."));
    207209    EXPECT_EQ(std::string::npos, content.find("Message 2."));
     
    442444
    443445    // Reload the page using the cache.
    444     webViewImpl->mainFrame()->reloadWithOverrideURL(GURL(m_baseURL + secondURL), false);
     446    webViewImpl->mainFrame()->reloadWithOverrideURL(toKURL(m_baseURL + secondURL), false);
    445447    webkit_support::ServeAsynchronousMockedRequests();
    446448    ASSERT_EQ(previousOffset, webViewImpl->mainFrame()->scrollOffset());
     
    448450
    449451    // Reload the page while ignoring the cache.
    450     webViewImpl->mainFrame()->reloadWithOverrideURL(GURL(m_baseURL + thirdURL), true);
     452    webViewImpl->mainFrame()->reloadWithOverrideURL(toKURL(m_baseURL + thirdURL), true);
    451453    webkit_support::ServeAsynchronousMockedRequests();
    452454    ASSERT_EQ(previousOffset, webViewImpl->mainFrame()->scrollOffset());
     
    470472    iframeDataSource->redirectChain(redirects);
    471473    ASSERT_EQ(2U, redirects.size());
    472     EXPECT_EQ(GURL("about:blank"), GURL(redirects[0]));
    473     EXPECT_EQ(GURL("http://www.test.com/visible_iframe.html"), GURL(redirects[1]));
     474    EXPECT_EQ(toKURL("about:blank"), toKURL(redirects[0].spec().data()));
     475    EXPECT_EQ(toKURL("http://www.test.com/visible_iframe.html"), toKURL(redirects[1].spec().data()));
    474476
    475477    webView->close();
     
    732734    // Generate a simple test case.
    733735    const char simpleSource[] = "<div>Foo bar</div><div></div>baz";
    734     GURL testURL("about:blank");
     736    WebCore::KURL testURL = toKURL("about:blank");
    735737    frame->loadHTMLString(simpleSource, testURL);
    736738    webkit_support::RunAllPendingMessages();
     
    739741    const std::string expected("Foo bar\nbaz");
    740742    WebString text = frame->contentAsText(std::numeric_limits<size_t>::max());
    741     EXPECT_EQ(expected, std::string(text.utf8()));
     743    EXPECT_EQ(expected, std::string(text.utf8().data()));
    742744
    743745    // Try reading the same one with clipping of the text.
    744746    const int length = 5;
    745747    text = frame->contentAsText(length);
    746     EXPECT_EQ(expected.substr(0, length), std::string(text.utf8()));
     748    EXPECT_EQ(expected.substr(0, length), std::string(text.utf8().data()));
    747749
    748750    // Now do a new test with a subframe.
     
    758760
    759761    text = frame->contentAsText(std::numeric_limits<size_t>::max());
    760     EXPECT_EQ("Hello world\n\nsub\ntext", std::string(text.utf8()));
     762    EXPECT_EQ("Hello world\n\nsub\ntext", std::string(text.utf8().data()));
    761763
    762764    // Get the frame text where the subframe separator falls on the boundary of
    763765    // what we'll take. There used to be a crash in this case.
    764766    text = frame->contentAsText(12);
    765     EXPECT_EQ("Hello world", std::string(text.utf8()));
     767    EXPECT_EQ("Hello world", std::string(text.utf8().data()));
    766768
    767769    webView->close();
     
    775777    // Generate a simple test case.
    776778    const char simpleSource[] = "<p>Hello</p><p>World</p>";
    777     GURL testURL("about:blank");
     779    WebCore::KURL testURL = toKURL("about:blank");
    778780    frame->loadHTMLString(simpleSource, testURL);
    779781    webkit_support::RunAllPendingMessages();
    780782
    781783    WebString text = frame->contentAsText(std::numeric_limits<size_t>::max());
    782     EXPECT_EQ("Hello\n\nWorld", std::string(text.utf8()));
    783 
    784     const std::string html = frame->contentAsMarkup().utf8();
     784    EXPECT_EQ("Hello\n\nWorld", std::string(text.utf8().data()));
     785
     786    const std::string html = std::string(frame->contentAsMarkup().utf8().data());
    785787
    786788    // Load again with the output html.
    787     frame->loadHTMLString(html, testURL);
     789    frame->loadHTMLString(WebData(html.c_str(), html.length()), testURL);
    788790    webkit_support::RunAllPendingMessages();
    789791
    790     EXPECT_EQ(html, std::string(frame->contentAsMarkup().utf8()));
     792    EXPECT_EQ(html, std::string(frame->contentAsMarkup().utf8().data()));
    791793
    792794    text = frame->contentAsText(std::numeric_limits<size_t>::max());
    793     EXPECT_EQ("Hello\n\nWorld", std::string(text.utf8()));
     795    EXPECT_EQ("Hello\n\nWorld", std::string(text.utf8().data()));
    794796
    795797    // Test selection check
  • trunk/Source/WebKit/chromium/tests/WebPageNewSerializerTest.cpp

    r121408 r121463  
    3131#include "config.h"
    3232
     33#include "URLTestHelpers.h"
    3334#include "WebFrame.h"
    3435#include "WebFrameClient.h"
     
    4243#include "WebView.h"
    4344
    44 #include <googleurl/src/gurl.h>
    4545#include <gtest/gtest.h>
    4646#include <webkit/support/webkit_support.h>
    4747
    4848using namespace WebKit;
     49using WebKit::URLTestHelpers::toKURL;
     50using WebKit::URLTestHelpers::registerMockedURLLoad;
    4951
    5052namespace {
     
    111113    }
    112114
    113     void registerMockedURLLoad(const WebURL& url, const WebString& fileName, const WebString& mimeType)
    114     {
    115         WebURLResponse response;
    116         response.initialize();
    117         response.setMIMEType(mimeType);
    118         response.setHTTPStatusCode(200);
    119         std::string filePath = webkit_support::GetWebKitRootDir().utf8();
    120         filePath.append("/Source/WebKit/chromium/tests/data/pageserializer/");
    121         filePath.append(fileName.utf8());
    122         webkit_support::RegisterMockedURL(url, response, WebString::fromUTF8(filePath));
    123     }
    124 
    125115    WebURL setUpCSSTestPage()
    126116    {
    127         WebURL topFrameURL = GURL("http://www.test.com");
    128         registerMockedURLLoad(topFrameURL, WebString::fromUTF8("css_test_page.html"), htmlMimeType());
    129         registerMockedURLLoad(GURL("http://www.test.com/link_styles.css"), WebString::fromUTF8("link_styles.css"), cssMimeType());
    130         registerMockedURLLoad(GURL("http://www.test.com/import_style_from_link.css"), WebString::fromUTF8("import_style_from_link.css"), cssMimeType());
    131         registerMockedURLLoad(GURL("http://www.test.com/import_styles.css"), WebString::fromUTF8("import_styles.css"), cssMimeType());
    132         registerMockedURLLoad(GURL("http://www.test.com/red_background.png"), WebString::fromUTF8("red_background.png"), pngMimeType());
    133         registerMockedURLLoad(GURL("http://www.test.com/orange_background.png"), WebString::fromUTF8("orange_background.png"), pngMimeType());
    134         registerMockedURLLoad(GURL("http://www.test.com/yellow_background.png"), WebString::fromUTF8("yellow_background.png"), pngMimeType());
    135         registerMockedURLLoad(GURL("http://www.test.com/green_background.png"), WebString::fromUTF8("green_background.png"), pngMimeType());
    136         registerMockedURLLoad(GURL("http://www.test.com/blue_background.png"), WebString::fromUTF8("blue_background.png"), pngMimeType());
    137         registerMockedURLLoad(GURL("http://www.test.com/purple_background.png"), WebString::fromUTF8("purple_background.png"), pngMimeType());
    138         registerMockedURLLoad(GURL("http://www.test.com/ul-dot.png"), WebString::fromUTF8("ul-dot.png"), pngMimeType());
    139         registerMockedURLLoad(GURL("http://www.test.com/ol-dot.png"), WebString::fromUTF8("ol-dot.png"), pngMimeType());
     117        WebURL topFrameURL = toKURL("http://www.test.com");
     118        registerMockedURLLoad(topFrameURL, WebString::fromUTF8("css_test_page.html"), WebString::fromUTF8("pageserializer/"), htmlMimeType());
     119        registerMockedURLLoad(toKURL("http://www.test.com/link_styles.css"), WebString::fromUTF8("link_styles.css"), WebString::fromUTF8("pageserializer/"), cssMimeType());
     120        registerMockedURLLoad(toKURL("http://www.test.com/import_style_from_link.css"), WebString::fromUTF8("import_style_from_link.css"), WebString::fromUTF8("pageserializer/"), cssMimeType());
     121        registerMockedURLLoad(toKURL("http://www.test.com/import_styles.css"), WebString::fromUTF8("import_styles.css"), WebString::fromUTF8("pageserializer/"), cssMimeType());
     122        registerMockedURLLoad(toKURL("http://www.test.com/red_background.png"), WebString::fromUTF8("red_background.png"), WebString::fromUTF8("pageserializer/"), pngMimeType());
     123        registerMockedURLLoad(toKURL("http://www.test.com/orange_background.png"), WebString::fromUTF8("orange_background.png"), WebString::fromUTF8("pageserializer/"), pngMimeType());
     124        registerMockedURLLoad(toKURL("http://www.test.com/yellow_background.png"), WebString::fromUTF8("yellow_background.png"), WebString::fromUTF8("pageserializer/"), pngMimeType());
     125        registerMockedURLLoad(toKURL("http://www.test.com/green_background.png"), WebString::fromUTF8("green_background.png"), WebString::fromUTF8("pageserializer/"), pngMimeType());
     126        registerMockedURLLoad(toKURL("http://www.test.com/blue_background.png"), WebString::fromUTF8("blue_background.png"), WebString::fromUTF8("pageserializer/"), pngMimeType());
     127        registerMockedURLLoad(toKURL("http://www.test.com/purple_background.png"), WebString::fromUTF8("purple_background.png"), WebString::fromUTF8("pageserializer/"), pngMimeType());
     128        registerMockedURLLoad(toKURL("http://www.test.com/ul-dot.png"), WebString::fromUTF8("ul-dot.png"), WebString::fromUTF8("pageserializer/"), pngMimeType());
     129        registerMockedURLLoad(toKURL("http://www.test.com/ol-dot.png"), WebString::fromUTF8("ol-dot.png"), WebString::fromUTF8("pageserializer/"), pngMimeType());
    140130        return topFrameURL;
    141131    }
    142132
    143     void loadURLInTopFrame(const GURL& url)
     133    void loadURLInTopFrame(const WebURL& url)
    144134    {
    145135        WebURLRequest urlRequest;
    146136        urlRequest.initialize();
    147         urlRequest.setURL(WebURL(url));
     137        urlRequest.setURL(url);
    148138        m_webView->mainFrame()->loadRequest(urlRequest);
    149139        // Make sure any pending request get served.
     
    162152    static bool resourceVectorContains(const WebVector<WebPageSerializer::Resource>& resources, const char* url, const char* mimeType)
    163153    {
    164         WebURL webURL = WebURL(GURL(url));
     154        WebURL webURL = WebURL(toKURL(url));
    165155        for (size_t i = 0; i < resources.size(); ++i) {
    166156            const WebPageSerializer::Resource& resource = resources[i];
     
    185175{
    186176    // Register the mocked frames.
    187     WebURL topFrameURL = GURL("http://www.test.com");
    188     registerMockedURLLoad(topFrameURL, WebString::fromUTF8("top_frame.html"), htmlMimeType());
    189     registerMockedURLLoad(GURL("http://www.test.com/iframe.html"), WebString::fromUTF8("iframe.html"), htmlMimeType());
    190     registerMockedURLLoad(GURL("http://www.test.com/iframe2.html"), WebString::fromUTF8("iframe2.html"), htmlMimeType());
    191     registerMockedURLLoad(GURL("http://www.test.com/red_background.png"), WebString::fromUTF8("red_background.png"), pngMimeType());
    192     registerMockedURLLoad(GURL("http://www.test.com/green_background.png"), WebString::fromUTF8("green_background.png"), pngMimeType());
    193     registerMockedURLLoad(GURL("http://www.test.com/blue_background.png"), WebString::fromUTF8("blue_background.png"), pngMimeType());
     177    WebURL topFrameURL = toKURL("http://www.test.com");
     178    registerMockedURLLoad(topFrameURL, WebString::fromUTF8("top_frame.html"), WebString::fromUTF8("pageserializer/"), htmlMimeType());
     179    registerMockedURLLoad(toKURL("http://www.test.com/iframe.html"), WebString::fromUTF8("iframe.html"), WebString::fromUTF8("pageserializer/"), htmlMimeType());
     180    registerMockedURLLoad(toKURL("http://www.test.com/iframe2.html"), WebString::fromUTF8("iframe2.html"), WebString::fromUTF8("pageserializer/"), htmlMimeType());
     181    registerMockedURLLoad(toKURL("http://www.test.com/red_background.png"), WebString::fromUTF8("red_background.png"), WebString::fromUTF8("pageserializer/"), pngMimeType());
     182    registerMockedURLLoad(toKURL("http://www.test.com/green_background.png"), WebString::fromUTF8("green_background.png"), WebString::fromUTF8("pageserializer/"), pngMimeType());
     183    registerMockedURLLoad(toKURL("http://www.test.com/blue_background.png"), WebString::fromUTF8("blue_background.png"), WebString::fromUTF8("pageserializer/"), pngMimeType());
    194184
    195185    loadURLInTopFrame(topFrameURL);
     
    201191    // The first resource should be the main-frame.
    202192    const WebPageSerializer::Resource& resource = resources[0];
    203     EXPECT_TRUE(resource.url == GURL("http://www.test.com"));
     193    EXPECT_TRUE(resource.url == WebURL(toKURL("http://www.test.com")));
    204194    EXPECT_EQ(0, resource.mimeType.compare(WebCString("text/html")));
    205195    EXPECT_FALSE(resource.data.isEmpty());
     
    228218    // The first resource should be the main-frame.
    229219    const WebPageSerializer::Resource& resource = resources[0];
    230     EXPECT_TRUE(resource.url == GURL("http://www.test.com"));
     220    EXPECT_TRUE(resource.url == WebURL(toKURL("http://www.test.com")));
    231221    EXPECT_EQ(0, resource.mimeType.compare(WebCString("text/html")));
    232222    EXPECT_FALSE(resource.data.isEmpty());
     
    250240{
    251241    // Register the mocked frame and load it.
    252     WebURL topFrameURL = GURL("http://www.test.com");
    253     registerMockedURLLoad(topFrameURL, WebString::fromUTF8("blank_frames.html"), htmlMimeType());
    254     registerMockedURLLoad(GURL("http://www.test.com/red_background.png"), WebString::fromUTF8("red_background.png"), pngMimeType());
    255     registerMockedURLLoad(GURL("http://www.test.com/orange_background.png"), WebString::fromUTF8("orange_background.png"), pngMimeType());
    256     registerMockedURLLoad(GURL("http://www.test.com/blue_background.png"), WebString::fromUTF8("blue_background.png"), pngMimeType());
     242    WebURL topFrameURL = toKURL("http://www.test.com");
     243    registerMockedURLLoad(topFrameURL, WebString::fromUTF8("blank_frames.html"), WebString::fromUTF8("pageserializer/"), htmlMimeType());
     244    registerMockedURLLoad(toKURL("http://www.test.com/red_background.png"), WebString::fromUTF8("red_background.png"), WebString::fromUTF8("pageserializer/"), pngMimeType());
     245    registerMockedURLLoad(toKURL("http://www.test.com/orange_background.png"), WebString::fromUTF8("orange_background.png"), WebString::fromUTF8("pageserializer/"), pngMimeType());
     246    registerMockedURLLoad(toKURL("http://www.test.com/blue_background.png"), WebString::fromUTF8("blue_background.png"), WebString::fromUTF8("pageserializer/"), pngMimeType());
    257247
    258248    loadURLInTopFrame(topFrameURL);
     
    264254    // The first resource should be the main-frame.
    265255    const WebPageSerializer::Resource& resource = resources[0];
    266     EXPECT_TRUE(resource.url == GURL("http://www.test.com"));
     256    EXPECT_TRUE(resource.url == WebURL(toKURL("http://www.test.com")));
    267257    EXPECT_EQ(0, resource.mimeType.compare(WebCString("text/html")));
    268258    EXPECT_FALSE(resource.data.isEmpty());
     
    280270TEST_F(WebPageNewSerializeTest, SerializeXMLHasRightDeclaration)
    281271{
    282     WebURL topFrameURL = GURL("http://www.test.com/simple.xhtml");
    283     registerMockedURLLoad(topFrameURL, WebString::fromUTF8("simple.xhtml"), xhtmlMimeType());
     272    WebURL topFrameURL = toKURL("http://www.test.com/simple.xhtml");
     273    registerMockedURLLoad(topFrameURL, WebString::fromUTF8("simple.xhtml"), WebString::fromUTF8("pageserializer/"), xhtmlMimeType());
    284274
    285275    loadURLInTopFrame(topFrameURL);
     
    291281    // We expect only one resource, the XML.
    292282    ASSERT_EQ(1U, resources.size());
    293     std::string xml = resources[0].data;
     283    std::string xml = std::string(resources[0].data.data());
    294284
    295285    // We should have one and only one instance of the XML declaration.
     
    311301
    312302    // Read the MHTML data line per line and do some pseudo-parsing to make sure the right encoding is used for the different sections.
    313     LineReader lineReader(mhtmlData);
     303    LineReader lineReader(std::string(mhtmlData.data()));
    314304    int sectionCheckedCount = 0;
    315305    const char* expectedEncoding = 0;
  • trunk/Source/WebKit/chromium/tests/WebPageSerializerTest.cpp

    r121408 r121463  
    3232#include "WebPageSerializer.h"
    3333
     34#include "URLTestHelpers.h"
    3435#include "WebFrame.h"
    3536#include "WebFrameClient.h"
     
    4041#include "WebView.h"
    4142
    42 #include <googleurl/src/gurl.h>
    4343#include <gtest/gtest.h>
    4444#include <webkit/support/webkit_support.h>
    4545
    4646using namespace WebKit;
     47using WebKit::URLTestHelpers::toKURL;
    4748
    4849namespace {
     
    7475    }
    7576
    76     void registerMockedURLLoad(const WebURL& url, const WebString& fileName)
     77    void registerMockedURLLoad(const std::string& url, const WebString& fileName)
    7778    {
    78         WebURLResponse response;
    79         response.initialize();
    80         response.setMIMEType("text/html");
    81         std::string filePath = webkit_support::GetWebKitRootDir().utf8();
    82         filePath.append("/Source/WebKit/chromium/tests/data/pageserialization/");
    83         filePath.append(fileName.utf8());
    84         webkit_support::RegisterMockedURL(url, response, WebString::fromUTF8(filePath));
     79        URLTestHelpers::registerMockedURLLoad(toKURL(url), fileName, WebString::fromUTF8("pageserialization/"), WebString::fromUTF8("text/html"));
    8580    }
    8681
    87     void loadURLInTopFrame(const GURL& url)
     82    void loadURLInTopFrame(const WebURL& url)
    8883    {
    8984        WebURLRequest urlRequest;
    9085        urlRequest.initialize();
    91         urlRequest.setURL(WebURL(url));
     86        urlRequest.setURL(url);
    9287        m_webView->mainFrame()->loadRequest(urlRequest);
    9388        // Make sure any pending request get served.
     
    9792    static bool webVectorContains(const WebVector<WebURL>& vector, const char* url)
    9893    {
    99         return vector.contains(WebURL(GURL(url)));
     94        return vector.contains(WebURL(toKURL(std::string(url))));
    10095    }
    10196
     
    117112{
    118113    // Register the mocked frame and load it.
    119     WebURL topFrameURL = GURL("http://www.test.com");
    120     registerMockedURLLoad(topFrameURL, WebString::fromUTF8("simple_page.html"));
     114    WebURL topFrameURL = toKURL("http://www.test.com");
     115    registerMockedURLLoad("http://www.test.com", WebString::fromUTF8("simple_page.html"));
    121116    loadURLInTopFrame(topFrameURL);
    122117
     
    151146{
    152147    // Register the mocked frames.
    153     WebURL topFrameURL = GURL("http://www.test.com");
    154     registerMockedURLLoad(topFrameURL, WebString::fromUTF8("top_frame.html"));
    155     registerMockedURLLoad(GURL("http://www.test.com/simple_iframe.html"),
     148    WebURL topFrameURL = toKURL("http://www.test.com");
     149    registerMockedURLLoad("http://www.test.com", WebString::fromUTF8("top_frame.html"));
     150    registerMockedURLLoad("http://www.test.com/simple_iframe.html",
    156151                          WebString::fromUTF8("simple_iframe.html"));
    157     registerMockedURLLoad(GURL("http://www.test.com/object_iframe.html"),
     152    registerMockedURLLoad("http://www.test.com/object_iframe.html",
    158153                          WebString::fromUTF8("object_iframe.html"));
    159     registerMockedURLLoad(GURL("http://www.test.com/embed_iframe.html"),
     154    registerMockedURLLoad("http://www.test.com/embed_iframe.html",
    160155                          WebString::fromUTF8("embed_iframe.html"));
    161156    // If we don't register a mocked resource for awesome.png, it causes the
    162157    // document loader of the iframe that has it as its src to assert on close,
    163158    // not sure why.
    164     registerMockedURLLoad(GURL("http://www.test.com/awesome.png"),
     159    registerMockedURLLoad("http://www.test.com/awesome.png",
    165160                          WebString::fromUTF8("awesome.png"));
    166161
  • trunk/Source/WebKit/chromium/tests/WebViewTest.cpp

    r121451 r121463  
    3636#include "FrameView.h"
    3737#include "HTMLDocument.h"
     38#include "URLTestHelpers.h"
    3839#include "WebDocument.h"
    3940#include "WebFrame.h"
     
    4344#include "WebViewClient.h"
    4445#include "WebViewImpl.h"
    45 #include <googleurl/src/gurl.h>
    4646#include <gtest/gtest.h>
    4747#include <webkit/support/webkit_support.h>
    4848
    4949using namespace WebKit;
     50using WebKit::URLTestHelpers::toKURL;
    5051
    5152namespace {
     
    118119TEST_F(WebViewTest, FocusIsInactive)
    119120{
    120     FrameTestHelpers::registerMockedURLLoad(m_baseURL, "visible_iframe.html");
     121    URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c_str()), "visible_iframe.html");
    121122    WebView* webView = FrameTestHelpers::createWebViewAndLoad(m_baseURL + "visible_iframe.html");
    122123
     
    146147TEST_F(WebViewTest, ActiveState)
    147148{
    148     FrameTestHelpers::registerMockedURLLoad(m_baseURL, "visible_iframe.html");
     149    URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c_str()), "visible_iframe.html");
    149150    WebView* webView = FrameTestHelpers::createWebViewAndLoad(m_baseURL + "visible_iframe.html");
    150151
     
    170171    AutoResizeWebViewClient client;
    171172    std::string url = m_baseURL + "specify_size.html?" + pageWidth + ":" + pageHeight;
    172     FrameTestHelpers::registerMockedURLLoad(GURL(url), "specify_size.html");
     173    URLTestHelpers::registerMockedURLLoad(toKURL(url), "specify_size.html");
    173174    WebView* webView = FrameTestHelpers::createWebViewAndLoad(url, true, 0, &client);
    174175    client.testData().setWebView(webView);
     
    269270void WebViewTest::testTextInputType(WebTextInputType expectedType, const std::string& htmlFile)
    270271{
    271     FrameTestHelpers::registerMockedURLLoad(m_baseURL, htmlFile);
     272    URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c_str()), WebString::fromUTF8(htmlFile.c_str()));
    272273    WebView* webView = FrameTestHelpers::createWebViewAndLoad(m_baseURL + htmlFile);
    273274    webView->setInitialFocus(false);
     
    309310TEST_F(WebViewTest, SetEditableSelectionOffsetsAndTextInputInfo)
    310311{
    311     FrameTestHelpers::registerMockedURLLoad(m_baseURL, "input_field_populated.html");
     312    URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c_str()), WebString::fromUTF8("input_field_populated.html"));
    312313    WebView* webView = FrameTestHelpers::createWebViewAndLoad(m_baseURL + "input_field_populated.html");
    313314    webView->setInitialFocus(false);
     
    323324    webView->close();
    324325
    325     FrameTestHelpers::registerMockedURLLoad(m_baseURL, "content_editable_populated.html");
     326    URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c_str()), WebString::fromUTF8("content_editable_populated.html"));
    326327    webView = FrameTestHelpers::createWebViewAndLoad(m_baseURL + "content_editable_populated.html");
    327328    webView->setInitialFocus(false);
Note: See TracChangeset for help on using the changeset viewer.