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

Side by Side Diff: chrome/browser/extensions/activity_log/activity_log_policy_unittest.cc

Issue 23432006: [Activity log] Strip incognito URLs entirely from the database (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 7 years, 3 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/extensions/activity_log/activity_log_policy.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/values.h" 5 #include "base/values.h"
6 #include "chrome/browser/extensions/activity_log/activity_action_constants.h" 6 #include "chrome/browser/extensions/activity_log/activity_action_constants.h"
7 #include "chrome/browser/extensions/activity_log/activity_actions.h" 7 #include "chrome/browser/extensions/activity_log/activity_actions.h"
8 #include "chrome/browser/extensions/activity_log/activity_log_policy.h" 8 #include "chrome/browser/extensions/activity_log/activity_log_policy.h"
9 #include "chrome/browser/extensions/activity_log/web_request_constants.h" 9 #include "chrome/browser/extensions/activity_log/web_request_constants.h"
10 #include "chrome/common/extensions/value_builder.h" 10 #include "chrome/common/extensions/value_builder.h"
(...skipping 14 matching lines...) Expand all
25 action->set_page_url(GURL("http://www.google.com/")); 25 action->set_page_url(GURL("http://www.google.com/"));
26 action->set_page_incognito(true); 26 action->set_page_incognito(true);
27 action->set_page_title("private"); 27 action->set_page_title("private");
28 action->set_arg_url(GURL("http://www.youtube.com/?privatekey")); 28 action->set_arg_url(GURL("http://www.youtube.com/?privatekey"));
29 29
30 ASSERT_EQ("<incognito>http://www.google.com/", action->SerializePageUrl()); 30 ASSERT_EQ("<incognito>http://www.google.com/", action->SerializePageUrl());
31 31
32 ActivityLogPolicy::Util::StripPrivacySensitiveFields(action); 32 ActivityLogPolicy::Util::StripPrivacySensitiveFields(action);
33 33
34 ASSERT_FALSE(action->page_url().is_valid()); 34 ASSERT_FALSE(action->page_url().is_valid());
35 ASSERT_EQ("<incognito>", action->SerializePageUrl()); 35 ASSERT_EQ("", action->SerializePageUrl());
36 ASSERT_EQ("", action->page_title()); 36 ASSERT_EQ("", action->page_title());
37 ASSERT_EQ("http://www.youtube.com/", action->arg_url().spec()); 37 ASSERT_EQ("http://www.youtube.com/", action->arg_url().spec());
38 } 38 }
39 39
40 // Test that WebRequest details are stripped for privacy. 40 // Test that WebRequest details are stripped for privacy.
41 TEST_F(ActivityLogPolicyUtilTest, StripPrivacySensitiveWebRequest) { 41 TEST_F(ActivityLogPolicyUtilTest, StripPrivacySensitiveWebRequest) {
42 scoped_refptr<Action> action = new Action( 42 scoped_refptr<Action> action = new Action(
43 "punky", base::Time::Now(), Action::ACTION_WEB_REQUEST, "webRequest"); 43 "punky", base::Time::Now(), Action::ACTION_WEB_REQUEST, "webRequest");
44 action->mutable_other()->Set( 44 action->mutable_other()->Set(
45 activity_log_constants::kActionWebRequest, 45 activity_log_constants::kActionWebRequest,
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 new Action("punky", 93 new Action("punky",
94 base::Time::Now(), 94 base::Time::Now(),
95 Action::ACTION_API_CALL, 95 Action::ACTION_API_CALL,
96 "tabs.executeScript"); 96 "tabs.executeScript");
97 action->ParsePageUrl("<incognito>http://www.google.com/"); 97 action->ParsePageUrl("<incognito>http://www.google.com/");
98 EXPECT_EQ("http://www.google.com/", action->page_url().spec()); 98 EXPECT_EQ("http://www.google.com/", action->page_url().spec());
99 EXPECT_TRUE(action->page_incognito()); 99 EXPECT_TRUE(action->page_incognito());
100 } 100 }
101 101
102 } // namespace extensions 102 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/activity_log/activity_log_policy.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698