Changeset 128280 in webkit
- Timestamp:
- Sep 12, 2012 2:17:25 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 21 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r128278 r128280 1 2012-09-12 Christophe Dumez <christophe.dumez@intel.com> 2 3 [WK2][WKTR] TestRunner needs to implement dumpApplicationCacheDelegateCallbacks 4 https://bugs.webkit.org/show_bug.cgi?id=96374 5 6 Reviewed by Kenneth Rohde Christiansen. 7 8 Unskip test cases that are passing now that WebKitTestRunner 9 implements dumpApplicationCacheDelegateCallbacks and 10 disallowIncreaseForApplicationCacheQuota. 11 12 * platform/efl-wk1/TestExpectations: 13 * platform/efl/Skipped: 14 * platform/wk2/Skipped: 15 1 16 2012-09-12 Mikhail Pozdnyakov <mikhail.pozdnyakov@intel.com> 2 17 -
trunk/LayoutTests/platform/efl-wk1/TestExpectations
r127982 r128280 48 48 BUGWK87355 : canvas/philip/tests/2d.text.draw.fontface.notinpage.html = TEXT 49 49 50 // EFL's TestRunner does not implement applicationCacheDiskUsageForOrigin 51 BUGWK86460 : http/tests/appcache/origin-usage.html = TEXT 52 53 // EFL's TestRunner does not implement originsWithApplicationCache 54 BUGWK86498 : http/tests/appcache/origins-with-appcache.html = TEXT 55 50 56 // Missing showModalDialog implementation 51 57 BUGWK84589 : fast/animation/request-animation-frame-during-modal.html = TEXT -
trunk/LayoutTests/platform/efl/Skipped
r128157 r128280 103 103 # Fallback resource wasn't used for a redirect to a resource with another origin 104 104 http/tests/appcache/fallback.html 105 106 # EFL's LayoutTestController does not implement applicationCacheDiskUsageForOrigin107 http/tests/appcache/origin-usage.html108 109 # EFL's LayoutTestController does not implement originsWithApplicationCache110 http/tests/appcache/origins-with-appcache.html111 105 112 106 # EFL's LayoutTestController does not implement shadowPseudoId -
trunk/LayoutTests/platform/wk2/Skipped
r128278 r128280 203 203 fast/text/zero-font-size.html 204 204 205 # WTR needs an implementation of dumpApplicationCacheDelegateCallbacks 206 http/tests/appcache/origin-delete.html 207 http/tests/appcache/origin-quota.html 208 http/tests/appcache/origin-quota-continued-download.html 209 http/tests/appcache/origin-quota-continued-download-multiple-manifests.html 210 http/tests/appcache/origin-usage.html 205 # WTR needs an implementation of originsWithApplicationCache 211 206 http/tests/appcache/origins-with-appcache.html 212 207 -
trunk/Source/WebKit2/ChangeLog
r128278 r128280 1 2012-09-12 Christophe Dumez <christophe.dumez@intel.com> 2 3 [WK2][WKTR] TestRunner needs to implement dumpApplicationCacheDelegateCallbacks 4 https://bugs.webkit.org/show_bug.cgi?id=96374 5 6 Reviewed by Kenneth Rohde Christiansen. 7 8 Add Bundle C API to reset the application cache quota 9 for a given origin. 10 11 Add new reachedApplicationCacheOriginQuota callback 12 to WKBundlePageUIClient which is called from 13 WebChromeClient::reachedApplicationCacheOriginQuota(). 14 15 Those are needed by WebKitTestRunner to dump 16 information about the application cache callbacks 17 if instructed to. 18 19 * Shared/APIClientTraits.cpp: 20 (WebKit): 21 * Shared/APIClientTraits.h: 22 * WebProcess/InjectedBundle/API/c/WKBundle.cpp: 23 (WKBundleSetApplicationCacheOriginQuota): 24 (WKBundleResetApplicationCacheOriginQuota): 25 * WebProcess/InjectedBundle/API/c/WKBundlePage.h: 26 * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h: 27 * WebProcess/InjectedBundle/InjectedBundle.cpp: 28 (WebKit::InjectedBundle::resetApplicationCacheOriginQuota): 29 (WebKit): 30 * WebProcess/InjectedBundle/InjectedBundle.h: 31 (InjectedBundle): 32 * WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp: 33 (WebKit::InjectedBundlePageUIClient::didReachApplicationCacheOriginQuota): 34 (WebKit): 35 * WebProcess/InjectedBundle/InjectedBundlePageUIClient.h: 36 (WebKit): 37 (InjectedBundlePageUIClient): 38 * WebProcess/WebCoreSupport/WebChromeClient.cpp: 39 (WebKit::WebChromeClient::reachedApplicationCacheOriginQuota): 40 1 41 2012-09-12 Mikhail Pozdnyakov <mikhail.pozdnyakov@intel.com> 2 42 -
trunk/Source/WebKit2/Shared/APIClientTraits.cpp
r127845 r128280 76 76 }; 77 77 78 const size_t APIClientTraits<WKBundlePageUIClient>::interfaceSizesByVersion[] = { 79 offsetof(WKBundlePageUIClient, didReachApplicationCacheOriginQuota), 80 sizeof(WKBundlePageUIClient) 81 }; 82 78 83 const size_t APIClientTraits<WKContextInjectedBundleClient>::interfaceSizesByVersion[] = { 79 84 offsetof(WKContextInjectedBundleClient, getInjectedBundleInitializationUserData), -
trunk/Source/WebKit2/Shared/APIClientTraits.h
r128129 r128280 55 55 }; 56 56 57 template<> struct APIClientTraits<WKBundlePageUIClient> { 58 static const size_t interfaceSizesByVersion[2]; 59 }; 60 57 61 template<> struct APIClientTraits<WKPageContextMenuClient> { 58 62 static const size_t interfaceSizesByVersion[3]; -
trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundle.cpp
r128278 r128280 249 249 void WKBundleSetApplicationCacheOriginQuota(WKBundleRef bundleRef, WKStringRef origin, uint64_t bytes) 250 250 { 251 return toImpl(bundleRef)->setApplicationCacheOriginQuota(toImpl(origin)->string(), bytes); 251 toImpl(bundleRef)->setApplicationCacheOriginQuota(toImpl(origin)->string(), bytes); 252 } 253 254 void WKBundleResetApplicationCacheOriginQuota(WKBundleRef bundleRef, WKStringRef origin) 255 { 256 toImpl(bundleRef)->resetApplicationCacheOriginQuota(toImpl(origin)->string()); 252 257 } 253 258 -
trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.h
r128129 r128280 237 237 typedef WKBundlePageUIElementVisibility (*WKBundlePageMenuBarIsVisibleCallback)(WKBundlePageRef page, const void *clientInfo); 238 238 typedef WKBundlePageUIElementVisibility (*WKBundlePageToolbarsAreVisibleCallback)(WKBundlePageRef page, const void *clientInfo); 239 typedef void (*WKBundlePageReachedAppCacheOriginQuotaCallback)(WKBundlePageRef page, WKSecurityOriginRef origin, int64_t totalBytesNeeded, const void *clientInfo); 239 240 240 241 struct WKBundlePageUIClient { … … 255 256 WKBundlePageMenuBarIsVisibleCallback menuBarIsVisible; 256 257 WKBundlePageToolbarsAreVisibleCallback toolbarsAreVisible; 258 259 // Version 1. 260 WKBundlePageReachedAppCacheOriginQuotaCallback didReachApplicationCacheOriginQuota; 257 261 }; 258 262 typedef struct WKBundlePageUIClient WKBundlePageUIClient; 259 263 260 enum { kWKBundlePageUIClientCurrentVersion = 0};264 enum { kWKBundlePageUIClientCurrentVersion = 1 }; 261 265 262 266 // Editor client -
trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePrivate.h
r128278 r128280 100 100 WK_EXPORT uint64_t WKBundleGetAppCacheUsageForOrigin(WKBundleRef bundle, WKStringRef origin); 101 101 WK_EXPORT void WKBundleSetApplicationCacheOriginQuota(WKBundleRef bundle, WKStringRef origin, uint64_t bytes); 102 WK_EXPORT void WKBundleResetApplicationCacheOriginQuota(WKBundleRef bundle, WKStringRef origin); 102 103 103 104 // Garbage collection API -
trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp
r128278 r128280 360 360 } 361 361 362 void InjectedBundle::resetApplicationCacheOriginQuota(const String& originString) 363 { 364 RefPtr<SecurityOrigin> origin = SecurityOrigin::createFromString(originString); 365 cacheStorage().storeUpdatedQuotaForOrigin(origin.get(), cacheStorage().defaultOriginQuota()); 366 } 367 362 368 int InjectedBundle::numberOfPages(WebFrame* frame, double pageWidthInPixels, double pageHeightInPixels) 363 369 { -
trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.h
r128278 r128280 151 151 uint64_t appCacheUsageForOrigin(const String& origin); 152 152 void setApplicationCacheOriginQuota(const String& origin, uint64_t); 153 void resetApplicationCacheOriginQuota(const String& origin); 153 154 154 155 // Garbage collection API -
trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp
r95901 r128280 29 29 #include "InjectedBundleHitTestResult.h" 30 30 #include "WKAPICast.h" 31 #include "WKBundleAPICast.h" 31 32 #include "WebGraphicsContext.h" 32 #include "W KBundleAPICast.h"33 #include "WebSecurityOrigin.h" 33 34 #include <wtf/text/WTFString.h> 34 35 … … 147 148 } 148 149 150 void InjectedBundlePageUIClient::didReachApplicationCacheOriginQuota(WebPage* page, WebSecurityOrigin* origin, int64_t totalBytesNeeded) 151 { 152 if (!m_client.didReachApplicationCacheOriginQuota) 153 return; 154 155 m_client.didReachApplicationCacheOriginQuota(toAPI(page), toAPI(origin), totalBytesNeeded, m_client.clientInfo); 156 } 157 149 158 } // namespace WebKit -
trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageUIClient.h
r95901 r128280 43 43 class WebFrame; 44 44 class WebPage; 45 class WebSecurityOrigin; 45 46 46 47 class InjectedBundlePageUIClient : public APIClient<WKBundlePageUIClient, kWKBundlePageUIClientCurrentVersion> { … … 65 66 WKBundlePageUIElementVisibility menuBarIsVisible(WebPage*); 66 67 WKBundlePageUIElementVisibility toolbarsAreVisible(WebPage*); 68 69 void didReachApplicationCacheOriginQuota(WebPage*, WebSecurityOrigin*, int64_t totalBytesNeeded); 67 70 }; 68 71 -
trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp
r124701 r128280 46 46 #include "WebProcess.h" 47 47 #include "WebSearchPopupMenu.h" 48 #include "WebSecurityOrigin.h" 48 49 #include <WebCore/AXObjectCache.h> 49 50 #include <WebCore/ColorChooser.h> … … 550 551 } 551 552 552 void WebChromeClient::reachedApplicationCacheOriginQuota(SecurityOrigin*, int64_t) 553 { 554 notImplemented(); 553 void WebChromeClient::reachedApplicationCacheOriginQuota(SecurityOrigin* origin, int64_t totalBytesNeeded) 554 { 555 RefPtr<WebSecurityOrigin> webSecurityOrigin = WebSecurityOrigin::createFromString(origin->toString()); 556 m_page->injectedBundleUIClient().didReachApplicationCacheOriginQuota(m_page, webSecurityOrigin.get(), totalBytesNeeded); 555 557 } 556 558 -
trunk/Tools/ChangeLog
r128278 r128280 1 2012-09-12 Christophe Dumez <christophe.dumez@intel.com> 2 3 [WK2][WKTR] TestRunner needs to implement dumpApplicationCacheDelegateCallbacks 4 https://bugs.webkit.org/show_bug.cgi?id=96374 5 6 Reviewed by Kenneth Rohde Christiansen. 7 8 Implement support for dumpApplicationCacheDelegateCallbacks 9 and disallowIncreaseForApplicationCacheQuota in 10 WebKitTestRunner and properly dump the information 11 expected by the tests. 12 13 If the application cache quota is reached for a given 14 security origin, WebKitTestRunner will reset the quota 15 to its default value, unless intructed not to via 16 disallowIncreaseForApplicationCacheQuota(). 17 18 * WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl: 19 * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp: 20 (WTR::InjectedBundlePage::InjectedBundlePage): 21 (WTR::InjectedBundlePage::didReachApplicationCacheOriginQuota): 22 (WTR): 23 * WebKitTestRunner/InjectedBundle/InjectedBundlePage.h: 24 (InjectedBundlePage): 25 * WebKitTestRunner/InjectedBundle/TestRunner.cpp: 26 (WTR::TestRunner::TestRunner): 27 (WTR::TestRunner::disallowIncreaseForApplicationCacheQuota): 28 (WTR): 29 * WebKitTestRunner/InjectedBundle/TestRunner.h: 30 (WTR::TestRunner::dumpApplicationCacheDelegateCallbacks): 31 (TestRunner): 32 (WTR::TestRunner::shouldDisallowIncreaseForApplicationCacheQuota): 33 (WTR::TestRunner::shouldDumpApplicationCacheDelegateCallbacks): 34 1 35 2012-09-12 Mikhail Pozdnyakov <mikhail.pozdnyakov@intel.com> 2 36 -
trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl
r128278 r128280 48 48 void dumpResourceResponseMIMETypes(); 49 49 void dumpWillCacheResponse(); 50 void dumpApplicationCacheDelegateCallbacks(); 50 51 51 52 // Special options. … … 114 115 void clearApplicationCacheForOrigin(in DOMString name); 115 116 void setApplicationCacheOriginQuota(in unsigned long long bytes); 117 void disallowIncreaseForApplicationCacheQuota(); 116 118 117 119 // Compositing testing. -
trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp
r128129 r128280 42 42 #include <WebKit2/WKBundleNodeHandlePrivate.h> 43 43 #include <WebKit2/WKBundlePagePrivate.h> 44 #include <WebKit2/WKBundlePrivate.h> 45 #include <WebKit2/WKSecurityOrigin.h> 44 46 #include <WebKit2/WKURLRequest.h> 45 47 #include <wtf/HashMap.h> … … 350 352 0, /*menuBarIsVisible*/ 351 353 0, /*toolbarsAreVisible*/ 354 didReachApplicationCacheOriginQuota, 352 355 }; 353 356 WKBundlePageSetUIClient(m_page, &uiClient); … … 1319 1322 } 1320 1323 1324 void InjectedBundlePage::didReachApplicationCacheOriginQuota(WKBundlePageRef page, WKSecurityOriginRef origin, int64_t totalBytesNeeded, const void* clientInfo) 1325 { 1326 static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->didReachApplicationCacheOriginQuota(origin, totalBytesNeeded); 1327 } 1328 1321 1329 static WTF::String lastFileURLPathComponent(const WTF::String& path) 1322 1330 { … … 1401 1409 InjectedBundle::shared().stringBuilder()->append(toWTFString(defaultValue)); 1402 1410 InjectedBundle::shared().stringBuilder()->append("\n"); 1411 } 1412 1413 void InjectedBundlePage::didReachApplicationCacheOriginQuota(WKSecurityOriginRef origin, int64_t totalBytesNeeded) 1414 { 1415 if (!InjectedBundle::shared().testRunner()->shouldDumpApplicationCacheDelegateCallbacks()) 1416 return; 1417 1418 // For example, numbers from 30000 - 39999 will output as 30000. 1419 // Rounding up or down does not really matter for these tests. It's 1420 // sufficient to just get a range of 10000 to determine if we were 1421 // above or below a threshold. 1422 int64_t truncatedSpaceNeeded = (totalBytesNeeded / 10000) * 10000; 1423 1424 InjectedBundle::shared().stringBuilder()->appendLiteral("UI DELEGATE APPLICATION CACHE CALLBACK: exceededApplicationCacheOriginQuotaForSecurityOrigin:{"); 1425 InjectedBundle::shared().stringBuilder()->append(toWTFString(adoptWK(WKSecurityOriginCopyProtocol(origin)))); 1426 InjectedBundle::shared().stringBuilder()->appendLiteral(", "); 1427 InjectedBundle::shared().stringBuilder()->append(toWTFString(adoptWK(WKSecurityOriginCopyHost(origin)))); 1428 InjectedBundle::shared().stringBuilder()->appendLiteral(", "); 1429 InjectedBundle::shared().stringBuilder()->append(WTF::String::number(WKSecurityOriginGetPort(origin))); 1430 InjectedBundle::shared().stringBuilder()->appendLiteral("} totalSpaceNeeded:~"); 1431 InjectedBundle::shared().stringBuilder()->append(WTF::String::number(truncatedSpaceNeeded)); 1432 InjectedBundle::shared().stringBuilder()->append('\n'); 1433 1434 if (InjectedBundle::shared().testRunner()->shouldDisallowIncreaseForApplicationCacheQuota()) 1435 return; 1436 1437 // Reset default application cache quota. 1438 WKBundleResetApplicationCacheOriginQuota(InjectedBundle::shared().bundle(), adoptWK(WKSecurityOriginCopyToString(origin)).get()); 1403 1439 } 1404 1440 -
trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.h
r128129 r128280 125 125 static void willRunJavaScriptConfirm(WKBundlePageRef, WKStringRef message, WKBundleFrameRef frame, const void* clientInfo); 126 126 static void willRunJavaScriptPrompt(WKBundlePageRef, WKStringRef message, WKStringRef defaultValue, WKBundleFrameRef frame, const void* clientInfo); 127 static void didReachApplicationCacheOriginQuota(WKBundlePageRef, WKSecurityOriginRef, int64_t totalBytesNeeded, const void* clientInfo); 127 128 void willAddMessageToConsole(WKStringRef message, uint32_t lineNumber); 128 129 void willSetStatusbarText(WKStringRef statusbarText); … … 130 131 void willRunJavaScriptConfirm(WKStringRef message, WKBundleFrameRef); 131 132 void willRunJavaScriptPrompt(WKStringRef message, WKStringRef defaultValue, WKBundleFrameRef); 133 void didReachApplicationCacheOriginQuota(WKSecurityOriginRef, int64_t totalBytesNeeded); 132 134 133 135 #if ENABLE(FULLSCREEN_API) -
trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp
r128278 r128280 81 81 , m_dumpResourceResponseMIMETypes(false) 82 82 , m_dumpWillCacheResponse(false) 83 , m_dumpApplicationCacheDelegateCallbacks(false) 84 , m_disallowIncreaseForApplicationCacheQuota(false) 83 85 , m_waitToDump(false) 84 86 , m_testRepaint(false) … … 324 326 } 325 327 328 void TestRunner::disallowIncreaseForApplicationCacheQuota() 329 { 330 m_disallowIncreaseForApplicationCacheQuota = true; 331 } 332 326 333 bool TestRunner::isCommandEnabled(JSStringRef name) 327 334 { -
trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h
r128278 r128280 83 83 void dumpResourceResponseMIMETypes() { m_dumpResourceResponseMIMETypes = true; } 84 84 void dumpWillCacheResponse() { m_dumpWillCacheResponse = true; } 85 void dumpApplicationCacheDelegateCallbacks() { m_dumpApplicationCacheDelegateCallbacks = true; } 85 86 86 87 void setShouldDumpFrameLoadCallbacks(bool value) { m_dumpFrameLoadCallbacks = value; } … … 150 151 long long applicationCacheDiskUsageForOrigin(JSStringRef origin); 151 152 void setApplicationCacheOriginQuota(unsigned long long); 153 void disallowIncreaseForApplicationCacheQuota(); 154 bool shouldDisallowIncreaseForApplicationCacheQuota() { return m_disallowIncreaseForApplicationCacheQuota; } 152 155 153 156 // Printing … … 172 175 bool shouldDumpResourceResponseMIMETypes() const { return m_dumpResourceResponseMIMETypes; } 173 176 bool shouldDumpWillCacheResponse() const { return m_dumpWillCacheResponse; } 177 bool shouldDumpApplicationCacheDelegateCallbacks() const { return m_dumpApplicationCacheDelegateCallbacks; } 174 178 175 179 bool isPolicyDelegateEnabled() const { return m_policyDelegateEnabled; } … … 268 272 bool m_dumpResourceResponseMIMETypes; 269 273 bool m_dumpWillCacheResponse; 274 bool m_dumpApplicationCacheDelegateCallbacks; 275 bool m_disallowIncreaseForApplicationCacheQuota; 270 276 bool m_waitToDump; // True if waitUntilDone() has been called, but notifyDone() has not yet been called. 271 277 bool m_testRepaint;
Note: See TracChangeset
for help on using the changeset viewer.