Title: [193412] trunk/Tools
Revision
193412
Author
[email protected]
Date
2015-12-03 23:45:05 -0800 (Thu, 03 Dec 2015)

Log Message

[GTK] Test /webkit2/WebKitWebResource/get-data is flaky
https://bugs.webkit.org/show_bug.cgi?id=151797

Reviewed by Martin Robinson.

Since we switched to use the network process to run the unit tests
the test /webkit2/WebKitWebResource/get-data sometimes fails and
sometimes passes. We are now also getting the notification for the
css image. Since we wait for 3 resources, sometimes the css image
is loaded before and then checkResourceData is called for it, but
not handled. When the css image is the last one loaded the test
passes. So, we just need to wait for the 4 resources.

* TestWebKitAPI/Tests/WebKit2Gtk/TestResources.cpp:
(testWebResourceGetData):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (193411 => 193412)


--- trunk/Tools/ChangeLog	2015-12-04 06:40:16 UTC (rev 193411)
+++ trunk/Tools/ChangeLog	2015-12-04 07:45:05 UTC (rev 193412)
@@ -1,3 +1,21 @@
+2015-12-03  Carlos Garcia Campos  <[email protected]>
+
+        [GTK] Test /webkit2/WebKitWebResource/get-data is flaky
+        https://bugs.webkit.org/show_bug.cgi?id=151797
+
+        Reviewed by Martin Robinson.
+
+        Since we switched to use the network process to run the unit tests
+        the test /webkit2/WebKitWebResource/get-data sometimes fails and
+        sometimes passes. We are now also getting the notification for the
+        css image. Since we wait for 3 resources, sometimes the css image
+        is loaded before and then checkResourceData is called for it, but
+        not handled. When the css image is the last one loaded the test
+        passes. So, we just need to wait for the 4 resources.
+
+        * TestWebKitAPI/Tests/WebKit2Gtk/TestResources.cpp:
+        (testWebResourceGetData):
+
 2015-12-03  David Kilzer  <[email protected]>
 
         DumpRenderTree: Use-after-free in createBitmapContext() in PixelDumpSupportMac.mm

Modified: trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestResources.cpp (193411 => 193412)


--- trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestResources.cpp	2015-12-04 06:40:16 UTC (rev 193411)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestResources.cpp	2015-12-04 07:45:05 UTC (rev 193412)
@@ -190,6 +190,13 @@
         } else if (uri == kServer->getURIForPath("/_javascript_.js")) {
             g_assert_cmpint(m_resourceDataSize, ==, strlen(kJavascript));
             g_assert(!strncmp(m_resourceData.get(), kJavascript, m_resourceDataSize));
+        } else if (uri == kServer->getURIForPath("/blank.ico")) {
+            GUniquePtr<char> filePath(g_build_filename(Test::getResourcesDir().data(), "blank.ico", nullptr));
+            GUniqueOutPtr<char> contents;
+            gsize contentsLength;
+            g_file_get_contents(filePath.get(), &contents.outPtr(), &contentsLength, nullptr);
+            g_assert_cmpint(m_resourceDataSize, ==, contentsLength);
+            g_assert(!memcmp(m_resourceData.get(), contents.get(), contentsLength));
         } else
             g_assert_not_reached();
         m_resourceData.reset();
@@ -518,9 +525,7 @@
 static void testWebResourceGetData(ResourcesTest* test, gconstpointer)
 {
     test->loadURI(kServer->getURIForPath("/").data());
-    // FIXME: this should be 4 instead of 3, but we don't get the css image resource
-    // due to bug https://bugs.webkit.org/show_bug.cgi?id=78510.
-    test->waitUntilResourcesLoaded(3);
+    test->waitUntilResourcesLoaded(4);
 
     WebKitWebResource* resource = webkit_web_view_get_main_resource(test->m_webView);
     g_assert(resource);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to