Changeset 126030 in webkit


Ignore:
Timestamp:
Aug 20, 2012 8:10:55 AM (12 years ago)
Author:
Carlos Garcia Campos
Message:

[GTK] Replace webkit_web_view_replace_content with webkit_web_view_load_alternate_html
https://bugs.webkit.org/show_bug.cgi?id=94471

Reviewed by Martin Robinson.

In WebKit1 there's code to prevent that load signals are emitted
when loading internal custom error pages. We added
webkit_web_view_replace_content() with the same idea, but it has
ended up being problematic, because it allows to add any HTML
content (in WebKit1 we assumed internal error pages never failed
and always loaded) and it's impossible to know when the load has
finished. It also required a lot of logic to handle
replace_content as an especial case, in order to hide the fact
that it loads content. This patch renames
webkit_web_view_replace_content() as
webkit_web_view_load_alternate_html() and emit load events
normally.

  • UIProcess/API/gtk/WebKitWebView.cpp:

(_WebKitWebViewPrivate):
(webkitWebViewLoadChanged):
(webkitWebViewLoadFailed):
(webkitWebViewSetEstimatedLoadProgress):
(webkitWebViewResourceLoadStarted):
(webkitWebViewGetLoadingWebResource):
(webkitWebViewRemoveLoadingWebResource):
(webkitWebViewResourceLoadFinished):
(webkit_web_view_load_alternate_html):

  • UIProcess/API/gtk/WebKitWebView.h:
  • UIProcess/API/gtk/docs/webkit2gtk-sections.txt:
  • UIProcess/API/gtk/tests/TestLoaderClient.cpp:

(testLoadAlternateHTML):
(beforeAll):

  • UIProcess/API/gtk/tests/TestResources.cpp:

(beforeAll):

  • UIProcess/API/gtk/tests/TestWebKitWebView.cpp:

(beforeAll):

  • UIProcess/API/gtk/tests/WebViewTest.cpp:

(WebViewTest::loadAlternateHTML):

  • UIProcess/API/gtk/tests/WebViewTest.h:
