Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(56)

Unified Diff: components/history/core/test/fake_web_history_service.h

Issue 1983073002: Query the existence other forms of browsing history. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nit. Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/history/core/test/BUILD.gn ('k') | components/history/core/test/fake_web_history_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/history/core/test/fake_web_history_service.h
diff --git a/components/history/core/test/fake_web_history_service.h b/components/history/core/test/fake_web_history_service.h
index 79a5b37bc5fde0c57bbbd7840268e6497374bf2c..7832e273441ef9eb569903bf31e922eaf8eb628e 100644
--- a/components/history/core/test/fake_web_history_service.h
+++ b/components/history/core/test/fake_web_history_service.h
@@ -24,11 +24,9 @@ namespace history {
// Use |SetupFakeResponse| to influence whether the requests should succeed
// or fail, and with which error code.
//
-// Note: Currently, the only test that uses this class only counts the number
-// of visits and does not inspect their contents. Therefore, the behavior
-// of this class is only defined for |WebHistoryService::QueryHistory| queries
-// and even for them, we only return the correct number of items, without
-// contents.
+// Note: The behavior of this class is only defined for some WebHistoryService
+// queries. If needed, improve FakeRequest::GetResponseBody() to simulate
+// responses for other queries.
//
// TODO(msramek): This class might need its own set of tests.
class FakeWebHistoryService : public history::WebHistoryService {
@@ -53,6 +51,14 @@ class FakeWebHistoryService : public history::WebHistoryService {
// Counts the number of visits within a certain time range.
int GetNumberOfVisitsBetween(const base::Time& begin, const base::Time& end);
+ // Get and set the fake state of web and app activity.
+ bool IsWebAndAppActivityEnabled();
+ void SetWebAndAppActivityEnabled(bool enabled);
+
+ // Get and set the fake state of other forms of browsing history.
+ bool AreOtherFormsOfBrowsingHistoryPresent();
+ void SetOtherFormsOfBrowsingHistoryPresent(bool present);
+
private:
base::Time GetTimeForKeyInQuery(const GURL& url, const std::string& key);
@@ -64,6 +70,10 @@ class FakeWebHistoryService : public history::WebHistoryService {
bool emulate_success_;
int emulate_response_code_;
+ // States of serverside corpora.
+ bool web_and_app_activity_enabled_;
+ bool other_forms_of_browsing_history_present_;
+
// Fake visits storage.
typedef std::pair<std::string, base::Time> Visit;
std::vector<Visit> visits_;
« no previous file with comments | « components/history/core/test/BUILD.gn ('k') | components/history/core/test/fake_web_history_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698