| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "ash/ash_switches.h" | 9 #include "ash/ash_switches.h" |
| 10 #include "ash/shelf/shelf.h" | 10 #include "ash/shelf/shelf.h" |
| (...skipping 2118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2129 // We assume that the web store is always there (which it apparently is). | 2129 // We assume that the web store is always there (which it apparently is). |
| 2130 controller_->PinAppWithID(extensions::kWebStoreAppId); | 2130 controller_->PinAppWithID(extensions::kWebStoreAppId); |
| 2131 ash::ShelfID id = controller_->GetShelfIDForAppID( | 2131 ash::ShelfID id = controller_->GetShelfIDForAppID( |
| 2132 extensions::kWebStoreAppId); | 2132 extensions::kWebStoreAppId); |
| 2133 ASSERT_NE(0, id); | 2133 ASSERT_NE(0, id); |
| 2134 EXPECT_EQ(ash::STATUS_CLOSED, model_->ItemByID(id)->status); | 2134 EXPECT_EQ(ash::STATUS_CLOSED, model_->ItemByID(id)->status); |
| 2135 | 2135 |
| 2136 // Create a windowed application. | 2136 // Create a windowed application. |
| 2137 AppLaunchParams params( | 2137 AppLaunchParams params( |
| 2138 profile(), controller_->GetExtensionForAppID(extensions::kWebStoreAppId), | 2138 profile(), controller_->GetExtensionForAppID(extensions::kWebStoreAppId), |
| 2139 CURRENT_TAB, extensions::SOURCE_TEST); | 2139 CURRENT_TAB, chrome::HOST_DESKTOP_TYPE_ASH, extensions::SOURCE_TEST); |
| 2140 params.container = extensions::LAUNCH_CONTAINER_WINDOW; | 2140 params.container = extensions::LAUNCH_CONTAINER_WINDOW; |
| 2141 OpenApplication(params); | 2141 OpenApplication(params); |
| 2142 EXPECT_EQ(ash::STATUS_ACTIVE, model_->ItemByID(id)->status); | 2142 EXPECT_EQ(ash::STATUS_ACTIVE, model_->ItemByID(id)->status); |
| 2143 | 2143 |
| 2144 // Find the browser which holds our app. | 2144 // Find the browser which holds our app. |
| 2145 Browser* app_browser = NULL; | 2145 Browser* app_browser = NULL; |
| 2146 const BrowserList* browser_list = BrowserList::GetInstance(); | 2146 const BrowserList* browser_list = BrowserList::GetInstance(); |
| 2147 for (BrowserList::const_reverse_iterator it = | 2147 for (BrowserList::const_reverse_iterator it = |
| 2148 browser_list->begin_last_active(); | 2148 browser_list->begin_last_active(); |
| 2149 it != browser_list->end_last_active() && !app_browser; ++it) { | 2149 it != browser_list->end_last_active() && !app_browser; ++it) { |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2284 controller_->ActivateApp(bookmark_app->id(), ash::LAUNCH_FROM_APP_LIST, 0); | 2284 controller_->ActivateApp(bookmark_app->id(), ash::LAUNCH_FROM_APP_LIST, 0); |
| 2285 | 2285 |
| 2286 // There should be two new browsers. | 2286 // There should be two new browsers. |
| 2287 EXPECT_EQ(3u, chrome::GetBrowserCount(browser()->profile())); | 2287 EXPECT_EQ(3u, chrome::GetBrowserCount(browser()->profile())); |
| 2288 | 2288 |
| 2289 // The apps should now be running, with the last opened app active. | 2289 // The apps should now be running, with the last opened app active. |
| 2290 EXPECT_EQ(ash::STATUS_RUNNING, model_->ItemByID(hosted_app_shelf_id)->status); | 2290 EXPECT_EQ(ash::STATUS_RUNNING, model_->ItemByID(hosted_app_shelf_id)->status); |
| 2291 EXPECT_EQ(ash::STATUS_ACTIVE, | 2291 EXPECT_EQ(ash::STATUS_ACTIVE, |
| 2292 model_->ItemByID(bookmark_app_shelf_id)->status); | 2292 model_->ItemByID(bookmark_app_shelf_id)->status); |
| 2293 } | 2293 } |
| OLD | NEW |