Index: chrome/browser/ui/ash/launcher/chrome_launcher_controller_browsertest.cc |
=================================================================== |
--- chrome/browser/ui/ash/launcher/chrome_launcher_controller_browsertest.cc (revision 166732) |
+++ chrome/browser/ui/ash/launcher/chrome_launcher_controller_browsertest.cc (working copy) |
@@ -124,7 +124,7 @@ |
IN_PROC_BROWSER_TEST_F(LauncherPlatformAppBrowserTest, LaunchUnpinned) { |
ash::Launcher* launcher = ash::Launcher::ForPrimaryDisplay(); |
int item_count = launcher->model()->item_count(); |
- const Extension* extension = LoadPlatformApp("launch"); |
+ const Extension* extension = LoadAndLaunchPlatformApp("launch"); |
ShellWindow* window = CreateShellWindow(extension); |
++item_count; |
ASSERT_EQ(item_count, launcher->model()->item_count()); |
@@ -135,7 +135,6 @@ |
CloseShellWindow(window); |
--item_count; |
EXPECT_EQ(item_count, launcher->model()->item_count()); |
- CloseShellWindowsAndWaitForAppToExit(); |
} |
// Test that we can launch a platform app that already has a shortcut. |
@@ -143,7 +142,7 @@ |
int item_count = launcher_->model()->item_count(); |
// First get app_id. |
- const Extension* extension = LoadPlatformApp("launch"); |
+ const Extension* extension = LoadAndLaunchPlatformApp("launch"); |
const std::string app_id = extension->id(); |
// Then create a shortcut. |
@@ -168,13 +167,12 @@ |
item = *launcher_->model()->ItemByID(shortcut_id); |
EXPECT_EQ(ash::TYPE_APP_SHORTCUT, item.type); |
EXPECT_EQ(ash::STATUS_CLOSED, item.status); |
- CloseShellWindowsAndWaitForAppToExit(); |
} |
IN_PROC_BROWSER_TEST_F(LauncherPlatformAppBrowserTest, PinRunning) { |
// Run. |
int item_count = launcher_->model()->item_count(); |
- const Extension* extension = LoadPlatformApp("launch"); |
+ const Extension* extension = LoadAndLaunchPlatformApp("launch"); |
ShellWindow* window = CreateShellWindow(extension); |
++item_count; |
ASSERT_EQ(item_count, launcher_->model()->item_count()); |
@@ -208,14 +206,13 @@ |
// Then close it, make sure the item remains. |
CloseShellWindow(window); |
ASSERT_EQ(item_count, launcher_->model()->item_count()); |
- CloseShellWindowsAndWaitForAppToExit(); |
} |
IN_PROC_BROWSER_TEST_F(LauncherPlatformAppBrowserTest, UnpinRunning) { |
int item_count = launcher_->model()->item_count(); |
// First get app_id. |
- const Extension* extension = LoadPlatformApp("launch"); |
+ const Extension* extension = LoadAndLaunchPlatformApp("launch"); |
const std::string app_id = extension->id(); |
// Then create a shortcut. |
@@ -256,7 +253,6 @@ |
CloseShellWindow(window); |
--item_count; |
ASSERT_EQ(item_count, launcher_->model()->item_count()); |
- CloseShellWindowsAndWaitForAppToExit(); |
} |
// Test that we can launch a platform app with more than one window. |
@@ -264,7 +260,7 @@ |
int item_count = launcher_->model()->item_count(); |
// First run app. |
- const Extension* extension = LoadPlatformApp("launch"); |
+ const Extension* extension = LoadAndLaunchPlatformApp("launch"); |
ShellWindow* window1 = CreateShellWindow(extension); |
++item_count; |
ASSERT_EQ(item_count, launcher_->model()->item_count()); |
@@ -293,7 +289,6 @@ |
// Confirm item is removed. |
--item_count; |
ASSERT_EQ(item_count, launcher_->model()->item_count()); |
- CloseShellWindowsAndWaitForAppToExit(); |
} |
// Times out on ChromeOS: http://crbug.com/159394 |
@@ -306,7 +301,7 @@ |
int item_count = launcher_->model()->item_count(); |
// First run app. |
- const Extension* extension1 = LoadPlatformApp("launch"); |
+ const Extension* extension1 = LoadAndLaunchPlatformApp("launch"); |
ShellWindow* window1 = CreateShellWindow(extension1); |
++item_count; |
ASSERT_EQ(item_count, launcher_->model()->item_count()); |
@@ -317,7 +312,7 @@ |
EXPECT_EQ(ash::STATUS_ACTIVE, item1.status); |
// Then run second app. |
- const Extension* extension2 = LoadPlatformApp("launch_2"); |
+ const Extension* extension2 = LoadAndLaunchPlatformApp("launch_2"); |
ShellWindow* window2 = CreateShellWindow(extension2); |
++item_count; |
ASSERT_EQ(item_count, launcher_->model()->item_count()); |
@@ -343,7 +338,7 @@ |
CloseShellWindow(window1); |
--item_count; |
ASSERT_EQ(item_count, launcher_->model()->item_count()); |
- CloseShellWindowsAndWaitForAppToExit(); |
+ |
} |
// Confirm that app windows can be reactivated by clicking their icons and that |
@@ -352,7 +347,7 @@ |
int item_count = launcher_->model()->item_count(); |
// First run app. |
- const Extension* extension1 = LoadPlatformApp("launch"); |
+ const Extension* extension1 = LoadAndLaunchPlatformApp("launch"); |
ShellWindow* window1 = CreateShellWindow(extension1); |
++item_count; |
ASSERT_EQ(item_count, launcher_->model()->item_count()); |
@@ -363,7 +358,7 @@ |
EXPECT_EQ(ash::STATUS_ACTIVE, item1.status); |
// Then run second app. |
- const Extension* extension2 = LoadPlatformApp("launch_2"); |
+ const Extension* extension2 = LoadAndLaunchPlatformApp("launch_2"); |
ShellWindow* window2 = CreateShellWindow(extension2); |
++item_count; |
ASSERT_EQ(item_count, launcher_->model()->item_count()); |
@@ -432,14 +427,13 @@ |
CloseShellWindow(window1); |
--item_count; |
EXPECT_EQ(item_count, launcher_->model()->item_count()); |
- CloseShellWindowsAndWaitForAppToExit(); |
} |
IN_PROC_BROWSER_TEST_F(LauncherPlatformAppBrowserTest, BrowserActivation) { |
int item_count = launcher_->model()->item_count(); |
// First run app. |
- const Extension* extension1 = LoadPlatformApp("launch"); |
+ const Extension* extension1 = LoadAndLaunchPlatformApp("launch"); |
CreateShellWindow(extension1); |
++item_count; |
ASSERT_EQ(item_count, launcher_->model()->item_count()); |
@@ -452,7 +446,6 @@ |
ash::wm::ActivateWindow(browser()->window()->GetNativeWindow()); |
EXPECT_EQ(ash::STATUS_RUNNING, |
launcher_->model()->ItemByID(item_id1)->status); |
- CloseShellWindowsAndWaitForAppToExit(); |
} |
// Test that we can launch an app with a shortcut. |