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

Unified Diff: trunk/src/chrome/browser/extensions/activity_log_unittest.cc

Issue 12664009: Revert 189134 "Due to privacy concerns about the data contained ..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 9 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: trunk/src/chrome/browser/extensions/activity_log_unittest.cc
===================================================================
--- trunk/src/chrome/browser/extensions/activity_log_unittest.cc (revision 189153)
+++ trunk/src/chrome/browser/extensions/activity_log_unittest.cc (working copy)
@@ -50,23 +50,6 @@
ASSERT_EQ(2, static_cast<int>(i->size()));
}
- static void Arguments_Missing(
- scoped_ptr<std::vector<scoped_refptr<Action> > > i) {
- scoped_refptr<Action> last = i->front();
- std::string noargs = "ID: odlameecjipmbmbejkplpemijjgpljce, CATEGORY: "
- "CALL, VERB: UNKNOWN_VERB, TARGET: TABS, API: tabs.testMethod, ARGS: ";
- ASSERT_EQ(noargs, last->PrettyPrintForDebug());
- }
-
- static void Arguments_Present(
- scoped_ptr<std::vector<scoped_refptr<Action> > > i) {
- scoped_refptr<Action> last = i->front();
- std::string args = "ID: odlameecjipmbmbejkplpemijjgpljce, CATEGORY: "
- "CALL, VERB: UNKNOWN_VERB, TARGET: UNKNOWN_TARGET, API: "
- "extension.connect, ARGS: \"hello\", \"world\"";
- ASSERT_EQ(args, last->PrettyPrintForDebug());
- }
-
protected:
ExtensionService* extension_service_;
Profile* profile_;
@@ -129,55 +112,5 @@
base::Bind(ActivityLogTest::RetrieveActions_LogAndFetchActions));
}
-TEST_F(ActivityLogTest, LogWithoutArguments) {
- ActivityLog* activity_log = ActivityLog::GetInstance(profile_);
- scoped_refptr<const Extension> extension =
- ExtensionBuilder()
- .SetManifest(DictionaryBuilder()
- .Set("name", "Test extension")
- .Set("version", "1.0.0")
- .Set("manifest_version", 2))
- .Build();
- extension_service_->AddExtension(extension);
- ASSERT_TRUE(ActivityLog::IsLogEnabled());
-
- scoped_ptr<ListValue> args(new ListValue());
- args->Set(0, new base::StringValue("hello"));
- args->Set(1, new base::StringValue("world"));
- activity_log->LogAPIAction(extension,
- std::string("tabs.testMethod"),
- args.get(),
- "");
- activity_log->GetActions(
- extension->id(),
- 0,
- base::Bind(ActivityLogTest::Arguments_Missing));
-}
-
-TEST_F(ActivityLogTest, LogWithArguments) {
- ActivityLog* activity_log = ActivityLog::GetInstance(profile_);
- scoped_refptr<const Extension> extension =
- ExtensionBuilder()
- .SetManifest(DictionaryBuilder()
- .Set("name", "Test extension")
- .Set("version", "1.0.0")
- .Set("manifest_version", 2))
- .Build();
- extension_service_->AddExtension(extension);
- ASSERT_TRUE(ActivityLog::IsLogEnabled());
-
- scoped_ptr<ListValue> args(new ListValue());
- args->Set(0, new base::StringValue("hello"));
- args->Set(1, new base::StringValue("world"));
- activity_log->LogAPIAction(extension,
- std::string("extension.connect"),
- args.get(),
- "");
- activity_log->GetActions(
- extension->id(),
- 0,
- base::Bind(ActivityLogTest::Arguments_Present));
-}
-
} // namespace extensions
« no previous file with comments | « trunk/src/chrome/browser/extensions/activity_log.cc ('k') | trunk/src/chrome/browser/extensions/api_actions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698