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 <string> | 5 #include <string> |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "chrome/browser/extensions/active_script_controller.h" | 10 #include "chrome/browser/extensions/active_script_controller.h" |
(...skipping 28 matching lines...) Expand all Loading... |
39 active_script_override_.reset(new FeatureSwitch::ScopedOverride( | 39 active_script_override_.reset(new FeatureSwitch::ScopedOverride( |
40 FeatureSwitch::scripts_require_action(), true)); | 40 FeatureSwitch::scripts_require_action(), true)); |
41 | 41 |
42 ChromeRenderViewHostTestHarness::SetUp(); | 42 ChromeRenderViewHostTestHarness::SetUp(); |
43 #if defined OS_CHROMEOS | 43 #if defined OS_CHROMEOS |
44 test_user_manager_.reset(new chromeos::ScopedTestUserManager()); | 44 test_user_manager_.reset(new chromeos::ScopedTestUserManager()); |
45 #endif | 45 #endif |
46 TabHelper::CreateForWebContents(web_contents()); | 46 TabHelper::CreateForWebContents(web_contents()); |
47 // Create an ExtensionService so the LocationBarController can find its | 47 // Create an ExtensionService so the LocationBarController can find its |
48 // extensions. | 48 // extensions. |
49 CommandLine command_line(CommandLine::NO_PROGRAM); | 49 base::CommandLine command_line(base::CommandLine::NO_PROGRAM); |
50 Profile* profile = | 50 Profile* profile = |
51 Profile::FromBrowserContext(web_contents()->GetBrowserContext()); | 51 Profile::FromBrowserContext(web_contents()->GetBrowserContext()); |
52 extension_service_ = static_cast<TestExtensionSystem*>( | 52 extension_service_ = static_cast<TestExtensionSystem*>( |
53 ExtensionSystem::Get(profile))->CreateExtensionService( | 53 ExtensionSystem::Get(profile))->CreateExtensionService( |
54 &command_line, base::FilePath(), false); | 54 &command_line, base::FilePath(), false); |
55 } | 55 } |
56 | 56 |
57 void TearDown() override { | 57 void TearDown() override { |
58 #if defined OS_CHROMEOS | 58 #if defined OS_CHROMEOS |
59 test_user_manager_.reset(); | 59 test_user_manager_.reset(); |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 NavigateAndCommit(GURL("http://www.yahoo.com")); | 188 NavigateAndCommit(GURL("http://www.yahoo.com")); |
189 | 189 |
190 EXPECT_EQ("Hello", page_action.GetTitle(tab_id())); | 190 EXPECT_EQ("Hello", page_action.GetTitle(tab_id())); |
191 EXPECT_EQ(GURL(), page_action.GetPopupUrl(tab_id())); | 191 EXPECT_EQ(GURL(), page_action.GetPopupUrl(tab_id())); |
192 EXPECT_FALSE(extension_action_api->ExtensionWantsToRun(extension, | 192 EXPECT_FALSE(extension_action_api->ExtensionWantsToRun(extension, |
193 web_contents())); | 193 web_contents())); |
194 } | 194 } |
195 | 195 |
196 } // namespace | 196 } // namespace |
197 } // namespace extensions | 197 } // namespace extensions |
OLD | NEW |