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

Unified Diff: chrome/browser/extensions/activity_log/activity_log_policy_unittest.cc

Issue 23567022: [Activity log] Generalize the whitelist for keeping arguments (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rebase 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/activity_log/activity_log_policy_unittest.cc
diff --git a/chrome/browser/extensions/activity_log/activity_log_policy_unittest.cc b/chrome/browser/extensions/activity_log/activity_log_policy_unittest.cc
index 9ad74ae0ea7f02f84f310c089ecad28094411fa9..0d64928cfee78bb69adca822399bc156087b5fc5 100644
--- a/chrome/browser/extensions/activity_log/activity_log_policy_unittest.cc
+++ b/chrome/browser/extensions/activity_log/activity_log_policy_unittest.cc
@@ -59,8 +59,9 @@ TEST_F(ActivityLogPolicyUtilTest, StripPrivacySensitiveWebRequest) {
// Test that argument values are stripped as appropriate.
TEST_F(ActivityLogPolicyUtilTest, StripArguments) {
- std::set<std::string> whitelist;
- whitelist.insert("tabs.executeScript");
+ ActivityLogPolicy::Util::ApiSet whitelist;
+ whitelist.insert(
+ std::make_pair(Action::ACTION_API_CALL, "tabs.executeScript"));
// API is in whitelist; not stripped.
scoped_refptr<Action> action =
@@ -78,13 +79,6 @@ TEST_F(ActivityLogPolicyUtilTest, StripArguments) {
action->mutable_args()->AppendString("woof");
ActivityLogPolicy::Util::StripArguments(whitelist, action);
ASSERT_EQ("", ActivityLogPolicy::Util::Serialize(action->args()));
-
- // Not an API type: not stripped.
- action = new Action(
- "punky", base::Time::Now(), Action::ACTION_DOM_ACCESS, "tabs.create");
- action->mutable_args()->AppendString("woof");
- ActivityLogPolicy::Util::StripArguments(whitelist, action);
- ASSERT_EQ("[\"woof\"]", ActivityLogPolicy::Util::Serialize(action->args()));
}
// Test parsing of URLs serialized to strings.

Powered by Google App Engine
This is Rietveld 408576698