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

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

Issue 2263613002: Make BrowsingDataHandler observe WebHistoryService deletions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Moved comments inside 'if'. Created 4 years, 4 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/browser/web_history_service_observer.h ('k') | no next file » | 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.cc
diff --git a/components/history/core/test/fake_web_history_service.cc b/components/history/core/test/fake_web_history_service.cc
index 8db715bf96c5d1b2270843ac03c8cb810a0a96e1..4f8970534e8f71c7e2cf5e8070161bab6b0427bb 100644
--- a/components/history/core/test/fake_web_history_service.cc
+++ b/components/history/core/test/fake_web_history_service.cc
@@ -24,8 +24,9 @@ namespace {
// TODO(msramek): Find a way to keep these URLs in sync with what is used
// in WebHistoryService.
-const char kLookupUrl[] =
- "https://history.google.com/history/api/lookup";
+const char kLookupUrl[] = "https://history.google.com/history/api/lookup";
+
+const char kDeleteUrl[] = "https://history.google.com/history/api/delete";
const char kChromeClient[] = "chrome";
@@ -105,8 +106,8 @@ const std::string& FakeRequest::GetResponseBody() {
remove_query.ClearQuery();
GURL base_url = url_.ReplaceComponents(remove_query);
- // History query.
if (base_url == GURL(kLookupUrl) && client == kChromeClient) {
+ // History query.
int count = service_->GetNumberOfVisitsBetween(begin_, end_);
if (max_count_ && max_count_ < count)
count = max_count_;
@@ -115,17 +116,19 @@ const std::string& FakeRequest::GetResponseBody() {
for (int i = 0; i < count; ++i)
response_body_ += i ? ", {}" : "{}";
response_body_ += "] }";
- }
- // Web and app activity query.
- if (base_url == GURL(kLookupUrl) && client == kWebAndAppClient) {
+ } else if (base_url == GURL(kDeleteUrl) && client == kChromeClient) {
+ // Deletion query.
+ response_body_ = "{ \"just needs to be\" : \"a valid JSON.\" }";
+
+ } else if (base_url == GURL(kLookupUrl) && client == kWebAndAppClient) {
+ // Web and app activity query.
response_body_ = base::StringPrintf(
"{ \"history_recording_enabled\": %s }",
service_->IsWebAndAppActivityEnabled() ? "true" : "false");
- }
- // Other forms of browsing history query.
- if (url_.host() == kSyncServerHost) {
+ } else if (url_.host() == kSyncServerHost) {
+ // Other forms of browsing history query.
std::unique_ptr<sync_pb::HistoryStatusResponse> history_status(
new sync_pb::HistoryStatusResponse());
history_status->set_has_derived_data(
« no previous file with comments | « components/history/core/browser/web_history_service_observer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698