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/json/json_file_value_serializer.h" | 6 #include "base/json/json_file_value_serializer.h" |
7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
10 #include "chrome/browser/extensions/extension_service.h" | 10 #include "chrome/browser/extensions/extension_service.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 | 21 |
22 class ExtensionUITest : public testing::Test { | 22 class ExtensionUITest : public testing::Test { |
23 public: | 23 public: |
24 ExtensionUITest() : ui_thread_(content::BrowserThread::UI, &message_loop_) { | 24 ExtensionUITest() : ui_thread_(content::BrowserThread::UI, &message_loop_) { |
25 } | 25 } |
26 | 26 |
27 protected: | 27 protected: |
28 void SetUp() { | 28 void SetUp() { |
29 // Create an ExtensionService and ManagementPolicy to inject into the | 29 // Create an ExtensionService and ManagementPolicy to inject into the |
30 // ExtensionSettingsHandler. | 30 // ExtensionSettingsHandler. |
31 TestExtensionSystem* system = static_cast<TestExtensionSystem*>( | 31 extensions::TestExtensionSystem* system = |
32 ExtensionSystem::Get(&profile_)); | 32 static_cast<extensions::TestExtensionSystem*>( |
| 33 extensions::ExtensionSystem::Get(&profile_)); |
33 extension_service_ = system->CreateExtensionService( | 34 extension_service_ = system->CreateExtensionService( |
34 CommandLine::ForCurrentProcess(), FilePath(), false); | 35 CommandLine::ForCurrentProcess(), FilePath(), false); |
35 management_policy_ = system->CreateManagementPolicy(); | 36 management_policy_ = system->CreateManagementPolicy(); |
36 | 37 |
37 handler_.reset(new ExtensionSettingsHandler(extension_service_, | 38 handler_.reset(new ExtensionSettingsHandler(extension_service_, |
38 management_policy_)); | 39 management_policy_)); |
39 } | 40 } |
40 | 41 |
41 static DictionaryValue* DeserializeJSONTestData(const FilePath& path, | 42 static DictionaryValue* DeserializeJSONTestData(const FilePath& path, |
42 std::string *error) { | 43 std::string *error) { |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 | 255 |
255 scoped_ptr<DictionaryValue> extension_details( | 256 scoped_ptr<DictionaryValue> extension_details( |
256 CreateExtensionDetailViewFromPath( | 257 CreateExtensionDetailViewFromPath( |
257 extension_path, pages, Extension::LOAD)); | 258 extension_path, pages, Extension::LOAD)); |
258 | 259 |
259 FilePath::StringType ui_path; | 260 FilePath::StringType ui_path; |
260 | 261 |
261 EXPECT_TRUE(extension_details->GetString("path", &ui_path)); | 262 EXPECT_TRUE(extension_details->GetString("path", &ui_path)); |
262 EXPECT_EQ(extension_path, FilePath(ui_path)); | 263 EXPECT_EQ(extension_path, FilePath(ui_path)); |
263 } | 264 } |
OLD | NEW |