Changeset 158447 in webkit
- Timestamp:
- Nov 1, 2013, 12:18:27 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r158441 r158447 1 2013-10-31 Mark Lam <mark.lam@apple.com> 2 3 REGRESSION: Crashes in -[UIDelegate webView:frame:exceededDatabaseQuotaForSecurityOrigin:database:]. 4 https://bugs.webkit.org/show_bug.cgi?id=123383. 5 6 Reviewed by Geoffrey Garen. 7 8 Removed an inappropriate assertion in DumpRenderTree/mac/UIDelegate.mm and 9 added 2 attributes (databaseDefaultQuota and databaseMaxQuota) to allow 10 tests to set appropriate quota settings to exercise quota expansion tests 11 when needed. 12 13 * storage/websql/open-database-expand-quota.html: 14 - Set databaseDefaultQuota and databaseMaxQuota as needed for this test. 15 * storage/websql/open-database-over-quota-expected.txt: 16 * storage/websql/open-database-over-quota.html: 17 - Revert the change from r157874 which is no longer needed for this test. 18 1 19 2013-11-01 Bem Jones-Bey <bjonesbe@adobe.com> 2 20 -
trunk/LayoutTests/storage/websql/open-database-expand-quota.html
r157874 r158447 6 6 testRunner.dumpAsText(); 7 7 testRunner.clearAllDatabases(); 8 testRunner.databaseDefaultQuota = 5 * 1024 * 1024; 9 testRunner.databaseMaxQuota = 10 * 1024 * 1024; 8 10 } 9 11 -
trunk/LayoutTests/storage/websql/open-database-over-quota-expected.txt
r157874 r158447 1 This tests that calling openDatabase with a size greater or equal to the test max quota limit of 10MB doesn't assert on debug builds.1 This tests that calling openDatabase with a size greater or equal to the test max quota limit of 5MB doesn't assert on debug builds. 2 2 PASS -
trunk/LayoutTests/storage/websql/open-database-over-quota.html
r157874 r158447 9 9 10 10 try { 11 var db = openDatabase('OverQuotaOpen', '', 'Test for bug 36473: missing lock in call to doneCreatingDatabase', 20000000);11 var db = openDatabase('OverQuotaOpen', '', 'Test for bug 36473: missing lock in call to doneCreatingDatabase', 10000000); 12 12 } catch (err) { 13 13 document.getElementById('result').innerHTML = 'PASS' … … 17 17 </head> 18 18 <body onload="runTest()"> 19 <div>This tests that calling openDatabase with a size greater or equal to the test max quota limit of 10MB19 <div>This tests that calling openDatabase with a size greater or equal to the test max quota limit of 5MB 20 20 doesn't assert on debug builds. 21 21 <div id="result"> -
trunk/Tools/ChangeLog
r158407 r158447 1 2013-10-31 Mark Lam <mark.lam@apple.com> 2 3 REGRESSION: Crashes in -[UIDelegate webView:frame:exceededDatabaseQuotaForSecurityOrigin:database:]. 4 https://bugs.webkit.org/show_bug.cgi?id=123383. 5 6 Reviewed by Geoffrey Garen. 7 8 Removed an inappropriate assertion in DumpRenderTree/mac/UIDelegate.mm and 9 added 2 attributes (databaseDefaultQuota and databaseMaxQuota) to allow 10 tests to set appropriate quota settings to exercise quota expansion tests 11 when needed. 12 13 * DumpRenderTree/TestRunner.cpp: 14 (TestRunner::TestRunner): 15 (getDatabaseDefaultQuotaCallback): 16 (getDatabaseMaxQuotaCallback): 17 (setDatabaseDefaultQuotaCallback): 18 (setDatabaseMaxQuotaCallback): 19 (TestRunner::staticValues): 20 * DumpRenderTree/TestRunner.h: 21 (TestRunner::databaseDefaultQuota): 22 (TestRunner::setDatabaseDefaultQuota): 23 (TestRunner::databaseMaxQuota): 24 (TestRunner::setDatabaseMaxQuota): 25 * DumpRenderTree/blackberry/DumpRenderTree.cpp: 26 (BlackBerry::WebKit::DumpRenderTree::exceededDatabaseQuota): 27 * DumpRenderTree/efl/DumpRenderTreeView.cpp: 28 (onExceededDatabaseQuota): 29 * DumpRenderTree/mac/UIDelegate.mm: 30 (-[UIDelegate webView:frame:exceededDatabaseQuotaForSecurityOrigin:database:]): 31 * DumpRenderTree/win/UIDelegate.cpp: 32 (UIDelegate::exceededDatabaseQuota): 33 * WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl: 34 * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp: 35 (WTR::InjectedBundlePage::didExceedDatabaseQuota): 36 * WebKitTestRunner/InjectedBundle/TestRunner.cpp: 37 (WTR::TestRunner::TestRunner): 38 * WebKitTestRunner/InjectedBundle/TestRunner.h: 39 (WTR::TestRunner::databaseDefaultQuota): 40 (WTR::TestRunner::setDatabaseDefaultQuota): 41 (WTR::TestRunner::databaseMaxQuota): 42 (WTR::TestRunner::setDatabaseMaxQuota): 43 * WebKitTestRunner/TestController.cpp: 44 (WTR::TestController::createOtherPage): 45 (WTR::TestController::createWebViewWithOptions): 46 1 47 2013-10-31 Anders Carlsson <andersca@apple.com> 2 48 -
trunk/Tools/DumpRenderTree/TestRunner.cpp
r157691 r158447 111 111 , m_customFullScreenBehavior(false) 112 112 , m_hasPendingWebNotificationClick(false) 113 , m_databaseDefaultQuota(-1) 114 , m_databaseMaxQuota(-1) 113 115 , m_testPathOrURL(testPathOrURL) 114 116 , m_expectedPixelHash(expectedPixelHash) … … 1840 1842 } 1841 1843 1844 static JSValueRef getDatabaseDefaultQuotaCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception) 1845 { 1846 TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); 1847 return JSValueMakeNumber(context, controller->databaseDefaultQuota()); 1848 } 1849 1850 static JSValueRef getDatabaseMaxQuotaCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception) 1851 { 1852 TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); 1853 return JSValueMakeNumber(context, controller->databaseMaxQuota()); 1854 } 1855 1842 1856 static JSValueRef getWebHistoryItemCountCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception) 1843 1857 { … … 1877 1891 TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); 1878 1892 controller->setGlobalFlag(JSValueToBoolean(context, value)); 1893 return true; 1894 } 1895 1896 static bool setDatabaseDefaultQuotaCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef value, JSValueRef* exception) 1897 { 1898 TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); 1899 controller->setDatabaseDefaultQuota(JSValueToNumber(context, value, exception)); 1900 ASSERT(!*exception); 1901 return true; 1902 } 1903 1904 static bool setDatabaseMaxQuotaCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef value, JSValueRef* exception) 1905 { 1906 TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); 1907 controller->setDatabaseMaxQuota(JSValueToNumber(context, value, exception)); 1908 ASSERT(!*exception); 1879 1909 return true; 1880 1910 } … … 2051 2081 { "secureEventInputIsEnabled", getSecureEventInputIsEnabledCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 2052 2082 { "titleTextDirection", getTitleTextDirectionCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 2083 { "databaseDefaultQuota", getDatabaseDefaultQuotaCallback, setDatabaseDefaultQuotaCallback, kJSPropertyAttributeNone }, 2084 { "databaseMaxQuota", getDatabaseMaxQuotaCallback, setDatabaseMaxQuotaCallback, kJSPropertyAttributeNone }, 2053 2085 { 0, 0, 0, 0 } 2054 2086 }; -
trunk/Tools/DumpRenderTree/TestRunner.h
r157691 r158447 278 278 void setGlobalFlag(bool globalFlag) { m_globalFlag = globalFlag; } 279 279 280 double databaseDefaultQuota() const { return m_databaseDefaultQuota; } 281 void setDatabaseDefaultQuota(double quota) { m_databaseDefaultQuota = quota; } 282 283 double databaseMaxQuota() const { return m_databaseMaxQuota; } 284 void setDatabaseMaxQuota(double quota) { m_databaseMaxQuota = quota; } 285 280 286 bool deferMainResourceDataLoad() const { return m_deferMainResourceDataLoad; } 281 287 void setDeferMainResourceDataLoad(bool flag) { m_deferMainResourceDataLoad = flag; } … … 412 418 bool m_hasPendingWebNotificationClick; 413 419 420 double m_databaseDefaultQuota; 421 double m_databaseMaxQuota; 422 414 423 std::string m_authenticationUsername; 415 424 std::string m_authenticationPassword; -
trunk/Tools/DumpRenderTree/blackberry/DumpRenderTree.cpp
r157874 r158447 786 786 WebCore::DatabaseManager& manager = WebCore::DatabaseManager::manager(); 787 787 WebCore::DatabaseDetails details = detailsForNameAndOrigin(name, origin); 788 static const unsigned long long defaultQuota = 5 * 1024 * 1024; 789 static const unsigned long long maxQuota = 10 * 1024 * 1024; 788 unsigned long long defaultQuota = 5 * 1024 * 1024; 789 double testDefaultQuota = gTestRunner->databaseDefaultQuota(); 790 if (testDefaultQuota >= 0) 791 defaultQuota = testDefaultQuota; 792 790 793 unsigned long long newQuota = defaultQuota; 791 if (defaultQuota < expectedSize && expectedSize <= maxQuota) { 792 newQuota = expectedSize; 793 printf("UI DELEGATE DATABASE CALLBACK: increased quota to %llu\n", newQuota); 794 795 double maxQuota = gTestRunner->databaseMaxQuota(); 796 if (maxQuota >= 0) { 797 if (defaultQuota < expectedSize && expectedSize <= maxQuota) { 798 newQuota = expectedSize; 799 printf("UI DELEGATE DATABASE CALLBACK: increased quota to %llu\n", newQuota); 800 } 794 801 } 795 802 manager.setQuota(origin, newQuota); -
trunk/Tools/DumpRenderTree/efl/DumpRenderTreeView.cpp
r157922 r158447 135 135 ewk_security_origin_free(origin); 136 136 137 static const uint64_t defaultQuota = 5 * 1024 * 1024; 138 static const uint64_t maxQuota = 10 * 1024 * 1024; 139 if (defaultQuota < expectedSize && expectedSize <= maxQuota) { 140 printf("UI DELEGATE DATABASE CALLBACK: increased quota to %" PRIu64 "\n", expectedSize); 141 return expectedSize; 142 } 143 return defaultQuota; 137 uint64_t defaultQuota = 5 * 1024 * 1024; 138 double testDefaultQuota = gTestRunner->databaseDefaultQuota(); 139 if (testDefaultQuota >= 0) 140 defaultQuota = testDefaultQuota; 141 142 uint64_t newQuota = defaultQuota; 143 144 double maxQuota = gTestRunner->databaseMaxQuota(); 145 if (maxQuota >= 0) { 146 if (defaultQuota < expectedSize && expectedSize <= maxQuota) { 147 newQuota = expectedSize; 148 printf("UI DELEGATE DATABASE CALLBACK: increased quota to %" PRIu64 "\n", expectedSize); 149 } 150 } 151 return newQuota; 144 152 } 145 153 -
trunk/Tools/DumpRenderTree/mac/UIDelegate.mm
r157874 r158447 176 176 177 177 NSDictionary *databaseDetails = [[WebDatabaseManager sharedWebDatabaseManager] detailsForDatabase:databaseIdentifier withOrigin:origin]; 178 ASSERT(databaseDetails);179 178 unsigned long long expectedSize = [[databaseDetails objectForKey:WebDatabaseExpectedSizeKey] unsignedLongLongValue]; 180 static const unsigned long long defaultQuota = 5 * 1024 * 1024; 181 static const unsigned long long maxQuota = 10 * 1024 * 1024; 179 unsigned long long defaultQuota = 5 * 1024 * 1024; 180 double testDefaultQuota = gTestRunner->databaseDefaultQuota(); 181 if (testDefaultQuota >= 0) 182 defaultQuota = testDefaultQuota; 183 182 184 unsigned long long newQuota = defaultQuota; 183 if (defaultQuota < expectedSize && expectedSize <= maxQuota) { 184 newQuota = expectedSize; 185 printf("UI DELEGATE DATABASE CALLBACK: increased quota to %llu\n", newQuota); 185 186 double maxQuota = gTestRunner->databaseMaxQuota(); 187 if (maxQuota >= 0) { 188 if (defaultQuota < expectedSize && expectedSize <= maxQuota) { 189 newQuota = expectedSize; 190 printf("UI DELEGATE DATABASE CALLBACK: increased quota to %llu\n", newQuota); 191 } 186 192 } 187 193 [[origin databaseQuotaManager] setQuota:newQuota]; -
trunk/Tools/DumpRenderTree/win/UIDelegate.cpp
r157874 r158447 596 596 SysFreeString(host); 597 597 598 static const unsigned long long defaultQuota = 5 * 1024 * 1024; 599 static const unsigned long long maxQuota = 10 * 1024 * 1024; 598 unsigned long long defaultQuota = 5 * 1024 * 1024; 599 double testDefaultQuota = gTestRunner->databaseDefaultQuota(); 600 if (testDefaultQuota >= 0) 601 defaultQuota = testDefaultQuota; 600 602 601 603 COMPtr<IWebDatabaseManager> databaseManager; … … 619 621 unsigned long long expectedSize = V_UI8(&var); 620 622 unsigned long long newQuota = defaultQuota; 621 if (defaultQuota < expectedSize && expectedSize <= maxQuota) { 622 newQuota = expectedSize; 623 printf("UI DELEGATE DATABASE CALLBACK: increased quota to %llu\n", newQuota); 623 624 double maxQuota = gTestRunner->databaseMaxQuota(); 625 if (maxQuota >= 0) { 626 if (defaultQuota < expectedSize && expectedSize <= maxQuota) { 627 newQuota = expectedSize; 628 printf("UI DELEGATE DATABASE CALLBACK: increased quota to %llu\n", newQuota); 629 } 624 630 } 625 631 origin->setQuota(newQuota); -
trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl
r153376 r158447 104 104 DOMString pathToLocalResource(DOMString url); 105 105 106 attribute double databaseDefaultQuota; 107 attribute double databaseMaxQuota; 108 106 109 // Application Cache API 107 110 void clearAllApplicationCaches(); -
trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp
r157874 r158447 1449 1449 } 1450 1450 1451 static const uint64_t defaultQuota = 5 * 1024 * 1024; 1452 static const uint64_t maxQuota = 10 * 1024 * 1024; 1453 uint64_t newQuota = defaultQuota; 1454 if (defaultQuota < expectedUsageBytes && expectedUsageBytes <= maxQuota) { 1455 newQuota = expectedUsageBytes; 1456 1457 StringBuilder stringBuilder; 1458 stringBuilder.appendLiteral("UI DELEGATE DATABASE CALLBACK: increased quota to "); 1459 stringBuilder.appendNumber(newQuota); 1460 stringBuilder.append('\n'); 1461 InjectedBundle::shared().outputText(stringBuilder.toString()); 1451 uint64_t defaultQuota = 5 * 1024 * 1024; 1452 double testDefaultQuota = InjectedBundle::shared().testRunner()->databaseDefaultQuota(); 1453 if (testDefaultQuota >= 0) 1454 defaultQuota = testDefaultQuota; 1455 1456 unsigned long long newQuota = defaultQuota; 1457 1458 double maxQuota = InjectedBundle::shared().testRunner()->databaseMaxQuota(); 1459 if (maxQuota >= 0) { 1460 if (defaultQuota < expectedUsageBytes && expectedUsageBytes <= maxQuota) { 1461 newQuota = expectedUsageBytes; 1462 1463 StringBuilder stringBuilder; 1464 stringBuilder.appendLiteral("UI DELEGATE DATABASE CALLBACK: increased quota to "); 1465 stringBuilder.appendNumber(newQuota); 1466 stringBuilder.append('\n'); 1467 InjectedBundle::shared().outputText(stringBuilder.toString()); 1468 } 1462 1469 } 1463 1470 return newQuota; -
trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp
r157691 r158447 94 94 , m_globalFlag(false) 95 95 , m_customFullScreenBehavior(false) 96 , m_databaseDefaultQuota(-1) 97 , m_databaseMaxQuota(-1) 96 98 , m_userStyleSheetEnabled(false) 97 99 , m_userStyleSheetLocation(adoptWK(WKStringCreateWithUTF8CString(""))) -
trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h
r158266 r158447 221 221 void setGlobalFlag(bool value) { m_globalFlag = value; } 222 222 223 double databaseDefaultQuota() const { return m_databaseDefaultQuota; } 224 void setDatabaseDefaultQuota(double quota) { m_databaseDefaultQuota = quota; } 225 226 double databaseMaxQuota() const { return m_databaseMaxQuota; } 227 void setDatabaseMaxQuota(double quota) { m_databaseMaxQuota = quota; } 228 223 229 void addChromeInputField(JSValueRef); 224 230 void removeChromeInputField(JSValueRef); … … 322 328 int m_timeout; 323 329 330 double m_databaseDefaultQuota; 331 double m_databaseMaxQuota; 332 324 333 bool m_userStyleSheetEnabled; 325 334 WKRetainPtr<WKStringRef> m_userStyleSheetLocation; -
trunk/Tools/WebKitTestRunner/TestController.cpp
r158326 r158447 143 143 return TestController::shared().beforeUnloadReturnValue(); 144 144 } 145 146 static unsigned long long exceededDatabaseQuota(WKPageRef, WKFrameRef, WKSecurityOriginRef, WKStringRef, WKStringRef, unsigned long long, unsigned long long, unsigned long long, unsigned long long expectedUsage, const void*)147 {148 static const unsigned long long defaultQuota = 5 * 1024 * 1024;149 static const unsigned long long maxQuota = 10 * 1024 * 1024;150 unsigned long long newQuota = defaultQuota;151 if (defaultQuota < expectedUsage && expectedUsage <= maxQuota) {152 newQuota = expectedUsage;153 printf("UI DELEGATE DATABASE CALLBACK: increased quota to %llu\n", newQuota);154 }155 return newQuota;156 }157 158 145 159 146 void TestController::runModal(WKPageRef page, const void* clientInfo) … … 234 221 0, // didDraw 235 222 0, // pageDidScroll 236 exceededDatabaseQuota,223 0, // exceededDatabaseQuota 237 224 0, // runOpenPanel 238 225 decidePolicyForGeolocationPermissionRequest, … … 435 422 0, // didDraw 436 423 0, // pageDidScroll 437 exceededDatabaseQuota,424 0, // exceededDatabaseQuota, 438 425 0, // runOpenPanel 439 426 decidePolicyForGeolocationPermissionRequest,
Note:
See TracChangeset
for help on using the changeset viewer.