| 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 CommandLine command_line(CommandLine::NO_PROGRAM); | 50 CommandLine command_line(CommandLine::NO_PROGRAM); |
| 51 saved_cmdline_ = *CommandLine::ForCurrentProcess(); | 51 saved_cmdline_ = *CommandLine::ForCurrentProcess(); |
| 52 CommandLine::ForCurrentProcess()->AppendSwitch( | 52 CommandLine::ForCurrentProcess()->AppendSwitch( |
| 53 switches::kEnableExtensionActivityLogging); | 53 switches::kEnableExtensionActivityLogging); |
| 54 CommandLine::ForCurrentProcess()->AppendSwitch( | 54 CommandLine::ForCurrentProcess()->AppendSwitch( |
| 55 switches::kEnableExtensionActivityLogTesting); | 55 switches::kEnableExtensionActivityLogTesting); |
| 56 ActivityLog::RecomputeLoggingIsEnabled(true); // Logging now enabled. | 56 ActivityLog::RecomputeLoggingIsEnabled(true); // Logging now enabled. |
| 57 extension_service_ = static_cast<TestExtensionSystem*>( | 57 extension_service_ = static_cast<TestExtensionSystem*>( |
| 58 ExtensionSystem::Get(profile()))->CreateExtensionService | 58 ExtensionSystem::Get(profile()))->CreateExtensionService |
| 59 (&command_line, base::FilePath(), false); | 59 (&command_line, base::FilePath(), false); |
| 60 ActivityLog::GetInstance(profile())->Init(); | |
| 61 base::RunLoop().RunUntilIdle(); | 60 base::RunLoop().RunUntilIdle(); |
| 62 } | 61 } |
| 63 | 62 |
| 64 virtual void TearDown() OVERRIDE { | 63 virtual void TearDown() OVERRIDE { |
| 65 #if defined OS_CHROMEOS | 64 #if defined OS_CHROMEOS |
| 66 test_user_manager_.reset(); | 65 test_user_manager_.reset(); |
| 67 #endif | 66 #endif |
| 68 base::RunLoop().RunUntilIdle(); | 67 base::RunLoop().RunUntilIdle(); |
| 69 // Restore the original command line and undo the affects of SetUp(). | 68 // Restore the original command line and undo the affects of SetUp(). |
| 70 *CommandLine::ForCurrentProcess() = saved_cmdline_; | 69 *CommandLine::ForCurrentProcess() = saved_cmdline_; |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 static_cast<TabHelper::ScriptExecutionObserver*>(activity_log)-> | 256 static_cast<TabHelper::ScriptExecutionObserver*>(activity_log)-> |
| 258 OnScriptsExecuted(contents, executing_scripts, 0, url); | 257 OnScriptsExecuted(contents, executing_scripts, 0, url); |
| 259 | 258 |
| 260 activity_log->GetActions( | 259 activity_log->GetActions( |
| 261 extension->id(), 0, base::Bind(ActivityLogTest::Arguments_Prerender)); | 260 extension->id(), 0, base::Bind(ActivityLogTest::Arguments_Prerender)); |
| 262 | 261 |
| 263 prerender_manager->CancelAllPrerenders(); | 262 prerender_manager->CancelAllPrerenders(); |
| 264 } | 263 } |
| 265 | 264 |
| 266 } // namespace extensions | 265 } // namespace extensions |
| OLD | NEW |