Title: [90946] trunk
Revision
90946
Author
[email protected]
Date
2011-07-13 14:40:27 -0700 (Wed, 13 Jul 2011)

Log Message

ApplicationCache Quota Output is Flakey
https://bugs.webkit.org/show_bug.cgi?id=64410

Reviewed by Alexey Proskuryakov.

2011-07-13  Joseph Pecoraro  <[email protected]>

        Have the tests truncate the number of bytes needed in
        the delegate callback to get an approximation of how
        much space was needed.

        * http/tests/appcache/origin-quota-continued-download-expected.txt:
        * http/tests/appcache/origin-quota-continued-download-multiple-manifests-expected.txt:
        * http/tests/appcache/origin-quota-continued-download-multiple-manifests.html:
        * http/tests/appcache/origin-quota-expected.txt:
        Update the output and clarify what the multiple-manifests test
        is looking for in the space needed output.

        * platform/mac/Skipped:
        * platform/qt/Skipped:
        Unskip the tests.

2011-07-13  Joseph Pecoraro  <[email protected]>

        Unify the delegate logging for reaching application cache
        quotas. Truncate the space needed to the nearest 10000
        for less flakey test output. This also better supports
        printing NSUInteger on non-64 bit systems by casting to
        an unsigned long.

        * DumpRenderTree/mac/UIDelegate.mm:
        (-[UIDelegate webView:exceededApplicationCacheOriginQuotaForSecurityOrigin:totalSpaceNeeded:]):
        * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
        (WebCore::DumpRenderTree::dumpApplicationCacheQuota):

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (90945 => 90946)


--- trunk/LayoutTests/ChangeLog	2011-07-13 20:55:54 UTC (rev 90945)
+++ trunk/LayoutTests/ChangeLog	2011-07-13 21:40:27 UTC (rev 90946)
@@ -1,3 +1,25 @@
+2011-07-13  Joseph Pecoraro  <[email protected]>
+
+        ApplicationCache Quota Output is Flakey
+        https://bugs.webkit.org/show_bug.cgi?id=64410
+
+        Reviewed by Alexey Proskuryakov.
+
+        Have the tests truncate the number of bytes needed in
+        the delegate callback to get an approximation of how
+        much space was needed.
+
+        * http/tests/appcache/origin-quota-continued-download-expected.txt:
+        * http/tests/appcache/origin-quota-continued-download-multiple-manifests-expected.txt:
+        * http/tests/appcache/origin-quota-continued-download-multiple-manifests.html:
+        * http/tests/appcache/origin-quota-expected.txt:
+        Update the output and clarify what the multiple-manifests test
+        is looking for in the space needed output.
+
+        * platform/mac/Skipped:
+        * platform/qt/Skipped:
+        Unskip the tests.
+
 2011-07-13  James Robinson  <[email protected]>
 
         [chromium] Update chromium gpu expectations.

Modified: trunk/LayoutTests/http/tests/appcache/origin-quota-continued-download-expected.txt (90945 => 90946)


--- trunk/LayoutTests/http/tests/appcache/origin-quota-continued-download-expected.txt	2011-07-13 20:55:54 UTC (rev 90945)
+++ trunk/LayoutTests/http/tests/appcache/origin-quota-continued-download-expected.txt	2011-07-13 21:40:27 UTC (rev 90946)
@@ -1,4 +1,4 @@
-UI DELEGATE APPLICATION CACHE CALLBACK: exceededApplicationCacheOriginQuotaForSecurityOrigin:{http, 127.0.0.1, 8000} totalSpaceNeeded:15918
+UI DELEGATE APPLICATION CACHE CALLBACK: exceededApplicationCacheOriginQuotaForSecurityOrigin:{http, 127.0.0.1, 8000} totalSpaceNeeded:~10000
 This test checks that per-origin application cache quota don't require a refresh to complete successfully.
 
 This test sets the quota for the origin to 1kb, and attempts to fill it up with more than 1kb of data. The download should complete successfully, with the quota being increased to the default of 5MB. The delegate should be informed for the exceeded quota, increase it to a size large enough, and the download succeed.

Modified: trunk/LayoutTests/http/tests/appcache/origin-quota-continued-download-multiple-manifests-expected.txt (90945 => 90946)


--- trunk/LayoutTests/http/tests/appcache/origin-quota-continued-download-multiple-manifests-expected.txt	2011-07-13 20:55:54 UTC (rev 90945)
+++ trunk/LayoutTests/http/tests/appcache/origin-quota-continued-download-multiple-manifests-expected.txt	2011-07-13 21:40:27 UTC (rev 90946)
@@ -1,7 +1,7 @@
-UI DELEGATE APPLICATION CACHE CALLBACK: exceededApplicationCacheOriginQuotaForSecurityOrigin:{http, 127.0.0.1, 8000} totalSpaceNeeded:32001
+UI DELEGATE APPLICATION CACHE CALLBACK: exceededApplicationCacheOriginQuotaForSecurityOrigin:{http, 127.0.0.1, 8000} totalSpaceNeeded:~30000
 This test checks that per-origin application cache quota works correctly with multiple manifests/caches per-origin.
 
