Index: chrome/browser/extensions/activity_log/counting_policy_unittest.cc |
diff --git a/chrome/browser/extensions/activity_log/counting_policy_unittest.cc b/chrome/browser/extensions/activity_log/counting_policy_unittest.cc |
index dbd55a41aa0f99e5c4370a905d179462bfa13a44..d71feaf687ab09243ecfe593b58af5f6abbb8026 100644 |
--- a/chrome/browser/extensions/activity_log/counting_policy_unittest.cc |
+++ b/chrome/browser/extensions/activity_log/counting_policy_unittest.cc |
@@ -186,6 +186,11 @@ class CountingPolicyTest : public testing::Test { |
ASSERT_EQ(2, static_cast<int>(i->size())); |
} |
+ static void RetrieveActions_FetchFilteredActions300( |
+ scoped_ptr<std::vector<scoped_refptr<Action> > > i) { |
+ ASSERT_EQ(300, static_cast<int>(i->size())); |
+ } |
+ |
static void Arguments_Stripped(scoped_ptr<Action::ActionVector> i) { |
scoped_refptr<Action> last = i->front(); |
std::string args = |
@@ -782,6 +787,31 @@ TEST_F(CountingPolicyTest, EarlyFlush) { |
policy->Close(); |
} |
+TEST_F(CountingPolicyTest, CapReturns) { |
+ CountingPolicy* policy = new CountingPolicy(profile_.get()); |
+ |
+ for (int i = 0; i < 305; i++) { |
+ scoped_refptr<Action> action = |
+ new Action("punky", |
+ base::Time::Now(), |
+ Action::ACTION_API_CALL, |
+ base::StringPrintf("apicall_%d", i)); |
+ policy->ProcessAction(action); |
+ } |
+ policy->Flush(); |
+ |
+ CheckReadFilteredData( |
+ policy, |
+ "punky", |
+ Action::ACTION_ANY, |
+ "", |
+ "", |
+ "", |
+ base::Bind( |
+ &CountingPolicyTest::RetrieveActions_FetchFilteredActions300)); |
+ policy->Close(); |
+} |
+ |
TEST_F(CountingPolicyTest, RemoveAllURLs) { |
ActivityLogPolicy* policy = new CountingPolicy(profile_.get()); |