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 "chrome/browser/ui/views/ash/launcher/chrome_launcher_controller.h" | 5 #include "chrome/browser/ui/views/ash/launcher/chrome_launcher_controller.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "ash/launcher/launcher_model.h" | 10 #include "ash/launcher/launcher_model.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 class ChromeLauncherControllerTest : public testing::Test { | 29 class ChromeLauncherControllerTest : public testing::Test { |
30 protected: | 30 protected: |
31 ChromeLauncherControllerTest() | 31 ChromeLauncherControllerTest() |
32 : ui_thread_(content::BrowserThread::UI, &loop_), | 32 : ui_thread_(content::BrowserThread::UI, &loop_), |
33 extension_service_(NULL) { | 33 extension_service_(NULL) { |
34 DictionaryValue manifest; | 34 DictionaryValue manifest; |
35 manifest.SetString("name", "launcher controller test extension"); | 35 manifest.SetString("name", "launcher controller test extension"); |
36 manifest.SetString("version", "1"); | 36 manifest.SetString("version", "1"); |
37 manifest.SetString("description", "for testing pinned apps"); | 37 manifest.SetString("description", "for testing pinned apps"); |
38 | 38 |
39 TestExtensionSystem* extension_system( | 39 extensions::TestExtensionSystem* extension_system( |
40 static_cast<TestExtensionSystem*>(ExtensionSystem::Get(&profile_))); | 40 static_cast<extensions::TestExtensionSystem*>( |
| 41 extensions::ExtensionSystem::Get(&profile_))); |
41 extension_service_ = extension_system->CreateExtensionService( | 42 extension_service_ = extension_system->CreateExtensionService( |
42 CommandLine::ForCurrentProcess(), FilePath(), false); | 43 CommandLine::ForCurrentProcess(), FilePath(), false); |
43 | 44 |
44 std::string error; | 45 std::string error; |
45 extension1_ = Extension::Create(FilePath(), Extension::LOAD, manifest, | 46 extension1_ = Extension::Create(FilePath(), Extension::LOAD, manifest, |
46 Extension::NO_FLAGS, | 47 Extension::NO_FLAGS, |
47 "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", | 48 "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", |
48 &error); | 49 &error); |
49 extension2_ = Extension::Create(FilePath(), Extension::LOAD, manifest, | 50 extension2_ = Extension::Create(FilePath(), Extension::LOAD, manifest, |
50 Extension::NO_FLAGS, | 51 Extension::NO_FLAGS, |
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
274 | 275 |
275 GetAppLaunchers(&controller, &actual_launchers); | 276 GetAppLaunchers(&controller, &actual_launchers); |
276 EXPECT_EQ(expected_launchers, actual_launchers); | 277 EXPECT_EQ(expected_launchers, actual_launchers); |
277 | 278 |
278 // Install |extension2| and verify it shows up between the other two. | 279 // Install |extension2| and verify it shows up between the other two. |
279 extension_service_->AddExtension(extension2_.get()); | 280 extension_service_->AddExtension(extension2_.get()); |
280 expected_launchers.insert(expected_launchers.begin() + 1, extension2_->id()); | 281 expected_launchers.insert(expected_launchers.begin() + 1, extension2_->id()); |
281 GetAppLaunchers(&controller, &actual_launchers); | 282 GetAppLaunchers(&controller, &actual_launchers); |
282 EXPECT_EQ(expected_launchers, actual_launchers); | 283 EXPECT_EQ(expected_launchers, actual_launchers); |
283 } | 284 } |
OLD | NEW |