-This test sets the quota for the origin to 20kb, and attempts to fill it up with 2 different application caches about 15kb each. The first frame will cache successfully and fill up about 15kb of the origin quota. The second frame will reach the quota, cause a delegate callback, dump the spaceNeeded (which should be enough for both iframe caches), and succeed due to the default DRT behavior or raising the quota.
+This test sets the quota for the origin to 20kb, and attempts to fill it up with 2 different application caches about 15kb each. The first frame will cache successfully and fill up about 15kb of the origin quota. The second frame will reach the quota, cause a delegate callback, dump the totalSpaceNeeded. The space needed should be enough for both iframe caches, so we would expect ~30kb bytes. The delegate will automatically increase the quota and cause the second appcache to succeed.
 
 PASS - cached iframe
 PASS - cached iframe

Modified: trunk/LayoutTests/http/tests/appcache/origin-quota-continued-download-multiple-manifests.html (90945 => 90946)


--- trunk/LayoutTests/http/tests/appcache/origin-quota-continued-download-multiple-manifests.html	2011-07-13 20:55:54 UTC (rev 90945)
+++ trunk/LayoutTests/http/tests/appcache/origin-quota-continued-download-multiple-manifests.html	2011-07-13 21:40:27 UTC (rev 90946)
@@ -64,8 +64,10 @@
     the origin quota.
 
     The second frame will reach the quota, cause a delegate callback,
-    dump the spaceNeeded (which should be enough for both iframe caches),
-    and succeed due to the default DRT behavior or raising the quota.
+    dump the totalSpaceNeeded. The space needed should be enough for both
+    iframe caches, so we would expect ~30kb bytes. The delegate will
+    automatically increase the quota and cause the second appcache
+    to succeed.
 </p>
 <pre id="console"></pre>
 </body>

Modified: trunk/LayoutTests/http/tests/appcache/origin-quota-expected.txt (90945 => 90946)


--- trunk/LayoutTests/http/tests/appcache/origin-quota-expected.txt	2011-07-13 20:55:54 UTC (rev 90945)
+++ trunk/LayoutTests/http/tests/appcache/origin-quota-expected.txt	2011-07-13 21:40:27 UTC (rev 90946)
@@ -1,4 +1,4 @@
-UI DELEGATE APPLICATION CACHE CALLBACK: exceededApplicationCacheOriginQuotaForSecurityOrigin:{http, 127.0.0.1, 8000} spaceNeeded:31161
+UI DELEGATE APPLICATION CACHE CALLBACK: exceededApplicationCacheOriginQuotaForSecurityOrigin:{http, 127.0.0.1, 8000} totalSpaceNeeded:~30000
 CONSOLE MESSAGE: line 0: Application Cache update failed, because size quota was exceeded.
 This test checks that per-origin application cache quotas are enforced.
 

Modified: trunk/LayoutTests/platform/mac/Skipped (90945 => 90946)


--- trunk/LayoutTests/platform/mac/Skipped	2011-07-13 20:55:54 UTC (rev 90945)
+++ trunk/LayoutTests/platform/mac/Skipped	2011-07-13 21:40:27 UTC (rev 90946)
@@ -389,9 +389,3 @@
 
 # Skipped until new WebSocket protocol is implemented. http://webkit.org/b/50099
 http/tests/websocket/tests/hybi/
-
-# ApplicationCache Quota Output is Flakey
-# https://bugs.webkit.org/show_bug.cgi?id=64410
-http/tests/appcache/origin-quota-continued-download-multiple-manifests.html
-http/tests/appcache/origin-quota-continued-download.html
-http/tests/appcache/origin-quota.html

Modified: trunk/LayoutTests/platform/qt/Skipped (90945 => 90946)


--- trunk/LayoutTests/platform/qt/Skipped	2011-07-13 20:55:54 UTC (rev 90945)
+++ trunk/LayoutTests/platform/qt/Skipped	2011-07-13 21:40:27 UTC (rev 90946)
@@ -2187,12 +2187,6 @@
 # LayoutTestController::applicationCacheDiskUsageForOrigin isn't implemented - https://bugs.webkit.org/show_bug.cgi?id=57127
 http/tests/appcache/origin-usage.html
 
-# ApplicationCache Quota Output Differs for Qt Tests
-# https://bugs.webkit.org/show_bug.cgi?id=64410
-http/tests/appcache/origin-quota-continued-download-multiple-manifests.html
-http/tests/appcache/origin-quota-continued-download.html
-http/tests/appcache/origin-quota.html
-
 # Needs rebaseline
 fast/dom/HTMLMeterElement/meter-element.html
 fast/dom/HTMLMeterElement/meter-boundary-values.html

Modified: trunk/Tools/ChangeLog (90945 => 90946)


