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

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

Issue 19234003: Extension activity log database refactoring (step 2) (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Address some reviewer comments Created 7 years, 5 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
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/command_line.h" 5 #include "base/command_line.h"
6 #include "base/memory/scoped_ptr.h" 6 #include "base/memory/scoped_ptr.h"
7 #include "base/run_loop.h" 7 #include "base/run_loop.h"
8 #include "base/synchronization/waitable_event.h" 8 #include "base/synchronization/waitable_event.h"
9 #include "chrome/browser/extensions/activity_log/activity_log.h" 9 #include "chrome/browser/extensions/activity_log/activity_log.h"
10 #include "chrome/browser/extensions/activity_log/stream_noargs_ui_policy.h" 10 #include "chrome/browser/extensions/activity_log/stream_noargs_ui_policy.h"
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 } 59 }
60 60
61 static void RetrieveActions_LogAndFetchActions( 61 static void RetrieveActions_LogAndFetchActions(
62 scoped_ptr<std::vector<scoped_refptr<Action> > > i) { 62 scoped_ptr<std::vector<scoped_refptr<Action> > > i) {
63 ASSERT_EQ(2, static_cast<int>(i->size())); 63 ASSERT_EQ(2, static_cast<int>(i->size()));
64 } 64 }
65 65
66 static void Arguments_Missing( 66 static void Arguments_Missing(
67 scoped_ptr<std::vector<scoped_refptr<Action> > > i) { 67 scoped_ptr<std::vector<scoped_refptr<Action> > > i) {
68 scoped_refptr<Action> last = i->front(); 68 scoped_refptr<Action> last = i->front();
69 std::string noargs = "ID: odlameecjipmbmbejkplpemijjgpljce, CATEGORY: " 69 std::string noargs =
70 "call, API: tabs.testMethod, ARGS: "; 70 "ID=odlameecjipmbmbejkplpemijjgpljce CATEGORY=api_call "
71 "API=tabs.testMethod ARGS=[] OTHER={}";
71 ASSERT_EQ(noargs, last->PrintForDebug()); 72 ASSERT_EQ(noargs, last->PrintForDebug());
72 } 73 }
73 74
74 protected: 75 protected:
75 ExtensionService* extension_service_; 76 ExtensionService* extension_service_;
76 scoped_ptr<TestingProfile> profile_; 77 scoped_ptr<TestingProfile> profile_;
77 content::TestBrowserThreadBundle thread_bundle_; 78 content::TestBrowserThreadBundle thread_bundle_;
78 // Used to preserve a copy of the original command line. 79 // Used to preserve a copy of the original command line.
79 // The test framework will do this itself as well. However, by then, 80 // The test framework will do this itself as well. However, by then,
80 // it is too late to call ActivityLog::RecomputeLoggingIsEnabled() in 81 // it is too late to call ActivityLog::RecomputeLoggingIsEnabled() in
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 args->Set(0, new base::StringValue("hello")); 145 args->Set(0, new base::StringValue("hello"));
145 args->Set(1, new base::StringValue("world")); 146 args->Set(1, new base::StringValue("world"));
146 policy->ProcessAction(ActivityLogPolicy::ACTION_API, extension->id(), 147 policy->ProcessAction(ActivityLogPolicy::ACTION_API, extension->id(),
147 std::string("tabs.testMethod"), GURL(), args.get(), NULL); 148 std::string("tabs.testMethod"), GURL(), args.get(), NULL);
148 policy->ReadData(extension->id(), 0, 149 policy->ReadData(extension->id(), 0,
149 base::Bind(StreamWithoutArgsUIPolicyTest::Arguments_Missing)); 150 base::Bind(StreamWithoutArgsUIPolicyTest::Arguments_Missing));
150 policy->Close(); 151 policy->Close();
151 } 152 }
152 153
153 } // namespace extensions 154 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698