| 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 2216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2227 // The apps should now be running, with the last opened app active. | 2227 // The apps should now be running, with the last opened app active. |
| 2228 EXPECT_EQ(ash::STATUS_RUNNING, model_->ItemByID(hosted_app_shelf_id)->status); | 2228 EXPECT_EQ(ash::STATUS_RUNNING, model_->ItemByID(hosted_app_shelf_id)->status); |
| 2229 EXPECT_EQ(ash::STATUS_ACTIVE, | 2229 EXPECT_EQ(ash::STATUS_ACTIVE, |
| 2230 model_->ItemByID(bookmark_app_shelf_id)->status); | 2230 model_->ItemByID(bookmark_app_shelf_id)->status); |
| 2231 | 2231 |
| 2232 // Now use the launcher controller to activate the apps. | 2232 // Now use the launcher controller to activate the apps. |
| 2233 controller_->ActivateApp(hosted_app->id(), ash::LAUNCH_FROM_APP_LIST, 0); | 2233 controller_->ActivateApp(hosted_app->id(), ash::LAUNCH_FROM_APP_LIST, 0); |
| 2234 controller_->ActivateApp(bookmark_app->id(), ash::LAUNCH_FROM_APP_LIST, 0); | 2234 controller_->ActivateApp(bookmark_app->id(), ash::LAUNCH_FROM_APP_LIST, 0); |
| 2235 | 2235 |
| 2236 // There should be no new browsers or tabs as both apps were already open. | 2236 // There should be no new browsers or tabs as both apps were already open. |
| 2237 EXPECT_EQ(1u, chrome::GetTotalBrowserCountForProfile(browser()->profile())); | 2237 EXPECT_EQ(1u, chrome::GetBrowserCount(browser()->profile())); |
| 2238 EXPECT_EQ(2, browser()->tab_strip_model()->count()); | 2238 EXPECT_EQ(2, browser()->tab_strip_model()->count()); |
| 2239 } | 2239 } |
| 2240 | 2240 |
| 2241 // Check that windowed hosted and bookmark apps have correct shelf presence. | 2241 // Check that windowed hosted and bookmark apps have correct shelf presence. |
| 2242 IN_PROC_BROWSER_TEST_F(ShelfAppBrowserTest, WindowedHostedAndBookmarkApps) { | 2242 IN_PROC_BROWSER_TEST_F(ShelfAppBrowserTest, WindowedHostedAndBookmarkApps) { |
| 2243 // Load and pin a hosted app. | 2243 // Load and pin a hosted app. |
| 2244 const Extension* hosted_app = | 2244 const Extension* hosted_app = |
| 2245 LoadExtension(test_data_dir_.AppendASCII("app1/")); | 2245 LoadExtension(test_data_dir_.AppendASCII("app1/")); |
| 2246 ASSERT_TRUE(hosted_app); | 2246 ASSERT_TRUE(hosted_app); |
| 2247 controller_->PinAppWithID(hosted_app->id()); | 2247 controller_->PinAppWithID(hosted_app->id()); |
| (...skipping 30 matching lines...) Expand all Loading... |
| 2278 // The apps should still be closed. | 2278 // The apps should still be closed. |
| 2279 EXPECT_EQ(ash::STATUS_CLOSED, model_->ItemByID(hosted_app_shelf_id)->status); | 2279 EXPECT_EQ(ash::STATUS_CLOSED, model_->ItemByID(hosted_app_shelf_id)->status); |
| 2280 EXPECT_EQ(ash::STATUS_CLOSED, | 2280 EXPECT_EQ(ash::STATUS_CLOSED, |
| 2281 model_->ItemByID(bookmark_app_shelf_id)->status); | 2281 model_->ItemByID(bookmark_app_shelf_id)->status); |
| 2282 | 2282 |
| 2283 // Now use the launcher controller to activate the apps. | 2283 // Now use the launcher controller to activate the apps. |
| 2284 controller_->ActivateApp(hosted_app->id(), ash::LAUNCH_FROM_APP_LIST, 0); | 2284 controller_->ActivateApp(hosted_app->id(), ash::LAUNCH_FROM_APP_LIST, 0); |
| 2285 controller_->ActivateApp(bookmark_app->id(), ash::LAUNCH_FROM_APP_LIST, 0); | 2285 controller_->ActivateApp(bookmark_app->id(), ash::LAUNCH_FROM_APP_LIST, 0); |
| 2286 | 2286 |
| 2287 // There should be two new browsers. | 2287 // There should be two new browsers. |
| 2288 EXPECT_EQ(3u, chrome::GetTotalBrowserCountForProfile(browser()->profile())); | 2288 EXPECT_EQ(3u, chrome::GetBrowserCount(browser()->profile())); |
| 2289 | 2289 |
| 2290 // The apps should now be running, with the last opened app active. | 2290 // The apps should now be running, with the last opened app active. |
| 2291 EXPECT_EQ(ash::STATUS_RUNNING, model_->ItemByID(hosted_app_shelf_id)->status); | 2291 EXPECT_EQ(ash::STATUS_RUNNING, model_->ItemByID(hosted_app_shelf_id)->status); |
| 2292 EXPECT_EQ(ash::STATUS_ACTIVE, | 2292 EXPECT_EQ(ash::STATUS_ACTIVE, |
| 2293 model_->ItemByID(bookmark_app_shelf_id)->status); | 2293 model_->ItemByID(bookmark_app_shelf_id)->status); |
| 2294 } | 2294 } |
| OLD | NEW |