| Index: chrome/browser/extensions/activity_log/fullstream_ui_policy_unittest.cc
|
| diff --git a/chrome/browser/extensions/activity_log/fullstream_ui_policy_unittest.cc b/chrome/browser/extensions/activity_log/fullstream_ui_policy_unittest.cc
|
| index 5dc6445b6221576ea2703fe939e84fa65498c0b1..c70d27a6eda70051409b186e3eb76ed07115d2cf 100644
|
| --- a/chrome/browser/extensions/activity_log/fullstream_ui_policy_unittest.cc
|
| +++ b/chrome/browser/extensions/activity_log/fullstream_ui_policy_unittest.cc
|
| @@ -146,6 +146,11 @@ class FullStreamUIPolicyTest : public testing::Test {
|
| ASSERT_EQ(2, static_cast<int>(i->size()));
|
| }
|
|
|
| + static void RetrieveActions_FetchFilteredActions0(
|
| + scoped_ptr<std::vector<scoped_refptr<Action> > > i) {
|
| + ASSERT_EQ(0, static_cast<int>(i->size()));
|
| + }
|
| +
|
| static void RetrieveActions_FetchFilteredActions1(
|
| scoped_ptr<std::vector<scoped_refptr<Action> > > i) {
|
| ASSERT_EQ(1, static_cast<int>(i->size()));
|
| @@ -642,4 +647,54 @@ TEST_F(FullStreamUIPolicyTest, RemoveSpecificURLs) {
|
| policy->Close();
|
| }
|
|
|
| +TEST_F(FullStreamUIPolicyTest, DeleteActions) {
|
| + ActivityLogPolicy* policy = new FullStreamUIPolicy(profile_.get());
|
| + 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.get());
|
| + GURL gurl("http://www.google.com");
|
| +
|
| + // Write some API calls.
|
| + scoped_refptr<Action> action_api = new Action(extension->id(),
|
| + base::Time::Now(),
|
| + Action::ACTION_API_CALL,
|
| + "tabs.testMethod");
|
| + action_api->set_args(make_scoped_ptr(new base::ListValue()));
|
| + policy->ProcessAction(action_api);
|
| +
|
| + scoped_refptr<Action> action_dom = new Action(extension->id(),
|
| + base::Time::Now(),
|
| + Action::ACTION_DOM_ACCESS,
|
| + "document.write");
|
| + action_dom->set_args(make_scoped_ptr(new base::ListValue()));
|
| + action_dom->set_page_url(gurl);
|
| + policy->ProcessAction(action_dom);
|
| +
|
| + CheckReadData(
|
| + policy,
|
| + extension->id(),
|
| + 0,
|
| + base::Bind(&FullStreamUIPolicyTest::RetrieveActions_LogAndFetchActions));
|
| +
|
| + // Now delete them.
|
| + policy->DeleteDatabase();
|
| +
|
| + CheckReadFilteredData(
|
| + policy,
|
| + "",
|
| + Action::ACTION_ANY,
|
| + "",
|
| + "",
|
| + "",
|
| + base::Bind(
|
| + &FullStreamUIPolicyTest::RetrieveActions_FetchFilteredActions0));
|
| +
|
| + policy->Close();
|
| +}
|
| +
|
| } // namespace extensions
|
|
|