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

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

Issue 11946028: Record event activity to the extension activity log. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rename ActivityLog::IsLoggingEnabled Created 7 years, 11 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_unittest.cc
diff --git a/chrome/browser/extensions/activity_log_unittest.cc b/chrome/browser/extensions/activity_log_unittest.cc
index 5fae659732fd2e443e3298434d11856b4786d2b0..426a73478de15e2b172a8cc9e6d8e8edc2be39fb 100644
--- a/chrome/browser/extensions/activity_log_unittest.cc
+++ b/chrome/browser/extensions/activity_log_unittest.cc
@@ -37,6 +37,7 @@ class ActivityLogTest : public ChromeRenderViewHostTestHarness {
&command_line, FilePath(), false);
CommandLine::ForCurrentProcess()->AppendSwitch(
switches::kEnableExtensionActivityUI);
+ ActivityLog::RecomputeLoggingIsEnabled();
db_thread_.Start();
}
@@ -61,8 +62,7 @@ class ActivityLogTest : public ChromeRenderViewHostTestHarness {
};
TEST_F(ActivityLogTest, Enabled) {
- ActivityLog* activity_log = ActivityLog::GetInstance(profile_);
- ASSERT_TRUE(activity_log->IsLoggingEnabled());
+ ASSERT_TRUE(ActivityLog::IsLogEnabled());
}
TEST_F(ActivityLogTest, ConstructAndLog) {
@@ -79,7 +79,7 @@ TEST_F(ActivityLogTest, ConstructAndLog) {
for (int i = 0; i < 30; i++) {
// Run this a bunch of times and hope that if something goes wrong with
// threading, 30 times is enough to cause it to fail.
- ASSERT_TRUE(activity_log->IsLoggingEnabled());
+ ASSERT_TRUE(ActivityLog::IsLogEnabled());
activity_log->LogAPIAction(extension,
std::string("tabs.testMethod"),
args.get(),
@@ -95,9 +95,10 @@ TEST_F(ActivityLogTest, ConstructAndLog) {
std::string(APIAction::kTableName);
sql::Statement statement(db.GetUniqueStatement(sql_str.c_str()));
ASSERT_TRUE(statement.Step());
- ASSERT_EQ("UNKNOWN_ACTION", statement.ColumnString(2));
- ASSERT_EQ("TABS", statement.ColumnString(3));
- ASSERT_EQ("tabs.testMethod()", statement.ColumnString(4));
+ ASSERT_EQ("CALL", statement.ColumnString(2));
+ ASSERT_EQ("UNKNOWN_VERB", statement.ColumnString(3));
+ ASSERT_EQ("TABS", statement.ColumnString(4));
+ ASSERT_EQ("tabs.testMethod()", statement.ColumnString(5));
}
} // namespace extensions
« no previous file with comments | « chrome/browser/extensions/activity_log.cc ('k') | chrome/browser/extensions/api/web_request/web_request_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698