Location:
trunk/Source/WebKit2
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r126019 r126030  
     12012-08-20  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        [GTK] Replace webkit_web_view_replace_content with webkit_web_view_load_alternate_html
     4        https://bugs.webkit.org/show_bug.cgi?id=94471
     5
     6        Reviewed by Martin Robinson.
     7
     8        In WebKit1 there's code to prevent that load signals are emitted
     9        when loading internal custom error pages. We added
     10        webkit_web_view_replace_content() with the same idea, but it has
     11        ended up being problematic, because it allows to add any HTML
     12        content (in WebKit1 we assumed internal error pages never failed
     13        and always loaded) and it's impossible to know when the load has
     14        finished. It also required a lot of logic to handle
     15        replace_content as an especial case, in order to hide the fact
     16        that it loads content. This patch renames
     17        webkit_web_view_replace_content() as
     18        webkit_web_view_load_alternate_html() and emit load events
     19        normally.
     20
     21        * UIProcess/API/gtk/WebKitWebView.cpp:
     22        (_WebKitWebViewPrivate):
     23        (webkitWebViewLoadChanged):
     24        (webkitWebViewLoadFailed):
     25        (webkitWebViewSetEstimatedLoadProgress):
     26        (webkitWebViewResourceLoadStarted):
     27        (webkitWebViewGetLoadingWebResource):
     28        (webkitWebViewRemoveLoadingWebResource):
     29        (webkitWebViewResourceLoadFinished):
     30        (webkit_web_view_load_alternate_html):
     31        * UIProcess/API/gtk/WebKitWebView.h:
     32        * UIProcess/API/gtk/docs/webkit2gtk-sections.txt:
     33        * UIProcess/API/gtk/tests/TestLoaderClient.cpp:
     34        (testLoadAlternateHTML):
     35        (beforeAll):
     36        * UIProcess/API/gtk/tests/TestResources.cpp:
     37        (beforeAll):
     38        * UIProcess/API/gtk/tests/TestWebKitWebView.cpp:
     39        (beforeAll):
     40        * UIProcess/API/gtk/tests/WebViewTest.cpp:
     41        (WebViewTest::loadAlternateHTML):
     42        * UIProcess/API/gtk/tests/WebViewTest.h:
     43
    1442012-08-20  Mikhail Pozdnyakov  <mikhail.pozdnyakov@intel.com>
    245
  • trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp

    r125890 r126030  
    107107};
    108108
    109 typedef enum {
    110     NotReplacingContent,
    111     WillReplaceContent,
    112     ReplacingContent,
    113     DidReplaceContent
    114 } ReplaceContentStatus;
    115 
    116109typedef HashMap<uint64_t, GRefPtr<WebKitWebResource> > LoadingResourcesMap;
    117110typedef HashMap<String, GRefPtr<WebKitWebResource> > ResourcesMap;
     
    123116    double estimatedLoadProgress;
    124117    CString activeURI;
    125     ReplaceContentStatus replaceContentStatus;
    126118
    127119    bool waitingForMainResource;
     
    160152
    161153    GOwnPtr<char> htmlString(g_strdup_printf("<html><body>%s</body></html>", error->message));
    162     webkit_web_view_replace_content(webView, htmlString.get(), failingURI, 0);
     154    webkit_web_view_load_alternate_html(webView, htmlString.get(), failingURI, 0);
    163155
    164156    return TRUE;
     
    11081100}
    11091101
    1110 static bool updateReplaceContentStatus(WebKitWebView* webView, WebKitLoadEvent loadEvent)
    1111 {
    1112     if (webView->priv->replaceContentStatus == ReplacingContent) {
    1113         if (loadEvent == WEBKIT_LOAD_FINISHED)
    1114             webView->priv->replaceContentStatus = DidReplaceContent;
    1115         return true;
    1116     }
    1117 
    1118     if (loadEvent == WEBKIT_LOAD_STARTED) {
    1119         if (webView->priv->replaceContentStatus == WillReplaceContent) {
    1120             webView->priv->replaceContentStatus = ReplacingContent;
    1121             return true;
    1122         }
    1123         webView->priv->replaceContentStatus = NotReplacingContent;
    1124     }
    1125 
    1126     return false;
    1127 }
    1128 
    11291102static void setCertificateToMainResource(WebKitWebView* webView)
    11301103{
     
    11701143    } else if (loadEvent == WEBKIT_LOAD_COMMITTED) {
    11711144        webView->priv->subresourcesMap.clear();
    1172         if (webView->priv->replaceContentStatus != ReplacingContent) {
    1173             if (!webView->priv->mainResource) {
    1174                 // When a page is loaded from the history cache, the main resource load callbacks
    1175                 // are called when the main frame load is finished. We want to make sure there's a
    1176                 // main resource available when load has been committed, so we delay the emission of
    1177                 // load-changed signal until main resource object has been created.
    1178                 webView->priv->waitingForMainResource = true;
    1179             } else
    1180                 setCertificateToMainResource(webView);
    1181         }
     1145        if (!webView->priv->mainResource) {
     1146            // When a page is loaded from the history cache, the main resource load callbacks
     1147            // are called when the main frame load is finished. We want to make sure there's a
     1148            // main resource available when load has been committed, so we delay the emission of
     1149            // load-changed signal until main resource object has been created.
     1150            webView->priv->waitingForMainResource = true;
     1151        } else
     1152            setCertificateToMainResource(webView);
    11821153    }
    1183 
    1184     if (updateReplaceContentStatus(webView, loadEvent))
    1185         return;
    11861154
    11871155    if (webView->priv->waitingForMainResource)
     
    11931161void webkitWebViewLoadFailed(WebKitWebView* webView, WebKitLoadEvent loadEvent, const char* failingURI, GError *error)
    11941162{
    1195     if (webView->priv->replaceContentStatus == ReplacingContent)
    1196         return;
    1197 
    11981163    gboolean returnValue;
    11991164    g_signal_emit(webView, signals[LOAD_FAILED], 0, loadEvent, failingURI, error, &returnValue);
     
    12131178void webkitWebViewSetEstimatedLoadProgress(WebKitWebView* webView, double estimatedLoadProgress)
    12141179{
    1215     if (webView->priv->replaceContentStatus != NotReplacingContent)
    1216         return;
    1217 
    12181180    if (webView->priv->estimatedLoadProgress == estimatedLoadProgress)
    12191181        return;
     
    13501312}
    13511313
    1352 static inline bool webkitWebViewIsReplacingContentOrDidReplaceContent(WebKitWebView* webView)
    1353 {
    1354     return (webView->priv->replaceContentStatus == ReplacingContent || webView->priv->replaceContentStatus == DidReplaceContent);
    1355 }
    1356 
    13571314void webkitWebViewResourceLoadStarted(WebKitWebView* webView, WKFrameRef wkFrame, uint64_t resourceIdentifier, WebKitURIRequest* request, bool isMainResource)
    13581315{
    1359     if (webkitWebViewIsReplacingContentOrDidReplaceContent(webView))
    1360         return;
    1361 
    13621316    WebKitWebViewPrivate* priv = webView->priv;
    13631317    WebKitWebResource* resource = webkitWebResourceCreate(wkFrame, request, isMainResource);
     
    13721326WebKitWebResource* webkitWebViewGetLoadingWebResource(WebKitWebView* webView, uint64_t resourceIdentifier)
    13731327{
    1374     if (webkitWebViewIsReplacingContentOrDidReplaceContent(webView))
    1375         return 0;
    1376 
    13771328    GRefPtr<WebKitWebResource> resource = webView->priv->loadingResourcesMap.get(resourceIdentifier);
    13781329    ASSERT(resource.get());
     
    13821333void webkitWebViewRemoveLoadingWebResource(WebKitWebView* webView, uint64_t resourceIdentifier)
    13831334{
    1384     if (webkitWebViewIsReplacingContentOrDidReplaceContent(webView))
    1385         return;
    1386 
    13871335    WebKitWebViewPrivate* priv = webView->priv;
    13881336    ASSERT(priv->loadingResourcesMap.contains(resourceIdentifier));
     
    13921340WebKitWebResource* webkitWebViewResourceLoadFinished(WebKitWebView* webView, uint64_t resourceIdentifier)
    13931341{
    1394     if (webkitWebViewIsReplacingContentOrDidReplaceContent(webView))
    1395         return 0;
    1396 
    13971342    WebKitWebViewPrivate* priv = webView->priv;
    13981343    WebKitWebResource* resource = webkitWebViewGetLoadingWebResource(webView, resourceIdentifier);
     
    15981543
    15991544/**
    1600  * webkit_web_view_load_plain_text:
    1601  * @web_view: a #WebKitWebView
    1602  * @plain_text: The plain text to load
    1603  *
    1604  * Load the specified @plain_text string into @web_view. The mime type of
    1605  * document will be "text/plain". You can monitor the load
    1606  * operation by connecting to #WebKitWebView::load-changed signal.
    1607  */
    1608 void webkit_web_view_load_plain_text(WebKitWebView* webView, const gchar* plainText)
    1609 {
    1610     g_return_if_fail(WEBKIT_IS_WEB_VIEW(webView));
    1611     g_return_if_fail(plainText);
    1612 
    1613     WebPageProxy* page = webkitWebViewBaseGetPage(WEBKIT_WEB_VIEW_BASE(webView));
    1614     WKRetainPtr<WKStringRef> plainTextRef(AdoptWK, WKStringCreateWithUTF8CString(plainText));
    1615     WKPageLoadPlainTextString(toAPI(page), plainTextRef.get());
    1616 }
    1617 
    1618 /**
    1619  * webkit_web_view_load_request:
    1620  * @web_view: a #WebKitWebView
    1621  * @request: a #WebKitURIRequest to load
    1622  *
    1623  * Requests loading of the specified #WebKitURIRequest.
    1624  * You can monitor the load operation by connecting to
    1625  * #WebKitWebView::load-changed signal.
    1626  */
    1627 void webkit_web_view_load_request(WebKitWebView* webView, WebKitURIRequest* request)
    1628 {
    1629     g_return_if_fail(WEBKIT_IS_WEB_VIEW(webView));
    1630     g_return_if_fail(WEBKIT_IS_URI_REQUEST(request));
    1631 
    1632     WKRetainPtr<WKURLRef> wkURL(AdoptWK, WKURLCreateWithUTF8CString(webkit_uri_request_get_uri(request)));
    1633     WKRetainPtr<WKURLRequestRef> wkRequest(AdoptWK, WKURLRequestCreateWithWKURL(wkURL.get()));
    1634     WebPageProxy* page = webkitWebViewBaseGetPage(WEBKIT_WEB_VIEW_BASE(webView));
    1635     WKPageLoadURLRequest(toAPI(page), wkRequest.get());
    1636     webkitWebViewUpdateURI(webView);
    1637 }
    1638 
    1639 /**
    1640  * webkit_web_view_replace_content:
     1545 * webkit_web_view_load_alternate_html:
    16411546 * @web_view: a #WebKitWebView
    16421547 * @content: the new content to display as the main page of the @web_view
    1643  * @content_uri: the URI for the page content
     1548 * @content_uri: the URI for the alternate page content
    16441549 * @base_uri: (allow-none): the base URI for relative locations or %NULL
    16451550 *
    1646  * Replace the content of @web_view with @content using @content_uri as page URI.
     1551 * Load the given @content string for the URI @content_uri.
    16471552 * This allows clients to display page-loading errors in the #WebKitWebView itself.
    1648  * This is typically called from #WebKitWebView::load-failed signal. The URI passed in
    1649  * @base_uri has to be an absolute URI. The mime type of the document will be "text/html".
    1650  * Signals #WebKitWebView::load-changed and #WebKitWebView::load-failed are not emitted
    1651  * when replacing content of a #WebKitWebView using this method.
    1652  */
    1653 void webkit_web_view_replace_content(WebKitWebView* webView, const gchar* content, const gchar* contentURI, const gchar* baseURI)
     1553 * When this method is called from #WebKitWebView::load-failed signal to show an
     1554 * error page, the the back-forward list is maintained appropriately.
     1555 * For everything else this method works the same way as webkit_web_view_load_html().
     1556 */
     1557void webkit_web_view_load_alternate_html(WebKitWebView* webView, const gchar* content, const gchar* contentURI, const gchar* baseURI)
    16541558{
    16551559    g_return_if_fail(WEBKIT_IS_WEB_VIEW(webView));
    16561560    g_return_if_fail(content);
    16571561    g_return_if_fail(contentURI);
    1658 
    1659     webView->priv->replaceContentStatus = WillReplaceContent;
    16601562
    16611563    WKRetainPtr<WKStringRef> htmlString(AdoptWK, WKStringCreateWithUTF8CString(content));
     
    16641566    WebPageProxy* page = webkitWebViewBaseGetPage(WEBKIT_WEB_VIEW_BASE(webView));
    16651567    WKPageLoadAlternateHTMLString(toAPI(page), htmlString.get(), baseURL.get(), contentURL.get());
     1568    webkitWebViewUpdateURI(webView);
     1569}
     1570
     1571/**
     1572 * webkit_web_view_load_plain_text:
     1573 * @web_view: a #WebKitWebView
     1574 * @plain_text: The plain text to load
     1575 *
     1576 * Load the specified @plain_text string into @web_view. The mime type of
     1577 * document will be "text/plain". You can monitor the load
     1578 * operation by connecting to #WebKitWebView::load-changed signal.
     1579 */
     1580void webkit_web_view_load_plain_text(WebKitWebView* webView, const gchar* plainText)
     1581{
     1582    g_return_if_fail(WEBKIT_IS_WEB_VIEW(webView));
     1583    g_return_if_fail(plainText);
     1584
     1585    WebPageProxy* page = webkitWebViewBaseGetPage(WEBKIT_WEB_VIEW_BASE(webView));
     1586    WKRetainPtr<WKStringRef> plainTextRef(AdoptWK, WKStringCreateWithUTF8CString(plainText));
     1587    WKPageLoadPlainTextString(toAPI(page), plainTextRef.get());
     1588}
     1589
     1590/**
     1591 * webkit_web_view_load_request:
     1592 * @web_view: a #WebKitWebView
     1593 * @request: a #WebKitURIRequest to load
     1594 *
     1595 * Requests loading of the specified #WebKitURIRequest.
     1596 * You can monitor the load operation by connecting to
     1597 * #WebKitWebView::load-changed signal.
     1598 */
     1599void webkit_web_view_load_request(WebKitWebView* webView, WebKitURIRequest* request)
     1600{
     1601    g_return_if_fail(WEBKIT_IS_WEB_VIEW(webView));
     1602    g_return_if_fail(WEBKIT_IS_URI_REQUEST(request));
     1603
     1604    WKRetainPtr<WKURLRef> wkURL(AdoptWK, WKURLCreateWithUTF8CString(webkit_uri_request_get_uri(request)));
     1605    WKRetainPtr<WKURLRequestRef> wkRequest(AdoptWK, WKURLRequestCreateWithWKURL(wkURL.get()));
     1606    WebPageProxy* page = webkitWebViewBaseGetPage(WEBKIT_WEB_VIEW_BASE(webView));
     1607    WKPageLoadURLRequest(toAPI(page), wkRequest.get());
    16661608    webkitWebViewUpdateURI(webView);
    16671609}
     
    18141756 *     If the load operation was started by webkit_web_view_load_html(),
    18151757 *     the requested URI is "about:blank".
     1758 *   </para></listitem>
     1759 *   <listitem><para>
     1760 *     If the load operation was started by webkit_web_view_load_alternate_html(),
     1761 *     the requested URI is content URI provided.
    18161762 *   </para></listitem>
    18171763 *   <listitem><para>
     
    18391785 *   or a navigation action within the same page is performed.
    18401786 * </para></listitem>
    1841  * <listitem><para>
    1842  *   When the page content is replaced using webkit_web_view_replace_content(),
    1843  *   the active URI is the content_uri provided.
    1844  * </para></listitem>
    18451787 * </orderedlist>
    18461788 *
  • trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.h

    r125890 r126030  
    211211                                                    const gchar               *content,
    212212                                                    const gchar               *base_uri);
    213 
    214 WEBKIT_API void
    215 webkit_web_view_load_plain_text                    (WebKitWebView             *web_view,
    216                                                     const gchar               *plain_text);
    217 
    218 WEBKIT_API void
    219 webkit_web_view_load_request                       (WebKitWebView             *web_view,
    220                                                     WebKitURIRequest          *request);
    221 
    222 WEBKIT_API void
    223 webkit_web_view_stop_loading                       (WebKitWebView             *web_view);
    224 
    225 WEBKIT_API void
    226 webkit_web_view_replace_content                    (WebKitWebView             *web_view,
     213WEBKIT_API void
     214webkit_web_view_load_alternate_html                (WebKitWebView             *web_view,
    227215                                                    const gchar               *content,
    228216                                                    const gchar               *content_uri,
    229217                                                    const gchar               *base_uri);
     218WEBKIT_API void
     219webkit_web_view_load_plain_text                    (WebKitWebView             *web_view,
     220                                                    const gchar               *plain_text);
     221
     222WEBKIT_API void
     223webkit_web_view_load_request                       (WebKitWebView             *web_view,
     224                                                    WebKitURIRequest          *request);
     225
     226WEBKIT_API void
     227webkit_web_view_stop_loading                       (WebKitWebView             *web_view);
    230228
    231229WEBKIT_API const gchar *
  • trunk/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-sections.txt

    r126017 r126030  
    7777webkit_web_view_load_uri
    7878webkit_web_view_load_html
     79webkit_web_view_load_alternate_html
    7980webkit_web_view_load_plain_text
    8081webkit_web_view_load_request
    81 webkit_web_view_replace_content
    8282webkit_web_view_can_go_back
    8383webkit_web_view_go_back
  • trunk/Source/WebKit2/UIProcess/API/gtk/tests/TestLoaderClient.cpp

    r124456 r126030  
    7171}
    7272
     73static void testLoadAlternateHTML(LoadTrackingTest* test, gconstpointer)
     74{
     75    test->loadAlternateHTML("<html><body>Alternate page</body></html>", "http://error-page.foo/", 0);
     76    test->waitUntilLoadFinished();
     77    assertNormalLoadHappened(test->m_loadEvents);
     78}
     79
    7380static void testLoadPlainText(LoadTrackingTest* test, gconstpointer)
    7481{
     
    263270    LoadTrackingTest::add("WebKitWebView", "loading-error", testLoadingError);
    264271    LoadTrackingTest::add("WebKitWebView", "load-html", testLoadHtml);
     272    LoadTrackingTest::add("WebKitWebView", "load-alternate-html", testLoadAlternateHTML);
    265273    LoadTrackingTest::add("WebKitWebView", "load-plain-text", testLoadPlainText);
    266274    LoadTrackingTest::add("WebKitWebView", "load-request", testLoadRequest);
  • trunk/Source/WebKit2/UIProcess/API/gtk/tests/TestResources.cpp

    r125910 r126030  
    504504    for (GList* item = subresources.get(); item; item = g_list_next(item))
    505505        test->checkResourceData(WEBKIT_WEB_RESOURCE(item->data));
    506 }
    507 
    508 static void replacedContentResourceLoadStartedCallback()
    509 {
    510     g_assert_not_reached();
    511 }
    512 
    513 static void testWebViewResourcesReplacedContent(ResourcesTest* test, gconstpointer)
    514 {
    515     test->loadURI(kServer->getURIForPath("/").data());
    516     // FIXME: this should be 4 instead of 3, but we don't get the css image resource
    517     // due to bug https://bugs.webkit.org/show_bug.cgi?id=78510.
    518     test->waitUntilResourcesLoaded(3);
    519 
    520     static const char* replacedHtml =
    521         "<html><head>"
    522         " <title>Content Replaced</title>"
    523         " <link rel='stylesheet' href='data:text/css,body { margin: 0px; padding: 0px; }' type='text/css'>"
    524         " <script language='javascript' src='data:application/javascript,function foo () { var a = 1; }'></script>"
    525         "</head><body onload='document.title=\"Loaded\"'>WebKitGTK+ resources on replaced content test</body></html>";
    526     g_signal_connect(test->m_webView, "resource-load-started", G_CALLBACK(replacedContentResourceLoadStartedCallback), test);
    527     test->replaceContent(replacedHtml, "http://error-page.foo", 0);
    528     test->waitUntilTitleChangedTo("Loaded");
    529 
    530     g_assert(!webkit_web_view_get_main_resource(test->m_webView));
    531     g_assert(!webkit_web_view_get_subresources(test->m_webView));
    532506}
    533507
     
    636610    ResourceURITrackingTest::add("WebKitWebResource", "active-uri", testWebResourceActiveURI);
    637611    ResourcesTest::add("WebKitWebResource", "get-data", testWebResourceGetData);
    638     ResourcesTest::add("WebKitWebView", "replaced-content", testWebViewResourcesReplacedContent);
    639612    SingleResourceLoadTest::add("WebKitWebView", "history-cache", testWebViewResourcesHistoryCache);
    640613}
  • trunk/Source/WebKit2/UIProcess/API/gtk/tests/TestWebKitWebView.cpp

    r125267 r126030  
    7575}
    7676
    77 static void replaceContentLoadCallback(WebKitWebView* webView, WebKitLoadEvent loadEvent, WebViewTest* test)
    78 {
    79     // There might be an event from a previous load,
    80     // but never a WEBKIT_LOAD_STARTED after webkit_web_view_replace_content().
    81     g_assert_cmpint(loadEvent, !=, WEBKIT_LOAD_STARTED);
    82 }
    83 
    84 static void testWebViewReplaceContent(WebViewTest* test, gconstpointer)
    85 {
    86     test->loadHtml("<html><head><title>Replace Content Test</title></head><body>Content to replace</body></html>", 0);
    87     test->waitUntilTitleChangedTo("Replace Content Test");
    88 
    89     g_signal_connect(test->m_webView, "load-changed", G_CALLBACK(replaceContentLoadCallback), test);
    90     test->replaceContent("<html><body onload='document.title=\"Content Replaced\"'>New Content</body></html>",
    91                          "http://foo.com/bar", 0);
    92     test->waitUntilTitleChangedTo("Content Replaced");
    93 }
    94 
    9577static const char* kAlertDialogMessage = "WebKitGTK+ alert dialog message";
    9678static const char* kConfirmDialogMessage = "WebKitGTK+ confirm dialog message";
     
    10491031    WebViewTest::add("WebKitWebView", "custom-charset", testWebViewCustomCharset);
    10501032    WebViewTest::add("WebKitWebView", "settings", testWebViewSettings);
    1051     WebViewTest::add("WebKitWebView", "replace-content", testWebViewReplaceContent);
    10521033    UIClientTest::add("WebKitWebView", "create-ready-close", testWebViewCreateReadyClose);
    10531034    ModalDialogsTest::add("WebKitWebView", "allow-modal-dialogs", testWebViewAllowModalDialogs);
  • trunk/Source/WebKit2/UIProcess/API/gtk/tests/WebViewTest.cpp

    r126017 r126030  
    7272}
    7373
    74 void WebViewTest::replaceContent(const char* html, const char* contentURI, const char* baseURI)
     74void WebViewTest::loadAlternateHTML(const char* html, const char* contentURI, const char* baseURI)
    7575{
    7676    m_activeURI = contentURI;
    77     webkit_web_view_replace_content(m_webView, html, contentURI, baseURI);
     77    webkit_web_view_load_alternate_html(m_webView, html, contentURI, baseURI);
    7878}
    7979
  • trunk/Source/WebKit2/UIProcess/API/gtk/tests/WebViewTest.h

    r126017 r126030  
    3636    virtual void loadPlainText(const char* plainText);
    3737    virtual void loadRequest(WebKitURIRequest*);
    38     void replaceContent(const char* html, const char* contentURI, const char* baseURI);
     38    void loadAlternateHTML(const char* html, const char* contentURI, const char* baseURI);
    3939    void goBack();
    4040    void goForward();
Note: See TracChangeset for help on using the changeset viewer.