Changeset 251592 in webkit
- Timestamp:
- Oct 25, 2019 8:44:20 AM (5 years ago)
- Location:
- trunk
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r251591 r251592 1 2019-10-25 Chris Dumez <cdumez@apple.com> 2 3 Unreviewed, rolling out r251586. 4 5 New test is flaky 6 7 Reverted changeset: 8 9 "DatabaseContext should not prevent entering the back/forward 10 cache" 11 https://bugs.webkit.org/show_bug.cgi?id=203103 12 https://trac.webkit.org/changeset/251586 13 1 14 2019-10-25 Antoine Quint <graouts@apple.com> 2 15 -
trunk/LayoutTests/fast/history/page-cache-webdatabase-pending-transaction-expected.txt
r251586 r251592 1 CONSOLE MESSAGE: line 55: Web SQL is deprecated. Please use IndexedDB instead. 2 Tests that a page with an open WebDatabase that has pending transactions is able to go into the back/forward cache. 1 Tests that a page with an open WebDatabase that has pending transactions does not go into the page cache. 3 2 4 3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". … … 6 5 7 6 pageshow - not from cache 8 pagehide - entering cache 9 pageshow - from cache 10 PASS Page did enter and was restored from the back/forward cache 11 PASS All transactions succeeded 7 PASS Page was not restored from page cache 12 8 PASS successfullyParsed is true 13 9 -
trunk/LayoutTests/fast/history/page-cache-webdatabase-pending-transaction.html
r251586 r251592 3 3 <html> 4 4 <body> 5 <script src="../../resources/js-test .js"></script>5 <script src="../../resources/js-test-pre.js"></script> 6 6 <script> 7 description('Tests that a page with an open WebDatabase that has pending transactions is able to go into the back/forward cache.'); 8 jsTestIsAsync = true; 9 let restoredFromCache = false; 10 let pendingTransactionCount = 0; 7 description('Tests that a page with an open WebDatabase that has pending transactions does not go into the page cache.'); 8 window.jsTestIsAsync = true; 11 9 12 10 if (window.testRunner) 13 11 testRunner.clearAllDatabases(); 14 12 15 function checkTestComplete()16 {17 if (!pendingTransactionCount && restoredFromCache) {18 testPassed("All transactions succeeded");19 finishJSTest();20 }21 }22 23 13 window.addEventListener("pageshow", function(event) { 24 14 debug("pageshow - " + (event.persisted ? "" : "not ") + "from cache"); 15 if (!window.sessionStorage.page_cache_open_webdatabase_test_started) 16 return; 25 17 26 if (event.persisted) { 27 testPassed("Page did enter and was restored from the back/forward cache"); 28 restoredFromCache = true; 29 checkTestComplete(); 30 } 18 delete window.sessionStorage.page_cache_open_webdatabase_test_started; 19 20 if (event.persisted) 21 testFailed("Page did enter and was restored from the page cache"); 22 else 23 testPassed("Page was not restored from page cache"); 24 finishJSTest(); 31 25 }, false); 32 26 33 27 window.addEventListener("pagehide", function(event) { 34 28 debug("pagehide - " + (event.persisted ? "" : "not ") + "entering cache"); 35 if ( !event.persisted) {36 testFailed("Page failed to enter the back/forwardcache.");29 if (event.persisted) { 30 testFailed("Page entered the page cache."); 37 31 finishJSTest(); 38 32 } 39 33 }, false); 40 34 41 function handleTransactionSuccess() 42 { 43 pendingTransactionCount--; 44 checkTestComplete(); 45 } 35 window.addEventListener('load', function() { 36 // Open the database. 37 db = openDatabase("PageCacheTest", "", "Page Cache Test", 32768); 46 38 47 function handleTransactionError() 48 { 49 testFailed("Transaction failed"); 50 finishJSTest(); 51 } 39 db.transaction(function(tx) { 40 // Force a back navigation back to this page. 41 window.sessionStorage.page_cache_open_webdatabase_test_started = true; 42 window.location.href = "resources/page-cache-helper.html"; 52 43 53 window.addEventListener('load', function() { 54 setTimeout(() => { 55 db = openDatabase("PageCacheTest", "", "Back Forward Cache Test", 32768); 44 tx.executeSql('CREATE TABLE IF NOT EXISTS LOGS (id unique, log)'); 45 }); 56 46 57 db.transaction(function(tx) { 58 window.location.href = "resources/page-cache-helper.html"; 47 db.transaction(function(tx) { 48 tx.executeSql('CREATE TABLE IF NOT EXISTS LOGS2 (id unique, log)'); 49 }); 59 50 60 pendingTransactionCount++; 61 tx.executeSql('CREATE TABLE IF NOT EXISTS LOGS (id unique, log)', [], handleTransactionSuccess, handleTransactionError); 62 }); 51 db.transaction(function(tx) { 52 tx.executeSql('CREATE TABLE IF NOT EXISTS LOGS3 (id unique, log)'); 53 }); 54 }, false); 63 55 64 db.transaction(function(tx) {65 pendingTransactionCount++;66 tx.executeSql('CREATE TABLE IF NOT EXISTS LOGS2 (id unique, log)', [], handleTransactionSuccess, handleTransactionError);67 });68 69 db.transaction(function(tx) {70 pendingTransactionCount++;71 tx.executeSql('CREATE TABLE IF NOT EXISTS LOGS3 (id unique, log)', [], handleTransactionSuccess, handleTransactionError);72 });73 }, 0);74 }, false);75 56 </script> 57 <script src="../../resources/js-test-post.js"></script> 76 58 </body> 77 59 </html> -
trunk/LayoutTests/platform/gtk/TestExpectations
r251591 r251592 1661 1661 1662 1662 webkit.org/b/145051 media/video-rtl.html [ ImageOnlyFailure Pass ] 1663 webkit.org/b/145052 fast/history/page-cache-webdatabase-pending-transaction.html [ Failure Pass ] 1663 1664 1664 1665 webkit.org/b/145167 transforms/2d/perspective-not-fixed-container.html [ ImageOnlyFailure Pass ] -
trunk/LayoutTests/platform/mac/TestExpectations
r251586 r251592 1199 1199 [ Sierra+ ] editing/selection/triple-click-in-pre.html [ Failure ] 1200 1200 1201 webkit.org/b/159379 fast/history/page-cache-webdatabase-pending-transaction.html [ Pass Failure ] 1202 1201 1203 # rdar://problem/31243824 1202 1204 webkit.org/b/158747 media/restore-from-page-cache.html [ Pass Failure Crash ] -
trunk/Source/WebCore/ChangeLog
r251590 r251592 1 2019-10-25 Chris Dumez <cdumez@apple.com> 2 3 Unreviewed, rolling out r251586. 4 5 New test is flaky 6 7 Reverted changeset: 8 9 "DatabaseContext should not prevent entering the back/forward 10 cache" 11 https://bugs.webkit.org/show_bug.cgi?id=203103 12 https://trac.webkit.org/changeset/251586 13 1 14 2019-10-25 Zalan Bujtas <zalan@apple.com> 2 15 -
trunk/Source/WebCore/Modules/webdatabase/Database.cpp
r251586 r251592 53 53 #include "SecurityOrigin.h" 54 54 #include "VoidCallback.h" 55 #include "WindowEventLoop.h"56 55 #include <wtf/NeverDestroyed.h> 57 56 #include <wtf/RefPtr.h> … … 686 685 void Database::runTransaction(RefPtr<SQLTransactionCallback>&& callback, RefPtr<SQLTransactionErrorCallback>&& errorCallback, RefPtr<VoidCallback>&& successCallback, RefPtr<SQLTransactionWrapper>&& wrapper, bool readOnly) 687 686 { 688 ASSERT(isMainThread());689 687 LockHolder locker(m_transactionInProgressMutex); 690 688 if (!m_isTransactionQueueEnabled) { 691 689 if (errorCallback) { 692 m_document->eventLoop().queueTask(TaskSource::Networking, m_document,[errorCallback = makeRef(*errorCallback)]() {690 callOnMainThread([errorCallback = makeRef(*errorCallback)]() { 693 691 errorCallback->handleEvent(SQLError::create(SQLError::UNKNOWN_ERR, "database has been closed")); 694 692 }); -
trunk/Source/WebCore/Modules/webdatabase/DatabaseContext.cpp
r251586 r251592 131 131 } 132 132 133 // FIXME: This should never prevent entering the back/forward cache. 134 bool DatabaseContext::shouldPreventEnteringBackForwardCache_DEPRECATED() const 135 { 136 if (!hasOpenDatabases() || !m_databaseThread) 137 return false; 138 139 return m_databaseThread->hasPendingDatabaseActivity(); 140 } 141 133 142 DatabaseThread* DatabaseContext::databaseThread() 134 143 { -
trunk/Source/WebCore/Modules/webdatabase/DatabaseContext.h
r251586 r251592 74 74 void contextDestroyed() override; 75 75 void stop() override; 76 bool shouldPreventEnteringBackForwardCache_DEPRECATED() const override; 76 77 const char* activeDOMObjectName() const override { return "DatabaseContext"; } 77 78 -
trunk/Source/WebCore/Modules/webdatabase/DatabaseManager.cpp
r251586 r251592 39 39 #include "SecurityOrigin.h" 40 40 #include "SecurityOriginData.h" 41 #include "WindowEventLoop.h"42 41 #include <wtf/NeverDestroyed.h> 43 42 … … 194 193 ExceptionOr<Ref<Database>> DatabaseManager::openDatabase(Document& document, const String& name, const String& expectedVersion, const String& displayName, unsigned estimatedSize, RefPtr<DatabaseCallback>&& creationCallback) 195 194 { 196 ASSERT(isMainThread());197 195 ScriptController::initializeThreading(); 198 196 … … 211 209 LOG(StorageAPI, "Scheduling DatabaseCreationCallbackTask for database %p\n", database.get()); 212 210 database->setHasPendingCreationEvent(true); 213 database->m_document-> eventLoop().queueTask(TaskSource::Networking, database->m_document, [creationCallback, database]() {211 database->m_document->postTask([creationCallback, database] (ScriptExecutionContext&) { 214 212 creationCallback->handleEvent(*database); 215 213 database->setHasPendingCreationEvent(false); -
trunk/Source/WebCore/Modules/webdatabase/SQLTransaction.cpp
r251586 r251592 48 48 #include "SQLiteTransaction.h" 49 49 #include "VoidCallback.h" 50 #include "WindowEventLoop.h"51 50 #include <wtf/Optional.h> 52 51 #include <wtf/StdLibExtras.h> … … 111 110 void SQLTransaction::performPendingCallback() 112 111 { 113 ASSERT(isMainThread()); 114 m_database->document().eventLoop().queueTask(TaskSource::Networking, m_database->document(), [this, protectedThis = makeRef(*this)]() mutable { 115 LOG(StorageAPI, "Callback %s\n", debugStepName(m_nextStep)); 116 117 ASSERT(m_nextStep == &SQLTransaction::deliverTransactionCallback 118 || m_nextStep == &SQLTransaction::deliverTransactionErrorCallback 119 || m_nextStep == &SQLTransaction::deliverStatementCallback 120 || m_nextStep == &SQLTransaction::deliverQuotaIncreaseCallback 121 || m_nextStep == &SQLTransaction::deliverSuccessCallback); 122 123 checkAndHandleClosedDatabase(); 124 125 if (m_nextStep) 126 (this->*m_nextStep)(); 127 }); 112 LOG(StorageAPI, "Callback %s\n", debugStepName(m_nextStep)); 113 114 ASSERT(m_nextStep == &SQLTransaction::deliverTransactionCallback 115 || m_nextStep == &SQLTransaction::deliverTransactionErrorCallback 116 || m_nextStep == &SQLTransaction::deliverStatementCallback 117 || m_nextStep == &SQLTransaction::deliverQuotaIncreaseCallback 118 || m_nextStep == &SQLTransaction::deliverSuccessCallback); 119 120 checkAndHandleClosedDatabase(); 121 122 if (m_nextStep) 123 (this->*m_nextStep)(); 128 124 } 129 125
Note: See TracChangeset
for help on using the changeset viewer.