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

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

Issue 21646004: Compressed activity log database storage (Closed) Base URL: http://git.chromium.org/chromium/src.git@refactor-cleanups
Patch Set: Factor out dropping of obsolete tables and use in all policies Created 7 years, 4 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/message_loop/message_loop.h" 7 #include "base/message_loop/message_loop.h"
8 #include "base/run_loop.h" 8 #include "base/run_loop.h"
9 #include "base/synchronization/waitable_event.h" 9 #include "base/synchronization/waitable_event.h"
10 #include "chrome/browser/extensions/activity_log/activity_log.h" 10 #include "chrome/browser/extensions/activity_log/activity_log.h"
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 static void RetrieveActions_LogAndFetchActions( 74 static void RetrieveActions_LogAndFetchActions(
75 scoped_ptr<std::vector<scoped_refptr<Action> > > i) { 75 scoped_ptr<std::vector<scoped_refptr<Action> > > i) {
76 ASSERT_EQ(2, static_cast<int>(i->size())); 76 ASSERT_EQ(2, static_cast<int>(i->size()));
77 } 77 }
78 78
79 void SetPolicy(bool log_arguments) { 79 void SetPolicy(bool log_arguments) {
80 ActivityLog* activity_log = ActivityLog::GetInstance(profile()); 80 ActivityLog* activity_log = ActivityLog::GetInstance(profile());
81 if (log_arguments) 81 if (log_arguments)
82 activity_log->SetDefaultPolicy(ActivityLogPolicy::POLICY_FULLSTREAM); 82 activity_log->SetDefaultPolicy(ActivityLogPolicy::POLICY_FULLSTREAM);
83 else 83 else
84 activity_log->SetDefaultPolicy(ActivityLogPolicy::POLICY_NOARGS); 84 activity_log->SetDefaultPolicy(ActivityLogPolicy::POLICY_COUNTS);
85 } 85 }
86 86
87 static void Arguments_Prerender( 87 static void Arguments_Prerender(
88 scoped_ptr<std::vector<scoped_refptr<Action> > > i) { 88 scoped_ptr<std::vector<scoped_refptr<Action> > > i) {
89 ASSERT_EQ(1U, i->size()); 89 ASSERT_EQ(1U, i->size());
90 scoped_refptr<Action> last = i->front(); 90 scoped_refptr<Action> last = i->front();
91 std::string args = 91 std::string args =
92 "ID=odlameecjipmbmbejkplpemijjgpljce CATEGORY=content_script API= " 92 "ID=odlameecjipmbmbejkplpemijjgpljce CATEGORY=content_script API= "
93 "ARGS=[\"script\"] PAGE_URL=http://www.google.com/ " 93 "ARGS=[\"script\"] PAGE_URL=http://www.google.com/ "
94 "OTHER={\"prerender\":true}"; 94 "OTHER={\"prerender\":true}";
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 static_cast<TabHelper::ScriptExecutionObserver*>(activity_log)-> 184 static_cast<TabHelper::ScriptExecutionObserver*>(activity_log)->
185 OnScriptsExecuted(contents, executing_scripts, 0, url); 185 OnScriptsExecuted(contents, executing_scripts, 0, url);
186 186
187 activity_log->GetActions( 187 activity_log->GetActions(
188 extension->id(), 0, base::Bind(ActivityLogTest::Arguments_Prerender)); 188 extension->id(), 0, base::Bind(ActivityLogTest::Arguments_Prerender));
189 189
190 prerender_manager->CancelAllPrerenders(); 190 prerender_manager->CancelAllPrerenders();
191 } 191 }
192 192
193 } // namespace extensions 193 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698