(Test fix) Override minimumTimeBetweenDataRecordsRemoval in ResourceLoadStatisticsSto...
authorwilander@apple.com <wilander@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 20 Mar 2019 19:01:32 +0000 (19:01 +0000)
committerwilander@apple.com <wilander@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 20 Mar 2019 19:01:32 +0000 (19:01 +0000)
https://bugs.webkit.org/show_bug.cgi?id=196017

Unreviewed test fix.

This patch adds a check of parameters().isRunningTest to the return of
ResourceLoadStatisticsStore::shouldRemoveDataRecord() to allow successive
layout tests to remove website data, effectively overriding the
minimumTimeBetweenDataRecordsRemoval setting.

* NetworkProcess/Classifier/ResourceLoadStatisticsStore.cpp:
(WebKit::ResourceLoadStatisticsStore::shouldRemoveDataRecords const):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@243222 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit/ChangeLog
Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsStore.cpp

index 58b2d91..82b2d7a 100644 (file)
@@ -1,3 +1,18 @@
+2019-03-20  John Wilander  <wilander@apple.com>
+
+        (Test fix) Override minimumTimeBetweenDataRecordsRemoval in ResourceLoadStatisticsStore::shouldRemoveDataRecord() during layout tests
+        https://bugs.webkit.org/show_bug.cgi?id=196017
+
+        Unreviewed test fix.
+
+        This patch adds a check of parameters().isRunningTest to the return of
+        ResourceLoadStatisticsStore::shouldRemoveDataRecord() to allow successive
+        layout tests to remove website data, effectively overriding the
+        minimumTimeBetweenDataRecordsRemoval setting.
+
+        * NetworkProcess/Classifier/ResourceLoadStatisticsStore.cpp:
+        (WebKit::ResourceLoadStatisticsStore::shouldRemoveDataRecords const):
+
 2019-03-20  Daniel Bates  <dabates@apple.com>
 
         [iOS] Group UIWebFormAccessoryDelegate-related code and tighten it up a bit
index c20d092..2291fd3 100644 (file)
@@ -406,7 +406,7 @@ bool ResourceLoadStatisticsStore::shouldRemoveDataRecords() const
     }
 #endif
 
-    return !m_lastTimeDataRecordsWereRemoved || MonotonicTime::now() >= (m_lastTimeDataRecordsWereRemoved + m_parameters.minimumTimeBetweenDataRecordsRemoval);
+    return !m_lastTimeDataRecordsWereRemoved || MonotonicTime::now() >= (m_lastTimeDataRecordsWereRemoved + m_parameters.minimumTimeBetweenDataRecordsRemoval) || parameters().isRunningTest;
 }
 
 void ResourceLoadStatisticsStore::setDataRecordsBeingRemoved(bool value)