<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[171740] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/171740">171740</a></dd>
<dt>Author</dt> <dd>carlosgc@webkit.org</dd>
<dt>Date</dt> <dd>2014-07-29 04:35:52 -0700 (Tue, 29 Jul 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Implement webkit_web_view_load_string() in WebKit2
https://bugs.webkit.org/show_bug.cgi?id=134735

Reviewed by Sergio Villar Senin.

Source/WebKit2:
Add webkit_web_view_load_bytes() that receives a GBytes to load
random data in the web view using the given MIME-Type, encoding
and base URL.

* UIProcess/API/gtk/WebKitWebView.cpp:
(releaseGBytes):
(webkit_web_view_load_bytes):
* UIProcess/API/gtk/WebKitWebView.h:
* UIProcess/API/gtk/docs/webkit2gtk-docs.sgml:
* UIProcess/API/gtk/docs/webkit2gtk-sections.txt:

Tools:
Add /webkit2/WebKitWebView/load-bytes test case and simplify
TestDOMXPathNSResolver by using webkit_web_view_load_bytes()
instead of a soup server just to sent the Content-type header.

* TestWebKitAPI/Tests/WebKit2Gtk/TestDOMXPathNSResolver.cpp:
(testWebKitDOMXPathNSResolverNative):
(testWebKitDOMXPathNSResolverCustom):
(beforeAll):
(afterAll):
(serverCallback): Deleted.
* TestWebKitAPI/Tests/WebKit2Gtk/TestLoaderClient.cpp:
(testLoadBytes):
(beforeAll):
* TestWebKitAPI/gtk/WebKit2Gtk/LoadTrackingTest.cpp:
(LoadTrackingTest::loadBytes):
* TestWebKitAPI/gtk/WebKit2Gtk/LoadTrackingTest.h:
* TestWebKitAPI/gtk/WebKit2Gtk/WebViewTest.cpp:
(WebViewTest::loadBytes):
* TestWebKitAPI/gtk/WebKit2Gtk/WebViewTest.h:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIgtkWebKitWebViewcpp">trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIgtkWebKitWebViewh">trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIgtkdocswebkit2gtkdocssgml">trunk/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-docs.sgml</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIgtkdocswebkit2gtksectionstxt">trunk/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-sections.txt</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsWebKit2GtkTestDOMXPathNSResolvercpp">trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestDOMXPathNSResolver.cpp</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsWebKit2GtkTestLoaderClientcpp">trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestLoaderClient.cpp</a></li>
<li><a href="#trunkToolsTestWebKitAPIgtkWebKit2GtkLoadTrackingTestcpp">trunk/Tools/TestWebKitAPI/gtk/WebKit2Gtk/LoadTrackingTest.cpp</a></li>
<li><a href="#trunkToolsTestWebKitAPIgtkWebKit2GtkLoadTrackingTesth">trunk/Tools/TestWebKitAPI/gtk/WebKit2Gtk/LoadTrackingTest.h</a></li>
<li><a href="#trunkToolsTestWebKitAPIgtkWebKit2GtkWebViewTestcpp">trunk/Tools/TestWebKitAPI/gtk/WebKit2Gtk/WebViewTest.cpp</a></li>
<li><a href="#trunkToolsTestWebKitAPIgtkWebKit2GtkWebViewTesth">trunk/Tools/TestWebKitAPI/gtk/WebKit2Gtk/WebViewTest.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (171739 => 171740)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2014-07-29 08:52:49 UTC (rev 171739)
+++ trunk/Source/WebKit2/ChangeLog        2014-07-29 11:35:52 UTC (rev 171740)
</span><span class="lines">@@ -1,3 +1,21 @@
</span><ins>+2014-07-29  Carlos Garcia Campos  &lt;cgarcia@igalia.com&gt;
+
+        Implement webkit_web_view_load_string() in WebKit2
+        https://bugs.webkit.org/show_bug.cgi?id=134735
+
+        Reviewed by Sergio Villar Senin.
+
+        Add webkit_web_view_load_bytes() that receives a GBytes to load
+        random data in the web view using the given MIME-Type, encoding
+        and base URL.
+
+        * UIProcess/API/gtk/WebKitWebView.cpp:
+        (releaseGBytes):
+        (webkit_web_view_load_bytes):
+        * UIProcess/API/gtk/WebKitWebView.h:
+        * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml:
+        * UIProcess/API/gtk/docs/webkit2gtk-sections.txt:
+
</ins><span class="cx"> 2014-07-29  Ryuan Choi  &lt;ryuan.choi@samsung.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [EFL] Alpha value of ewk_view_bg_color_set is not working
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIgtkWebKitWebViewcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp (171739 => 171740)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp        2014-07-29 08:52:49 UTC (rev 171739)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp        2014-07-29 11:35:52 UTC (rev 171740)
</span><span class="lines">@@ -2135,7 +2135,46 @@
</span><span class="cx">     getPage(webView)-&gt;loadPlainTextString(String::fromUTF8(plainText));
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static void releaseGBytes(unsigned char*, const void* bytes)
+{
+    // Balanced by g_bytes_ref in webkit_web_view_load_bytes().
+    g_bytes_unref(static_cast&lt;GBytes*&gt;(const_cast&lt;void*&gt;(bytes)));
+}
+
</ins><span class="cx"> /**
</span><ins>+ * webkit_web_view_load_bytes:
+ * @web_view: a #WebKitWebView
+ * @bytes: input data to load
+ * @mime_type: (allow-none): the MIME type of @bytes, or %NULL
+ * @encoding: (allow-none): the character encoding of @bytes, or %NULL
+ * @base_uri: (allow-none): the base URI for relative locations or %NULL
+ *
+ * Load the specified @bytes into @web_view using the given @mime_type and @encoding.
+ * When @mime_type is %NULL, it defaults to &quot;text/html&quot;.
+ * When @encoding is %NULL, it defaults to &quot;UTF-8&quot;.
+ * When @base_uri is %NULL, it defaults to &quot;about:blank&quot;.
+ * You can monitor the load operation by connecting to #WebKitWebView::load-changed signal.
+ *
+ * Since: 2.6
+ */
+void webkit_web_view_load_bytes(WebKitWebView* webView, GBytes* bytes, const char* mimeType, const char* encoding, const char* baseURI)
+{
+    g_return_if_fail(WEBKIT_IS_WEB_VIEW(webView));
+    g_return_if_fail(bytes);
+
+    gsize bytesDataSize;
+    gconstpointer bytesData = g_bytes_get_data(bytes, &amp;bytesDataSize);
+    g_return_if_fail(bytesDataSize);
+
+    // Balanced by g_bytes_unref in releaseGBytes.
+    g_bytes_ref(bytes);
+
+    RefPtr&lt;API::Data&gt; data = API::Data::createWithoutCopying(static_cast&lt;const unsigned char*&gt;(bytesData), bytesDataSize, releaseGBytes, bytes);
+    getPage(webView)-&gt;loadData(data.get(), mimeType ? String::fromUTF8(mimeType) : String::fromUTF8(&quot;text/html&quot;),
+        encoding ? String::fromUTF8(encoding) : String::fromUTF8(&quot;UTF-8&quot;), String::fromUTF8(baseURI));
+}
+
+/**
</ins><span class="cx">  * webkit_web_view_load_request:
</span><span class="cx">  * @web_view: a #WebKitWebView
</span><span class="cx">  * @request: a #WebKitURIRequest to load
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIgtkWebKitWebViewh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.h (171739 => 171740)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.h        2014-07-29 08:52:49 UTC (rev 171739)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.h        2014-07-29 11:35:52 UTC (rev 171740)
</span><span class="lines">@@ -288,6 +288,13 @@
</span><span class="cx">                                                       const gchar               *plain_text);
</span><span class="cx"> 
</span><span class="cx"> WEBKIT_API void
</span><ins>+webkit_web_view_load_bytes                           (WebKitWebView             *web_view,
+                                                      GBytes                    *bytes,
+                                                      const gchar               *mime_type,
+                                                      const gchar               *encoding,
+                                                      const gchar               *base_uri);
+
+WEBKIT_API void
</ins><span class="cx"> webkit_web_view_load_request                         (WebKitWebView             *web_view,
</span><span class="cx">                                                       WebKitURIRequest          *request);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIgtkdocswebkit2gtkdocssgml"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-docs.sgml (171739 => 171740)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-docs.sgml        2014-07-29 08:52:49 UTC (rev 171739)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-docs.sgml        2014-07-29 11:35:52 UTC (rev 171740)
</span><span class="lines">@@ -69,5 +69,10 @@
</span><span class="cx">     &lt;xi:include href=&quot;xml/api-index-2.4.xml&quot;&gt;&lt;xi:fallback /&gt;&lt;/xi:include&gt;
</span><span class="cx">   &lt;/index&gt;
</span><span class="cx"> 
</span><ins>+  &lt;index id=&quot;api-index-2-6&quot; role=&quot;2.6&quot;&gt;
+    &lt;title&gt;Index of new symbols in 2.6&lt;/title&gt;
+    &lt;xi:include href=&quot;xml/api-index-2.6.xml&quot;&gt;&lt;xi:fallback /&gt;&lt;/xi:include&gt;
+  &lt;/index&gt;
+
</ins><span class="cx">   &lt;xi:include href=&quot;xml/annotation-glossary.xml&quot;&gt;&lt;xi:fallback /&gt;&lt;/xi:include&gt;
</span><span class="cx"> &lt;/book&gt;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIgtkdocswebkit2gtksectionstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-sections.txt (171739 => 171740)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-sections.txt        2014-07-29 08:52:49 UTC (rev 171739)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-sections.txt        2014-07-29 11:35:52 UTC (rev 171740)
</span><span class="lines">@@ -143,6 +143,7 @@
</span><span class="cx"> webkit_web_view_load_html
</span><span class="cx"> webkit_web_view_load_alternate_html
</span><span class="cx"> webkit_web_view_load_plain_text
</span><ins>+webkit_web_view_load_bytes
</ins><span class="cx"> webkit_web_view_load_request
</span><span class="cx"> webkit_web_view_can_go_back
</span><span class="cx"> webkit_web_view_go_back
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (171739 => 171740)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2014-07-29 08:52:49 UTC (rev 171739)
+++ trunk/Tools/ChangeLog        2014-07-29 11:35:52 UTC (rev 171740)
</span><span class="lines">@@ -1,3 +1,30 @@
</span><ins>+2014-07-29  Carlos Garcia Campos  &lt;cgarcia@igalia.com&gt;
+
+        Implement webkit_web_view_load_string() in WebKit2
+        https://bugs.webkit.org/show_bug.cgi?id=134735
+
+        Reviewed by Sergio Villar Senin.
+
+        Add /webkit2/WebKitWebView/load-bytes test case and simplify
+        TestDOMXPathNSResolver by using webkit_web_view_load_bytes()
+        instead of a soup server just to sent the Content-type header.
+
+        * TestWebKitAPI/Tests/WebKit2Gtk/TestDOMXPathNSResolver.cpp:
+        (testWebKitDOMXPathNSResolverNative):
+        (testWebKitDOMXPathNSResolverCustom):
+        (beforeAll):
+        (afterAll):
+        (serverCallback): Deleted.
+        * TestWebKitAPI/Tests/WebKit2Gtk/TestLoaderClient.cpp:
+        (testLoadBytes):
+        (beforeAll):
+        * TestWebKitAPI/gtk/WebKit2Gtk/LoadTrackingTest.cpp:
+        (LoadTrackingTest::loadBytes):
+        * TestWebKitAPI/gtk/WebKit2Gtk/LoadTrackingTest.h:
+        * TestWebKitAPI/gtk/WebKit2Gtk/WebViewTest.cpp:
+        (WebViewTest::loadBytes):
+        * TestWebKitAPI/gtk/WebKit2Gtk/WebViewTest.h:
+
</ins><span class="cx"> 2014-07-28  Daniel Bates  &lt;dabates@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Add support for running the Clang static analyzer when building WebKit and JSC
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWebKit2GtkTestDOMXPathNSResolvercpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestDOMXPathNSResolver.cpp (171739 => 171740)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestDOMXPathNSResolver.cpp        2014-07-29 08:52:49 UTC (rev 171739)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestDOMXPathNSResolver.cpp        2014-07-29 11:35:52 UTC (rev 171740)
</span><span class="lines">@@ -19,14 +19,12 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;config.h&quot;
</span><span class="cx"> 
</span><del>-#include &quot;WebKitTestServer.h&quot;
</del><span class="cx"> #include &quot;WebProcessTestRunner.h&quot;
</span><span class="cx"> #include &quot;WebViewTest.h&quot;
</span><span class="cx"> #include &lt;gtk/gtk.h&gt;
</span><span class="cx"> #include &lt;webkit2/webkit2.h&gt;
</span><span class="cx"> 
</span><span class="cx"> static WebProcessTestRunner* testRunner;
</span><del>-static WebKitTestServer* kServer;
</del><span class="cx"> 
</span><span class="cx"> static void runTest(WebViewTest* test, const char* name)
</span><span class="cx"> {
</span><span class="lines">@@ -38,46 +36,24 @@
</span><span class="cx"> 
</span><span class="cx"> static void testWebKitDOMXPathNSResolverNative(WebViewTest* test, gconstpointer)
</span><span class="cx"> {
</span><del>-    test-&gt;loadURI(kServer-&gt;getURIForPath(&quot;/native&quot;).data());
</del><ins>+    static const char* nativeXML = &quot;&lt;root xmlns:foo='http://www.example.org'&gt;&lt;foo:child&gt;SUCCESS&lt;/foo:child&gt;&lt;/root&gt;&quot;;
+    GRefPtr&lt;GBytes&gt; bytes = adoptGRef(g_bytes_new_static(nativeXML, strlen(nativeXML)));
+    test-&gt;loadBytes(bytes.get(), &quot;text/xml&quot;, nullptr, nullptr);
</ins><span class="cx">     test-&gt;waitUntilLoadFinished();
</span><span class="cx">     runTest(test, &quot;native&quot;);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static void testWebKitDOMXPathNSResolverCustom(WebViewTest* test, gconstpointer)
</span><span class="cx"> {
</span><del>-    test-&gt;loadURI(kServer-&gt;getURIForPath(&quot;/custom&quot;).data());
</del><ins>+    static const char* customXML = &quot;&lt;root xmlns='http://www.example.com'&gt;&lt;child&gt;SUCCESS&lt;/child&gt;&lt;/root&gt;&quot;;
+    GRefPtr&lt;GBytes&gt; bytes = adoptGRef(g_bytes_new_static(customXML, strlen(customXML)));
+    test-&gt;loadBytes(bytes.get(), &quot;text/xml&quot;, nullptr, nullptr);
</ins><span class="cx">     test-&gt;waitUntilLoadFinished();
</span><span class="cx">     runTest(test, &quot;custom&quot;);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static void serverCallback(SoupServer* server, SoupMessage* message, const char* path, GHashTable*, SoupClientContext*, gpointer)
-{
-    if (message-&gt;method != SOUP_METHOD_GET) {
-        soup_message_set_status(message, SOUP_STATUS_NOT_IMPLEMENTED);
-        return;
-    }
-
-    if (g_str_equal(path, &quot;/native&quot;)) {
-        soup_message_set_status(message, SOUP_STATUS_OK);
-        soup_message_headers_append(message-&gt;response_headers, &quot;Content-Type&quot;, &quot;text/xml&quot;);
-        static const char* nativeXML = &quot;&lt;root xmlns:foo='http://www.example.org'&gt;&lt;foo:child&gt;SUCCESS&lt;/foo:child&gt;&lt;/root&gt;&quot;;
-        soup_message_body_append(message-&gt;response_body, SOUP_MEMORY_STATIC, nativeXML, strlen(nativeXML));
-        soup_message_body_complete(message-&gt;response_body);
-    } else if (g_str_equal(path, &quot;/custom&quot;)) {
-        soup_message_set_status(message, SOUP_STATUS_OK);
-        soup_message_headers_append(message-&gt;response_headers, &quot;Content-Type&quot;, &quot;text/xml&quot;);
-        static const char* customXML = &quot;&lt;root xmlns='http://www.example.com'&gt;&lt;child&gt;SUCCESS&lt;/child&gt;&lt;/root&gt;&quot;;
-        soup_message_body_append(message-&gt;response_body, SOUP_MEMORY_STATIC, customXML, strlen(customXML));
-        soup_message_body_complete(message-&gt;response_body);
-    } else
-        soup_message_set_status(message, SOUP_STATUS_NOT_FOUND);
-}
-
</del><span class="cx"> void beforeAll()
</span><span class="cx"> {
</span><del>-    kServer = new WebKitTestServer();
-    kServer-&gt;run(serverCallback);
-
</del><span class="cx">     testRunner = new WebProcessTestRunner();
</span><span class="cx">     webkit_web_context_set_web_extensions_directory(webkit_web_context_get_default(), WEBKIT_TEST_WEB_EXTENSIONS_DIR);
</span><span class="cx"> 
</span><span class="lines">@@ -88,5 +64,4 @@
</span><span class="cx"> void afterAll()
</span><span class="cx"> {
</span><span class="cx">     delete testRunner;
</span><del>-    delete kServer;
</del><span class="cx"> }
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWebKit2GtkTestLoaderClientcpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestLoaderClient.cpp (171739 => 171740)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestLoaderClient.cpp        2014-07-29 08:52:49 UTC (rev 171739)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestLoaderClient.cpp        2014-07-29 11:35:52 UTC (rev 171740)
</span><span class="lines">@@ -89,6 +89,18 @@
</span><span class="cx">     assertNormalLoadHappened(test-&gt;m_loadEvents);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static void testLoadBytes(LoadTrackingTest* test, gconstpointer)
+{
+    GUniquePtr&lt;char&gt; filePath(g_build_filename(Test::getResourcesDir().data(), &quot;blank.ico&quot;, nullptr));
+    char* contents;
+    gsize contentsLength;
+    g_file_get_contents(filePath.get(), &amp;contents, &amp;contentsLength, nullptr);
+    GRefPtr&lt;GBytes&gt; bytes = adoptGRef(g_bytes_new_take(contents, contentsLength));
+    test-&gt;loadBytes(bytes.get(), &quot;image/vnd.microsoft.icon&quot;, nullptr, nullptr);
+    test-&gt;waitUntilLoadFinished();
+    assertNormalLoadHappened(test-&gt;m_loadEvents);
+}
+
</ins><span class="cx"> static void testLoadRequest(LoadTrackingTest* test, gconstpointer)
</span><span class="cx"> {
</span><span class="cx">     GRefPtr&lt;WebKitURIRequest&gt; request(webkit_uri_request_new(kServer-&gt;getURIForPath(&quot;/normal&quot;).data()));
</span><span class="lines">@@ -442,6 +454,7 @@
</span><span class="cx">     LoadTrackingTest::add(&quot;WebKitWebView&quot;, &quot;load-html&quot;, testLoadHtml);
</span><span class="cx">     LoadTrackingTest::add(&quot;WebKitWebView&quot;, &quot;load-alternate-html&quot;, testLoadAlternateHTML);
</span><span class="cx">     LoadTrackingTest::add(&quot;WebKitWebView&quot;, &quot;load-plain-text&quot;, testLoadPlainText);
</span><ins>+    LoadTrackingTest::add(&quot;WebKitWebView&quot;, &quot;load-bytes&quot;, testLoadBytes);
</ins><span class="cx">     LoadTrackingTest::add(&quot;WebKitWebView&quot;, &quot;load-request&quot;, testLoadRequest);
</span><span class="cx">     LoadStopTrackingTest::add(&quot;WebKitWebView&quot;, &quot;stop-loading&quot;, testLoadCancelled);
</span><span class="cx">     LoadTrackingTest::add(&quot;WebKitWebView&quot;, &quot;title&quot;, testWebViewTitle);
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPIgtkWebKit2GtkLoadTrackingTestcpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/gtk/WebKit2Gtk/LoadTrackingTest.cpp (171739 => 171740)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/gtk/WebKit2Gtk/LoadTrackingTest.cpp        2014-07-29 08:52:49 UTC (rev 171739)
+++ trunk/Tools/TestWebKitAPI/gtk/WebKit2Gtk/LoadTrackingTest.cpp        2014-07-29 11:35:52 UTC (rev 171740)
</span><span class="lines">@@ -174,6 +174,14 @@
</span><span class="cx">     WebViewTest::loadPlainText(plainText);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void LoadTrackingTest::loadBytes(GBytes* bytes, const char* mimeType, const char* encoding, const char* baseURI)
+{
+    m_loadEvents.clear();
+    m_estimatedProgress = 0;
+    m_error.reset();
+    WebViewTest::loadBytes(bytes, mimeType, encoding, baseURI);
+}
+
</ins><span class="cx"> void LoadTrackingTest::loadRequest(WebKitURIRequest* request)
</span><span class="cx"> {
</span><span class="cx">     m_loadEvents.clear();
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPIgtkWebKit2GtkLoadTrackingTesth"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/gtk/WebKit2Gtk/LoadTrackingTest.h (171739 => 171740)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/gtk/WebKit2Gtk/LoadTrackingTest.h        2014-07-29 08:52:49 UTC (rev 171739)
+++ trunk/Tools/TestWebKitAPI/gtk/WebKit2Gtk/LoadTrackingTest.h        2014-07-29 11:35:52 UTC (rev 171740)
</span><span class="lines">@@ -43,6 +43,7 @@
</span><span class="cx">     void loadHtml(const char* html, const char* baseURI);
</span><span class="cx">     void loadPlainText(const char* plainText);
</span><span class="cx">     void loadRequest(WebKitURIRequest*);
</span><ins>+    void loadBytes(GBytes*, const char* mimeType, const char* encoding, const char* baseURI);
</ins><span class="cx">     void reload();
</span><span class="cx">     void goBack();
</span><span class="cx">     void goForward();
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPIgtkWebKit2GtkWebViewTestcpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/gtk/WebKit2Gtk/WebViewTest.cpp (171739 => 171740)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/gtk/WebKit2Gtk/WebViewTest.cpp        2014-07-29 08:52:49 UTC (rev 171739)
+++ trunk/Tools/TestWebKitAPI/gtk/WebKit2Gtk/WebViewTest.cpp        2014-07-29 11:35:52 UTC (rev 171740)
</span><span class="lines">@@ -71,6 +71,15 @@
</span><span class="cx">     webkit_web_view_load_plain_text(m_webView, plainText);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void WebViewTest::loadBytes(GBytes* bytes, const char* mimeType, const char* encoding, const char* baseURI)
+{
+    if (!baseURI)
+        m_activeURI = &quot;about:blank&quot;;
+    else
+        m_activeURI = baseURI;
+    webkit_web_view_load_bytes(m_webView, bytes, mimeType, encoding, baseURI);
+}
+
</ins><span class="cx"> void WebViewTest::loadRequest(WebKitURIRequest* request)
</span><span class="cx"> {
</span><span class="cx">     m_activeURI = webkit_uri_request_get_uri(request);
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPIgtkWebKit2GtkWebViewTesth"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/gtk/WebKit2Gtk/WebViewTest.h (171739 => 171740)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/gtk/WebKit2Gtk/WebViewTest.h        2014-07-29 08:52:49 UTC (rev 171739)
+++ trunk/Tools/TestWebKitAPI/gtk/WebKit2Gtk/WebViewTest.h        2014-07-29 11:35:52 UTC (rev 171740)
</span><span class="lines">@@ -36,6 +36,7 @@
</span><span class="cx">     virtual void loadHtml(const char* html, const char* baseURI);
</span><span class="cx">     virtual void loadPlainText(const char* plainText);
</span><span class="cx">     virtual void loadRequest(WebKitURIRequest*);
</span><ins>+    virtual void loadBytes(GBytes*, const char* mimeType, const char* encoding, const char* baseURI);
</ins><span class="cx">     void loadAlternateHTML(const char* html, const char* contentURI, const char* baseURI);
</span><span class="cx">     void goBack();
</span><span class="cx">     void goForward();
</span></span></pre>
</div>
</div>

</body>
</html>