--- trunk/Tools/ChangeLog	2011-07-13 20:55:54 UTC (rev 90945)
+++ trunk/Tools/ChangeLog	2011-07-13 21:40:27 UTC (rev 90946)
@@ -1,3 +1,21 @@
+2011-07-13  Joseph Pecoraro  <[email protected]>
+
+        ApplicationCache Quota Output is Flakey
+        https://bugs.webkit.org/show_bug.cgi?id=64410
+
+        Reviewed by Alexey Proskuryakov.
+
+        Unify the delegate logging for reaching application cache
+        quotas. Truncate the space needed to the nearest 10000
+        for less flakey test output. This also better supports
+        printing NSUInteger on non-64 bit systems by casting to
+        an unsigned long.
+
+        * DumpRenderTree/mac/UIDelegate.mm:
+        (-[UIDelegate webView:exceededApplicationCacheOriginQuotaForSecurityOrigin:totalSpaceNeeded:]):
+        * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
+        (WebCore::DumpRenderTree::dumpApplicationCacheQuota):
+
 2011-07-13  Dimitri Glazkov  <[email protected]>
 
         Remove unused TestExpectations._overrides.

Modified: trunk/Tools/DumpRenderTree/mac/UIDelegate.mm (90945 => 90946)


--- trunk/Tools/DumpRenderTree/mac/UIDelegate.mm	2011-07-13 20:55:54 UTC (rev 90945)
+++ trunk/Tools/DumpRenderTree/mac/UIDelegate.mm	2011-07-13 21:40:27 UTC (rev 90946)
@@ -169,8 +169,13 @@
 - (void)webView:(WebView *)sender exceededApplicationCacheOriginQuotaForSecurityOrigin:(WebSecurityOrigin *)origin totalSpaceNeeded:(NSUInteger)totalSpaceNeeded
 {
     if (!done && gLayoutTestController->dumpApplicationCacheDelegateCallbacks()) {
-        printf("UI DELEGATE APPLICATION CACHE CALLBACK: exceededApplicationCacheOriginQuotaForSecurityOrigin:{%s, %s, %i} totalSpaceNeeded:%lu\n",
-            [[origin protocol] UTF8String], [[origin host] UTF8String], [origin port], (unsigned long)totalSpaceNeeded);
+        // For example, numbers from 30000 - 39999 will output as 30000.
+        // Rounding up or down not really matter for these tests. It's
+        // sufficient to just get a range of 10000 to determine if we were
+        // above or below a threshold.
+        unsigned long truncatedSpaceNeeded = static_cast<unsigned long>((totalSpaceNeeded / 10000) * 10000);
+        printf("UI DELEGATE APPLICATION CACHE CALLBACK: exceededApplicationCacheOriginQuotaForSecurityOrigin:{%s, %s, %i} totalSpaceNeeded:~%lu\n",
+            [[origin protocol] UTF8String], [[origin host] UTF8String], [origin port], truncatedSpaceNeeded);
     }
 
     if (gLayoutTestController->disallowIncreaseForApplicationCacheQuota())

Modified: trunk/Tools/DumpRenderTree/qt/DumpRenderTreeQt.cpp (90945 => 90946)


--- trunk/Tools/DumpRenderTree/qt/DumpRenderTreeQt.cpp	2011-07-13 20:55:54 UTC (rev 90945)
+++ trunk/Tools/DumpRenderTree/qt/DumpRenderTreeQt.cpp	2011-07-13 21:40:27 UTC (rev 90946)
@@ -1041,16 +1041,20 @@
 
 void DumpRenderTree::dumpApplicationCacheQuota(QWebSecurityOrigin* origin, quint64 defaultOriginQuota, quint64 totalSpaceNeeded)
 {
-    if (!m_controller->shouldDumpApplicationCacheDelegateCallbacks())
-        return;
+    if (m_controller->shouldDumpApplicationCacheDelegateCallbacks()) {
+        // For example, numbers from 30000 - 39999 will output as 30000.
+        // Rounding up or down not really matter for these tests. It's
+        // sufficient to just get a range of 10000 to determine if we were
+        // above or below a threshold.
+        quint64 truncatedSpaceNeeded = (totalSpaceNeeded / 10000) * 10000;
+        printf("UI DELEGATE APPLICATION CACHE CALLBACK: exceededApplicationCacheOriginQuotaForSecurityOrigin:{%s, %s, %i} totalSpaceNeeded:~%llu",
+               origin->scheme().toUtf8().data(),
+               origin->host().toUtf8().data(),
+               origin->port(),
+               truncatedSpaceNeeded
+               );
+    }
 
-    printf("UI DELEGATE APPLICATION CACHE CALLBACK: exceededApplicationCacheOriginQuotaForSecurityOrigin:{%s, %s, %i} totalSpaceNeeded:%llu",
-           origin->scheme().toUtf8().data(),
-           origin->host().toUtf8().data(),
-           origin->port(),
-           totalSpaceNeeded
-           );
-
     if (m_controller->shouldDisallowIncreaseForApplicationCacheQuota())
         return;
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to