| OLD | NEW |
| 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_action_constants.h" | 10 #include "chrome/browser/extensions/activity_log/activity_action_constants.h" |
| 11 #include "chrome/browser/extensions/activity_log/activity_log.h" | 11 #include "chrome/browser/extensions/activity_log/activity_log.h" |
| 12 #include "chrome/browser/extensions/extension_service.h" | 12 #include "chrome/browser/extensions/extension_service.h" |
| 13 #include "chrome/browser/extensions/test_extension_system.h" | 13 #include "chrome/browser/extensions/test_extension_system.h" |
| 14 #include "chrome/browser/prerender/prerender_handle.h" | 14 #include "chrome/browser/prerender/prerender_handle.h" |
| 15 #include "chrome/browser/prerender/prerender_manager.h" | 15 #include "chrome/browser/prerender/prerender_manager.h" |
| 16 #include "chrome/browser/prerender/prerender_manager_factory.h" | 16 #include "chrome/browser/prerender/prerender_manager_factory.h" |
| 17 #include "chrome/common/chrome_constants.h" | 17 #include "chrome/common/chrome_constants.h" |
| 18 #include "chrome/common/chrome_switches.h" | 18 #include "chrome/common/chrome_switches.h" |
| 19 #include "chrome/test/base/chrome_render_view_host_test_harness.h" | 19 #include "chrome/test/base/chrome_render_view_host_test_harness.h" |
| 20 #include "chrome/test/base/testing_profile.h" | 20 #include "chrome/test/base/testing_profile.h" |
| 21 #include "content/public/test/test_browser_thread_bundle.h" | 21 #include "content/public/test/test_browser_thread_bundle.h" |
| 22 #include "extensions/browser/extension_registry.h" | 22 #include "extensions/browser/extension_registry.h" |
| 23 #include "extensions/browser/uninstall_reason.h" |
| 23 #include "extensions/common/dom_action_types.h" | 24 #include "extensions/common/dom_action_types.h" |
| 24 #include "extensions/common/extension_builder.h" | 25 #include "extensions/common/extension_builder.h" |
| 25 #include "sql/statement.h" | 26 #include "sql/statement.h" |
| 26 #include "testing/gtest/include/gtest/gtest.h" | 27 #include "testing/gtest/include/gtest/gtest.h" |
| 27 | 28 |
| 28 #if defined(OS_CHROMEOS) | 29 #if defined(OS_CHROMEOS) |
| 29 #include "chrome/browser/chromeos/login/users/user_manager.h" | 30 #include "chrome/browser/chromeos/login/users/user_manager.h" |
| 30 #include "chrome/browser/chromeos/settings/cros_settings.h" | 31 #include "chrome/browser/chromeos/settings/cros_settings.h" |
| 31 #include "chrome/browser/chromeos/settings/device_settings_service.h" | 32 #include "chrome/browser/chromeos/settings/device_settings_service.h" |
| 32 #endif | 33 #endif |
| (...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 361 base::Time::Now(), | 362 base::Time::Now(), |
| 362 Action::ACTION_API_CALL, | 363 Action::ACTION_API_CALL, |
| 363 "tabs.testMethod"); | 364 "tabs.testMethod"); |
| 364 activity_log->LogAction(action); | 365 activity_log->LogAction(action); |
| 365 action = new Action(extension->id(), | 366 action = new Action(extension->id(), |
| 366 base::Time::Now(), | 367 base::Time::Now(), |
| 367 Action::ACTION_DOM_ACCESS, | 368 Action::ACTION_DOM_ACCESS, |
| 368 "document.write"); | 369 "document.write"); |
| 369 action->set_page_url(GURL("http://www.google.com")); | 370 action->set_page_url(GURL("http://www.google.com")); |
| 370 | 371 |
| 371 activity_log->OnExtensionUninstalled(NULL, extension); | 372 activity_log->OnExtensionUninstalled( |
| 373 NULL, extension, extensions::UNINSTALL_REASON_FOR_TESTING); |
| 372 activity_log->GetFilteredActions( | 374 activity_log->GetFilteredActions( |
| 373 extension->id(), | 375 extension->id(), |
| 374 Action::ACTION_ANY, | 376 Action::ACTION_ANY, |
| 375 "", | 377 "", |
| 376 "", | 378 "", |
| 377 "", | 379 "", |
| 378 -1, | 380 -1, |
| 379 base::Bind(ActivityLogTest::RetrieveActions_LogAndFetchActions0)); | 381 base::Bind(ActivityLogTest::RetrieveActions_LogAndFetchActions0)); |
| 380 } | 382 } |
| 381 | 383 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 401 kExtensionId, | 403 kExtensionId, |
| 402 Action::ACTION_ANY, | 404 Action::ACTION_ANY, |
| 403 "", | 405 "", |
| 404 "", | 406 "", |
| 405 "", | 407 "", |
| 406 -1, | 408 -1, |
| 407 base::Bind(ActivityLogTest::RetrieveActions_ArgUrlApiCalls)); | 409 base::Bind(ActivityLogTest::RetrieveActions_ArgUrlApiCalls)); |
| 408 } | 410 } |
| 409 | 411 |
| 410 } // namespace extensions | 412 } // namespace extensions |
| OLD | NEW |