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_log.h" | 10 #include "chrome/browser/extensions/activity_log/activity_log.h" |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 | 83 |
84 bool GetWatchdogActive() { | 84 bool GetWatchdogActive() { |
85 ActivityLog* activity_log = ActivityLog::GetInstance(profile()); | 85 ActivityLog* activity_log = ActivityLog::GetInstance(profile()); |
86 return activity_log->IsWatchdogAppActive(); | 86 return activity_log->IsWatchdogAppActive(); |
87 } | 87 } |
88 | 88 |
89 static void Arguments_Prerender( | 89 static void Arguments_Prerender( |
90 scoped_ptr<std::vector<scoped_refptr<Action> > > i) { | 90 scoped_ptr<std::vector<scoped_refptr<Action> > > i) { |
91 ASSERT_EQ(1U, i->size()); | 91 ASSERT_EQ(1U, i->size()); |
92 scoped_refptr<Action> last = i->front(); | 92 scoped_refptr<Action> last = i->front(); |
93 std::string args = | 93 |
94 "ID=odlameecjipmbmbejkplpemijjgpljce CATEGORY=content_script API= " | 94 ASSERT_EQ("odlameecjipmbmbejkplpemijjgpljce", last->extension_id()); |
95 "ARGS=[\"script\"] PAGE_URL=http://www.google.com/ " | 95 ASSERT_EQ(Action::ACTION_CONTENT_SCRIPT, last->action_type()); |
96 "OTHER={\"prerender\":true}"; | 96 ASSERT_EQ("[\"script\"]", |
97 ASSERT_EQ(args, last->PrintForDebug()); | 97 ActivityLogPolicy::Util::Serialize(last->args())); |
| 98 ASSERT_EQ("http://www.google.com/", last->SerializePageUrl()); |
| 99 ASSERT_EQ("{\"prerender\":true}", |
| 100 ActivityLogPolicy::Util::Serialize(last->other())); |
| 101 ASSERT_EQ("", last->api_name()); |
| 102 ASSERT_EQ("", last->page_title()); |
| 103 ASSERT_EQ("", last->SerializeArgUrl()); |
98 } | 104 } |
99 | 105 |
100 ExtensionService* extension_service_; | 106 ExtensionService* extension_service_; |
101 | 107 |
102 #if defined OS_CHROMEOS | 108 #if defined OS_CHROMEOS |
103 chromeos::ScopedTestDeviceSettingsService test_device_settings_service_; | 109 chromeos::ScopedTestDeviceSettingsService test_device_settings_service_; |
104 chromeos::ScopedTestCrosSettings test_cros_settings_; | 110 chromeos::ScopedTestCrosSettings test_cros_settings_; |
105 scoped_ptr<chromeos::ScopedTestUserManager> test_user_manager_; | 111 scoped_ptr<chromeos::ScopedTestUserManager> test_user_manager_; |
106 #endif | 112 #endif |
107 }; | 113 }; |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 static_cast<TabHelper::ScriptExecutionObserver*>(activity_log)-> | 177 static_cast<TabHelper::ScriptExecutionObserver*>(activity_log)-> |
172 OnScriptsExecuted(contents, executing_scripts, 0, url); | 178 OnScriptsExecuted(contents, executing_scripts, 0, url); |
173 | 179 |
174 activity_log->GetActions( | 180 activity_log->GetActions( |
175 extension->id(), 0, base::Bind(ActivityLogTest::Arguments_Prerender)); | 181 extension->id(), 0, base::Bind(ActivityLogTest::Arguments_Prerender)); |
176 | 182 |
177 prerender_manager->CancelAllPrerenders(); | 183 prerender_manager->CancelAllPrerenders(); |
178 } | 184 } |
179 | 185 |
180 } // namespace extensions | 186 } // namespace extensions |
OLD | NEW |