OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/message_loop/message_loop.h" | 6 #include "base/message_loop/message_loop.h" |
7 #include "chrome/browser/extensions/extension_service.h" | 7 #include "chrome/browser/extensions/extension_service.h" |
8 #include "chrome/browser/extensions/extension_web_ui.h" | 8 #include "chrome/browser/extensions/extension_web_ui.h" |
9 #include "chrome/browser/extensions/test_extension_system.h" | 9 #include "chrome/browser/extensions/test_extension_system.h" |
10 #include "chrome/test/base/testing_profile.h" | 10 #include "chrome/test/base/testing_profile.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 #endif | 22 #endif |
23 | 23 |
24 namespace extensions { | 24 namespace extensions { |
25 | 25 |
26 class ExtensionWebUITest : public testing::Test { | 26 class ExtensionWebUITest : public testing::Test { |
27 public: | 27 public: |
28 ExtensionWebUITest() | 28 ExtensionWebUITest() |
29 : ui_thread_(content::BrowserThread::UI, &message_loop_) {} | 29 : ui_thread_(content::BrowserThread::UI, &message_loop_) {} |
30 | 30 |
31 protected: | 31 protected: |
32 virtual void SetUp() OVERRIDE { | 32 virtual void SetUp() override { |
33 profile_.reset(new TestingProfile()); | 33 profile_.reset(new TestingProfile()); |
34 TestExtensionSystem* system = | 34 TestExtensionSystem* system = |
35 static_cast<TestExtensionSystem*>(ExtensionSystem::Get(profile_.get())); | 35 static_cast<TestExtensionSystem*>(ExtensionSystem::Get(profile_.get())); |
36 extension_service_ = system->CreateExtensionService( | 36 extension_service_ = system->CreateExtensionService( |
37 CommandLine::ForCurrentProcess(), base::FilePath(), false); | 37 CommandLine::ForCurrentProcess(), base::FilePath(), false); |
38 } | 38 } |
39 | 39 |
40 virtual void TearDown() OVERRIDE { | 40 virtual void TearDown() override { |
41 profile_.reset(); | 41 profile_.reset(); |
42 message_loop_.RunUntilIdle(); | 42 message_loop_.RunUntilIdle(); |
43 } | 43 } |
44 | 44 |
45 scoped_ptr<TestingProfile> profile_; | 45 scoped_ptr<TestingProfile> profile_; |
46 ExtensionService* extension_service_; | 46 ExtensionService* extension_service_; |
47 base::MessageLoop message_loop_; | 47 base::MessageLoop message_loop_; |
48 content::TestBrowserThread ui_thread_; | 48 content::TestBrowserThread ui_thread_; |
49 | 49 |
50 #if defined OS_CHROMEOS | 50 #if defined OS_CHROMEOS |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 // This time the non-component extension was registered more recently and | 110 // This time the non-component extension was registered more recently and |
111 // should still take precedence. | 111 // should still take precedence. |
112 ExtensionWebUI::RegisterChromeURLOverrides( | 112 ExtensionWebUI::RegisterChromeURLOverrides( |
113 profile_.get(), URLOverrides::GetChromeURLOverrides(ext_unpacked.get())); | 113 profile_.get(), URLOverrides::GetChromeURLOverrides(ext_unpacked.get())); |
114 url = GURL("chrome://bookmarks"); | 114 url = GURL("chrome://bookmarks"); |
115 EXPECT_TRUE(ExtensionWebUI::HandleChromeURLOverride(&url, profile_.get())); | 115 EXPECT_TRUE(ExtensionWebUI::HandleChromeURLOverride(&url, profile_.get())); |
116 EXPECT_EQ(url, expected_unpacked_override_url); | 116 EXPECT_EQ(url, expected_unpacked_override_url); |
117 } | 117 } |
118 | 118 |
119 } // namespace extensions | 119 } // namespace extensions |
OLD | NEW |