| 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/files/file_path.h" | 8 #include "base/files/file_path.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 #endif | 34 #endif |
| 35 | 35 |
| 36 using content::BrowserThread; | 36 using content::BrowserThread; |
| 37 | 37 |
| 38 namespace extensions { | 38 namespace extensions { |
| 39 namespace { | 39 namespace { |
| 40 | 40 |
| 41 class ScriptBubbleControllerTest : public ChromeRenderViewHostTestHarness { | 41 class ScriptBubbleControllerTest : public ChromeRenderViewHostTestHarness { |
| 42 public: | 42 public: |
| 43 ScriptBubbleControllerTest() | 43 ScriptBubbleControllerTest() |
| 44 : ui_thread_(BrowserThread::UI, MessageLoop::current()), | 44 : ui_thread_(BrowserThread::UI, base::MessageLoop::current()), |
| 45 file_thread_(BrowserThread::FILE, MessageLoop::current()), | 45 file_thread_(BrowserThread::FILE, base::MessageLoop::current()), |
| 46 enable_script_bubble_(FeatureSwitch::script_bubble(), true), | 46 enable_script_bubble_(FeatureSwitch::script_bubble(), true), |
| 47 permissions_info_(ChromeAPIPermissions()) { | 47 permissions_info_(ChromeAPIPermissions()) {} |
| 48 } | |
| 49 | 48 |
| 50 virtual void SetUp() OVERRIDE { | 49 virtual void SetUp() OVERRIDE { |
| 51 ChromeRenderViewHostTestHarness::SetUp(); | 50 ChromeRenderViewHostTestHarness::SetUp(); |
| 52 CommandLine command_line(CommandLine::NO_PROGRAM); | 51 CommandLine command_line(CommandLine::NO_PROGRAM); |
| 53 Profile* profile = | 52 Profile* profile = |
| 54 Profile::FromBrowserContext(web_contents()->GetBrowserContext()); | 53 Profile::FromBrowserContext(web_contents()->GetBrowserContext()); |
| 55 extension_service_ = static_cast<TestExtensionSystem*>( | 54 extension_service_ = static_cast<TestExtensionSystem*>( |
| 56 ExtensionSystem::Get(profile))->CreateExtensionService( | 55 ExtensionSystem::Get(profile))->CreateExtensionService( |
| 57 &command_line, base::FilePath(), false); | 56 &command_line, base::FilePath(), false); |
| 58 extension_service_->Init(); | 57 extension_service_->Init(); |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 web_contents(), executing_scripts, 0, GURL()); | 184 web_contents(), executing_scripts, 0, GURL()); |
| 186 EXPECT_EQ(3u, script_bubble_controller_->extensions_running_scripts().size()); | 185 EXPECT_EQ(3u, script_bubble_controller_->extensions_running_scripts().size()); |
| 187 | 186 |
| 188 // Navigating away resets the badge. | 187 // Navigating away resets the badge. |
| 189 NavigateAndCommit(GURL("http://www.google.com")); | 188 NavigateAndCommit(GURL("http://www.google.com")); |
| 190 EXPECT_EQ(0u, script_bubble_controller_->extensions_running_scripts().size()); | 189 EXPECT_EQ(0u, script_bubble_controller_->extensions_running_scripts().size()); |
| 191 }; | 190 }; |
| 192 | 191 |
| 193 } // namespace | 192 } // namespace |
| 194 } // namespace extensions | 193 } // namespace extensions |
| OLD | NEW |