<!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>[167008] trunk/Tools</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/167008">167008</a></dd>
<dt>Author</dt> <dd>carlosgc@webkit.org</dd>
<dt>Date</dt> <dd>2014-04-09 01:28:06 -0700 (Wed, 09 Apr 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>[GTK] Move WebKit1 unit tests resources used by WebKit2 unit tests to WebKit2 resources dir
https://bugs.webkit.org/show_bug.cgi?id=131029

Reviewed by Philippe Normand.

Add blank.ico and test.pdf to resources dir of WebKit2Gtk unit
tests and remove the getWebKit1TestResoucesDir() method.

* TestWebKitAPI/Tests/WebKit2Gtk/TestDownloads.cpp:
(testDownloadLocalFile): Use Test::getResourcesDir().
(testDownloadLocalFileError): Ditto.
(serverCallback): Ditto.
* TestWebKitAPI/Tests/WebKit2Gtk/TestResources.cpp:
(serverCallback): Ditto.
* TestWebKitAPI/Tests/WebKit2Gtk/TestSSL.cpp:
(httpServerCallback): Ditto.
* TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitFaviconDatabase.cpp:
(serverCallback): Ditto.
* TestWebKitAPI/Tests/WebKit2Gtk/resources/blank.ico: Added.
* TestWebKitAPI/Tests/WebKit2Gtk/resources/test.pdf: Added.
* TestWebKitAPI/gtk/WebKit2Gtk/TestMain.h:
(Test::getWebKit1TestResoucesDir): Deleted.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsWebKit2GtkTestDownloadscpp">trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestDownloads.cpp</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsWebKit2GtkTestResourcescpp">trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestResources.cpp</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsWebKit2GtkTestSSLcpp">trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestSSL.cpp</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsWebKit2GtkTestWebKitFaviconDatabasecpp">trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitFaviconDatabase.cpp</a></li>
<li><a href="#trunkToolsTestWebKitAPIgtkWebKit2GtkTestMainh">trunk/Tools/TestWebKitAPI/gtk/WebKit2Gtk/TestMain.h</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkToolsTestWebKitAPITestsWebKit2Gtkresourcesblankico">trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/resources/blank.ico</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsWebKit2Gtkresourcestestpdf">trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/resources/test.pdf</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (167007 => 167008)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2014-04-09 07:37:42 UTC (rev 167007)
+++ trunk/Tools/ChangeLog        2014-04-09 08:28:06 UTC (rev 167008)
</span><span class="lines">@@ -1,3 +1,28 @@
</span><ins>+2014-04-09  Carlos Garcia Campos  &lt;cgarcia@igalia.com&gt;
+
+        [GTK] Move WebKit1 unit tests resources used by WebKit2 unit tests to WebKit2 resources dir
+        https://bugs.webkit.org/show_bug.cgi?id=131029
+
+        Reviewed by Philippe Normand.
+
+        Add blank.ico and test.pdf to resources dir of WebKit2Gtk unit
+        tests and remove the getWebKit1TestResoucesDir() method.
+
+        * TestWebKitAPI/Tests/WebKit2Gtk/TestDownloads.cpp:
+        (testDownloadLocalFile): Use Test::getResourcesDir().
+        (testDownloadLocalFileError): Ditto.
+        (serverCallback): Ditto.
+        * TestWebKitAPI/Tests/WebKit2Gtk/TestResources.cpp:
+        (serverCallback): Ditto.
+        * TestWebKitAPI/Tests/WebKit2Gtk/TestSSL.cpp:
+        (httpServerCallback): Ditto.
+        * TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitFaviconDatabase.cpp:
+        (serverCallback): Ditto.
+        * TestWebKitAPI/Tests/WebKit2Gtk/resources/blank.ico: Added.
+        * TestWebKitAPI/Tests/WebKit2Gtk/resources/test.pdf: Added.
+        * TestWebKitAPI/gtk/WebKit2Gtk/TestMain.h:
+        (Test::getWebKit1TestResoucesDir): Deleted.
+
</ins><span class="cx"> 2014-04-09  Alexey Proskuryakov  &lt;ap@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [WK2] HTTP authentication regression tests fail
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWebKit2GtkTestDownloadscpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestDownloads.cpp (167007 => 167008)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestDownloads.cpp        2014-04-09 07:37:42 UTC (rev 167007)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestDownloads.cpp        2014-04-09 08:28:06 UTC (rev 167008)
</span><span class="lines">@@ -182,7 +182,7 @@
</span><span class="cx"> 
</span><span class="cx"> static void testDownloadLocalFile(DownloadTest* test, gconstpointer)
</span><span class="cx"> {
</span><del>-    GUniquePtr&lt;char&gt; sourcePath(g_build_filename(Test::getWebKit1TestResoucesDir().data(), &quot;test.pdf&quot;, NULL));
</del><ins>+    GUniquePtr&lt;char&gt; sourcePath(g_build_filename(Test::getResourcesDir().data(), &quot;test.pdf&quot;, nullptr));
</ins><span class="cx">     GRefPtr&lt;GFile&gt; source = adoptGRef(g_file_new_for_path(sourcePath.get()));
</span><span class="cx">     GRefPtr&lt;GFileInfo&gt; sourceInfo = adoptGRef(g_file_query_info(source.get(), G_FILE_ATTRIBUTE_STANDARD_SIZE, static_cast&lt;GFileQueryInfoFlags&gt;(0), 0, 0));
</span><span class="cx">     GUniquePtr&lt;char&gt; sourceURI(g_file_get_uri(source.get()));
</span><span class="lines">@@ -262,7 +262,7 @@
</span><span class="cx">     g_assert_cmpfloat(webkit_download_get_estimated_progress(download.get()), &lt;, 1);
</span><span class="cx"> 
</span><span class="cx">     test-&gt;m_expectedError = WEBKIT_DOWNLOAD_ERROR_DESTINATION;
</span><del>-    GUniquePtr&lt;char&gt; path(g_build_filename(Test::getWebKit1TestResoucesDir().data(), &quot;test.pdf&quot;, NULL));
</del><ins>+    GUniquePtr&lt;char&gt; path(g_build_filename(Test::getResourcesDir().data(), &quot;test.pdf&quot;, nullptr));
</ins><span class="cx">     GRefPtr&lt;GFile&gt; file = adoptGRef(g_file_new_for_path(path.get()));
</span><span class="cx">     GUniquePtr&lt;char&gt; uri(g_file_get_uri(file.get()));
</span><span class="cx">     download = adoptGRef(test-&gt;downloadURIAndWaitUntilFinishes(uri.get()));
</span><span class="lines">@@ -329,7 +329,7 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    GUniquePtr&lt;char&gt; filePath(g_build_filename(Test::getWebKit1TestResoucesDir().data(), path, NULL));
</del><ins>+    GUniquePtr&lt;char&gt; filePath(g_build_filename(Test::getResourcesDir().data(), path, nullptr));
</ins><span class="cx">     char* contents;
</span><span class="cx">     gsize contentsLength;
</span><span class="cx">     if (!g_file_get_contents(filePath.get(), &amp;contents, &amp;contentsLength, 0)) {
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWebKit2GtkTestResourcescpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestResources.cpp (167007 => 167008)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestResources.cpp        2014-04-09 07:37:42 UTC (rev 167007)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestResources.cpp        2014-04-09 08:28:06 UTC (rev 167008)
</span><span class="lines">@@ -734,7 +734,7 @@
</span><span class="cx">         static const char* javascriptRelativeHTML = &quot;&lt;html&gt;&lt;head&gt;&lt;script language='javascript' src='/redirected-to-cancel.js'&gt;&lt;/script&gt;&lt;/head&gt;&lt;body&gt;&lt;/body&gt;&lt;/html&gt;&quot;;
</span><span class="cx">         soup_message_body_append(message-&gt;response_body, SOUP_MEMORY_STATIC, javascriptRelativeHTML, strlen(javascriptRelativeHTML));
</span><span class="cx">     } else if (g_str_equal(path, &quot;/blank.ico&quot;)) {
</span><del>-        GUniquePtr&lt;char&gt; filePath(g_build_filename(Test::getWebKit1TestResoucesDir().data(), path, NULL));
</del><ins>+        GUniquePtr&lt;char&gt; filePath(g_build_filename(Test::getResourcesDir().data(), path, nullptr));
</ins><span class="cx">         char* contents;
</span><span class="cx">         gsize contentsLength;
</span><span class="cx">         g_file_get_contents(filePath.get(), &amp;contents, &amp;contentsLength, 0);
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWebKit2GtkTestSSLcpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestSSL.cpp (167007 => 167008)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestSSL.cpp        2014-04-09 07:37:42 UTC (rev 167007)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestSSL.cpp        2014-04-09 08:28:06 UTC (rev 167008)
</span><span class="lines">@@ -245,7 +245,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (g_str_equal(path, &quot;/test-script&quot;)) {
</span><del>-        GUniquePtr&lt;char&gt; pathToFile(g_build_filename(Test::getResourcesDir().data(), &quot;link-title.js&quot;, NULL));
</del><ins>+        GUniquePtr&lt;char&gt; pathToFile(g_build_filename(Test::getResourcesDir().data(), &quot;link-title.js&quot;, nullptr));
</ins><span class="cx">         char* contents;
</span><span class="cx">         gsize length;
</span><span class="cx">         g_file_get_contents(pathToFile.get(), &amp;contents, &amp;length, 0);
</span><span class="lines">@@ -254,7 +254,7 @@
</span><span class="cx">         soup_message_set_status(message, SOUP_STATUS_OK);
</span><span class="cx">         soup_message_body_complete(message-&gt;response_body);
</span><span class="cx">     } else if (g_str_equal(path, &quot;/test-image&quot;)) {
</span><del>-        GUniquePtr&lt;char&gt; pathToFile(g_build_filename(Test::getWebKit1TestResoucesDir().data(), &quot;blank.ico&quot;, NULL));
</del><ins>+        GUniquePtr&lt;char&gt; pathToFile(g_build_filename(Test::getResourcesDir().data(), &quot;blank.ico&quot;, nullptr));
</ins><span class="cx">         char* contents;
</span><span class="cx">         gsize length;
</span><span class="cx">         g_file_get_contents(pathToFile.get(), &amp;contents, &amp;length, 0);
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWebKit2GtkTestWebKitFaviconDatabasecpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitFaviconDatabase.cpp (167007 => 167008)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitFaviconDatabase.cpp        2014-04-09 07:37:42 UTC (rev 167007)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitFaviconDatabase.cpp        2014-04-09 08:28:06 UTC (rev 167008)
</span><span class="lines">@@ -116,7 +116,7 @@
</span><span class="cx">     char* contents;
</span><span class="cx">     gsize length;
</span><span class="cx">     if (g_str_equal(path, &quot;/icon/favicon.ico&quot;)) {
</span><del>-        GUniquePtr&lt;char&gt; pathToFavicon(g_build_filename(Test::getWebKit1TestResoucesDir().data(), &quot;blank.ico&quot;, NULL));
</del><ins>+        GUniquePtr&lt;char&gt; pathToFavicon(g_build_filename(Test::getResourcesDir().data(), &quot;blank.ico&quot;, nullptr));
</ins><span class="cx">         g_file_get_contents(pathToFavicon.get(), &amp;contents, &amp;length, 0);
</span><span class="cx">         soup_message_body_append(message-&gt;response_body, SOUP_MEMORY_TAKE, contents, length);
</span><span class="cx">     } else if (g_str_equal(path, &quot;/nofavicon&quot;)) {
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWebKit2Gtkresourcesblankico"></a>
<div class="addfile"><h4>Added: trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/resources/blank.ico (0 => 167008)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/resources/blank.ico                                (rev 0)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/resources/blank.ico        2014-04-09 08:28:06 UTC (rev 167008)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+\xB0( \xFF\xFF\xFF
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWebKit2Gtkresourcestestpdf"></a>
<div class="binary"><h4>Added: trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/resources/test.pdf</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Property changes on: trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/resources/test.pdf
</span><span class="cx">___________________________________________________________________
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<a id="trunkToolsTestWebKitAPIgtkWebKit2GtkTestMainh"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/gtk/WebKit2Gtk/TestMain.h (167007 => 167008)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/gtk/WebKit2Gtk/TestMain.h        2014-04-09 07:37:42 UTC (rev 167007)
+++ trunk/Tools/TestWebKitAPI/gtk/WebKit2Gtk/TestMain.h        2014-04-09 08:28:06 UTC (rev 167008)
</span><span class="lines">@@ -81,12 +81,6 @@
</span><span class="cx">         g_object_weak_ref(object, reinterpret_cast&lt;GWeakNotify&gt;(objectFinalized), this);
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    static CString getWebKit1TestResoucesDir()
-    {
-        GUniquePtr&lt;char&gt; resourcesDir(g_build_filename(WEBKIT_SRC_DIR, &quot;Tools&quot;, &quot;TestWebKitAPI&quot;, &quot;Tests&quot;, &quot;WebKitGtk&quot;, &quot;resources&quot;, nullptr));
-        return resourcesDir.get();
-    }
-
</del><span class="cx">     static CString getResourcesDir()
</span><span class="cx">     {
</span><span class="cx">         GUniquePtr&lt;char&gt; resourcesDir(g_build_filename(WEBKIT_SRC_DIR, &quot;Tools&quot;, &quot;TestWebKitAPI&quot;, &quot;Tests&quot;, &quot;WebKit2Gtk&quot;, &quot;resources&quot;, nullptr));
</span></span></pre>
</div>
</div>

</body>
</html>