OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/ash/launcher/chrome_launcher_controller.h" | 5 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" |
6 | 6 |
7 #include "ash/ash_switches.h" | 7 #include "ash/ash_switches.h" |
8 #include "ash/display/display_controller.h" | 8 #include "ash/display/display_controller.h" |
9 #include "ash/shelf/shelf.h" | 9 #include "ash/shelf/shelf.h" |
10 #include "ash/shelf/shelf_button.h" | 10 #include "ash/shelf/shelf_button.h" |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 WindowOpenDisposition disposition) { | 216 WindowOpenDisposition disposition) { |
217 EXPECT_TRUE(LoadExtension(test_data_dir_.AppendASCII(name))); | 217 EXPECT_TRUE(LoadExtension(test_data_dir_.AppendASCII(name))); |
218 | 218 |
219 ExtensionService* service = extensions::ExtensionSystem::Get( | 219 ExtensionService* service = extensions::ExtensionSystem::Get( |
220 profile())->extension_service(); | 220 profile())->extension_service(); |
221 const Extension* extension = | 221 const Extension* extension = |
222 service->GetExtensionById(last_loaded_extension_id(), false); | 222 service->GetExtensionById(last_loaded_extension_id(), false); |
223 EXPECT_TRUE(extension); | 223 EXPECT_TRUE(extension); |
224 | 224 |
225 OpenApplication(AppLaunchParams(profile(), extension, container, | 225 OpenApplication(AppLaunchParams(profile(), extension, container, |
226 disposition, extensions::SOURCE_UNTRACKED)); | 226 disposition, extensions::SOURCE_TEST)); |
227 return extension; | 227 return extension; |
228 } | 228 } |
229 | 229 |
230 ash::ShelfID CreateShortcut(const char* name) { | 230 ash::ShelfID CreateShortcut(const char* name) { |
231 ExtensionService* service = extensions::ExtensionSystem::Get( | 231 ExtensionService* service = extensions::ExtensionSystem::Get( |
232 profile())->extension_service(); | 232 profile())->extension_service(); |
233 LoadExtension(test_data_dir_.AppendASCII(name)); | 233 LoadExtension(test_data_dir_.AppendASCII(name)); |
234 | 234 |
235 // First get app_id. | 235 // First get app_id. |
236 const Extension* extension = | 236 const Extension* extension = |
(...skipping 1835 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2072 // We assume that the web store is always there (which it apparently is). | 2072 // We assume that the web store is always there (which it apparently is). |
2073 controller_->PinAppWithID(extensions::kWebStoreAppId); | 2073 controller_->PinAppWithID(extensions::kWebStoreAppId); |
2074 ash::ShelfID id = controller_->GetShelfIDForAppID( | 2074 ash::ShelfID id = controller_->GetShelfIDForAppID( |
2075 extensions::kWebStoreAppId); | 2075 extensions::kWebStoreAppId); |
2076 ASSERT_NE(0, id); | 2076 ASSERT_NE(0, id); |
2077 EXPECT_EQ(ash::STATUS_CLOSED, model_->ItemByID(id)->status); | 2077 EXPECT_EQ(ash::STATUS_CLOSED, model_->ItemByID(id)->status); |
2078 | 2078 |
2079 // Create a windowed application. | 2079 // Create a windowed application. |
2080 AppLaunchParams params( | 2080 AppLaunchParams params( |
2081 profile(), controller_->GetExtensionForAppID(extensions::kWebStoreAppId), | 2081 profile(), controller_->GetExtensionForAppID(extensions::kWebStoreAppId), |
2082 CURRENT_TAB, chrome::HOST_DESKTOP_TYPE_ASH, extensions::SOURCE_UNTRACKED); | 2082 CURRENT_TAB, chrome::HOST_DESKTOP_TYPE_ASH, extensions::SOURCE_TEST); |
2083 params.container = extensions::LAUNCH_CONTAINER_WINDOW; | 2083 params.container = extensions::LAUNCH_CONTAINER_WINDOW; |
2084 OpenApplication(params); | 2084 OpenApplication(params); |
2085 EXPECT_EQ(ash::STATUS_ACTIVE, model_->ItemByID(id)->status); | 2085 EXPECT_EQ(ash::STATUS_ACTIVE, model_->ItemByID(id)->status); |
2086 | 2086 |
2087 // Find the browser which holds our app. | 2087 // Find the browser which holds our app. |
2088 Browser* app_browser = NULL; | 2088 Browser* app_browser = NULL; |
2089 const BrowserList* ash_browser_list = | 2089 const BrowserList* ash_browser_list = |
2090 BrowserList::GetInstance(chrome::HOST_DESKTOP_TYPE_ASH); | 2090 BrowserList::GetInstance(chrome::HOST_DESKTOP_TYPE_ASH); |
2091 for (BrowserList::const_reverse_iterator it = | 2091 for (BrowserList::const_reverse_iterator it = |
2092 ash_browser_list->begin_last_active(); | 2092 ash_browser_list->begin_last_active(); |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2128 chrome::GetSettingsUrl(std::string())); | 2128 chrome::GetSettingsUrl(std::string())); |
2129 Browser* settings_browser = | 2129 Browser* settings_browser = |
2130 settings_manager->FindBrowserForProfile(browser()->profile()); | 2130 settings_manager->FindBrowserForProfile(browser()->profile()); |
2131 ASSERT_TRUE(settings_browser); | 2131 ASSERT_TRUE(settings_browser); |
2132 EXPECT_EQ(browser_count, NumberOfDetectedLauncherBrowsers(false)); | 2132 EXPECT_EQ(browser_count, NumberOfDetectedLauncherBrowsers(false)); |
2133 EXPECT_EQ(item_count + 1, shelf_model->item_count()); | 2133 EXPECT_EQ(item_count + 1, shelf_model->item_count()); |
2134 | 2134 |
2135 // TODO(stevenjb): Test multiprofile on Chrome OS when test support is addded. | 2135 // TODO(stevenjb): Test multiprofile on Chrome OS when test support is addded. |
2136 // crbug.com/230464. | 2136 // crbug.com/230464. |
2137 } | 2137 } |
OLD | NEW |