| 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" |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 "HTMLQuoteElement.cite", "HTMLScriptElement.src", | 49 "HTMLQuoteElement.cite", "HTMLScriptElement.src", |
| 50 "HTMLSourceElement.src", "HTMLTrackElement.src", | 50 "HTMLSourceElement.src", "HTMLTrackElement.src", |
| 51 "HTMLVideoElement.poster"}; | 51 "HTMLVideoElement.poster"}; |
| 52 | 52 |
| 53 } // namespace | 53 } // namespace |
| 54 | 54 |
| 55 namespace extensions { | 55 namespace extensions { |
| 56 | 56 |
| 57 class ActivityLogTest : public ChromeRenderViewHostTestHarness { | 57 class ActivityLogTest : public ChromeRenderViewHostTestHarness { |
| 58 protected: | 58 protected: |
| 59 virtual void SetUp() OVERRIDE { | 59 virtual void SetUp() override { |
| 60 ChromeRenderViewHostTestHarness::SetUp(); | 60 ChromeRenderViewHostTestHarness::SetUp(); |
| 61 #if defined OS_CHROMEOS | 61 #if defined OS_CHROMEOS |
| 62 test_user_manager_.reset(new chromeos::ScopedTestUserManager()); | 62 test_user_manager_.reset(new chromeos::ScopedTestUserManager()); |
| 63 #endif | 63 #endif |
| 64 CommandLine command_line(CommandLine::NO_PROGRAM); | 64 CommandLine command_line(CommandLine::NO_PROGRAM); |
| 65 CommandLine::ForCurrentProcess()->AppendSwitch( | 65 CommandLine::ForCurrentProcess()->AppendSwitch( |
| 66 switches::kEnableExtensionActivityLogging); | 66 switches::kEnableExtensionActivityLogging); |
| 67 CommandLine::ForCurrentProcess()->AppendSwitch( | 67 CommandLine::ForCurrentProcess()->AppendSwitch( |
| 68 switches::kEnableExtensionActivityLogTesting); | 68 switches::kEnableExtensionActivityLogTesting); |
| 69 extension_service_ = static_cast<TestExtensionSystem*>( | 69 extension_service_ = static_cast<TestExtensionSystem*>( |
| 70 ExtensionSystem::Get(profile()))->CreateExtensionService | 70 ExtensionSystem::Get(profile()))->CreateExtensionService |
| 71 (&command_line, base::FilePath(), false); | 71 (&command_line, base::FilePath(), false); |
| 72 base::RunLoop().RunUntilIdle(); | 72 base::RunLoop().RunUntilIdle(); |
| 73 } | 73 } |
| 74 | 74 |
| 75 virtual void TearDown() OVERRIDE { | 75 virtual void TearDown() override { |
| 76 #if defined OS_CHROMEOS | 76 #if defined OS_CHROMEOS |
| 77 test_user_manager_.reset(); | 77 test_user_manager_.reset(); |
| 78 #endif | 78 #endif |
| 79 base::RunLoop().RunUntilIdle(); | 79 base::RunLoop().RunUntilIdle(); |
| 80 ChromeRenderViewHostTestHarness::TearDown(); | 80 ChromeRenderViewHostTestHarness::TearDown(); |
| 81 } | 81 } |
| 82 | 82 |
| 83 static void RetrieveActions_LogAndFetchActions0( | 83 static void RetrieveActions_LogAndFetchActions0( |
| 84 scoped_ptr<std::vector<scoped_refptr<Action> > > i) { | 84 scoped_ptr<std::vector<scoped_refptr<Action> > > i) { |
| 85 ASSERT_EQ(0, static_cast<int>(i->size())); | 85 ASSERT_EQ(0, static_cast<int>(i->size())); |
| (...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 404 kExtensionId, | 404 kExtensionId, |
| 405 Action::ACTION_ANY, | 405 Action::ACTION_ANY, |
| 406 "", | 406 "", |
| 407 "", | 407 "", |
| 408 "", | 408 "", |
| 409 -1, | 409 -1, |
| 410 base::Bind(ActivityLogTest::RetrieveActions_ArgUrlApiCalls)); | 410 base::Bind(ActivityLogTest::RetrieveActions_ArgUrlApiCalls)); |
| 411 } | 411 } |
| 412 | 412 |
| 413 } // namespace extensions | 413 } // namespace extensions |
| OLD | NEW |