Chromium Code Reviews| Index: chrome/browser/extensions/activity_log/activity_log_unittest.cc |
| diff --git a/chrome/browser/extensions/activity_log/activity_log_unittest.cc b/chrome/browser/extensions/activity_log/activity_log_unittest.cc |
| index 62ab52ad0d6cb1c3c8feee4b4c9b734ff98e03f3..2da736d5f7a6b995300042f2f83b9fd476ea4d65 100644 |
| --- a/chrome/browser/extensions/activity_log/activity_log_unittest.cc |
| +++ b/chrome/browser/extensions/activity_log/activity_log_unittest.cc |
| @@ -61,7 +61,7 @@ class ActivityLogTest : public ChromeRenderViewHostTestHarness { |
| static void Arguments_Missing( |
| scoped_ptr<std::vector<scoped_refptr<Action> > > i) { |
| scoped_refptr<Action> last = i->front(); |
| - std::string noargs = "ID: odlameecjipmbmbejkplpemijjgpljce, CATEGORY: " |
| + std::string noargs = "ID: abc, CATEGORY: " |
| "CALL, API: tabs.testMethod, ARGS: "; |
| ASSERT_EQ(noargs, last->PrintForDebug()); |
| } |
| @@ -69,7 +69,7 @@ class ActivityLogTest : public ChromeRenderViewHostTestHarness { |
| static void Arguments_Present( |
| scoped_ptr<std::vector<scoped_refptr<Action> > > i) { |
| scoped_refptr<Action> last = i->front(); |
| - std::string args = "ID: odlameecjipmbmbejkplpemijjgpljce, CATEGORY: " |
| + std::string args = "ID: abc, CATEGORY: " |
| "CALL, API: extension.connect, ARGS: \"hello\", \"world\""; |
| ASSERT_EQ(args, last->PrintForDebug()); |
| } |
| @@ -96,44 +96,28 @@ TEST_F(ActivityLogTest, Enabled) { |
| TEST_F(ActivityLogTest, Construct) { |
| 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); |
| scoped_ptr<ListValue> args(new ListValue()); |
| ASSERT_TRUE(ActivityLog::IsLogEnabled()); |
| activity_log->LogAPIAction( |
| - extension, std::string("tabs.testMethod"), args.get(), std::string()); |
| + "abc", std::string("tabs.testMethod"), args.get(), std::string()); |
|
Matt Perry
2013/05/29 18:01:17
make "abc" a const at the top of the file
felt
2013/05/30 07:21:02
Done.
|
| } |
| TEST_F(ActivityLogTest, LogAndFetchActions) { |
| 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); |
| scoped_ptr<ListValue> args(new ListValue()); |
| ASSERT_TRUE(ActivityLog::IsLogEnabled()); |
| // Write some API calls |
| activity_log->LogAPIAction( |
| - extension, std::string("tabs.testMethod"), args.get(), std::string()); |
| - activity_log->LogDOMAction(extension, |
| + "abc", std::string("tabs.testMethod"), args.get(), std::string()); |
| + activity_log->LogDOMAction("abc", |
| GURL("http://www.google.com"), |
| string16(), |
| std::string("document.write"), |
| args.get(), |
| std::string("extra")); |
| activity_log->GetActions( |
| - extension->id(), |
| + "abc", |
| 0, |
| base::Bind(ActivityLogTest::RetrieveActions_LogAndFetchActions)); |
| } |
| @@ -141,44 +125,28 @@ TEST_F(ActivityLogTest, LogAndFetchActions) { |
| TEST_F(ActivityLogTest, LogWithoutArguments) { |
| ActivityLog* activity_log = ActivityLog::GetInstance(profile_); |
| activity_log->SetArgumentLoggingForTesting(false); |
| - 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(), std::string()); |
| + "abc", std::string("tabs.testMethod"), args.get(), std::string()); |
| activity_log->GetActions( |
| - extension->id(), 0, base::Bind(ActivityLogTest::Arguments_Missing)); |
| + "abc", 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(), std::string()); |
| + "abc", std::string("extension.connect"), args.get(), std::string()); |
| activity_log->GetActions( |
| - extension->id(), 0, base::Bind(ActivityLogTest::Arguments_Present)); |
| + "abc", 0, base::Bind(ActivityLogTest::Arguments_Present)); |
| } |
| } // namespace extensions |