Index: chrome/browser/ui/ash/launcher/chrome_launcher_controller_browsertest.cc |
=================================================================== |
--- chrome/browser/ui/ash/launcher/chrome_launcher_controller_browsertest.cc (revision 170888) |
+++ chrome/browser/ui/ash/launcher/chrome_launcher_controller_browsertest.cc (working copy) |
@@ -127,7 +127,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()); |
@@ -138,7 +138,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. |
@@ -146,7 +145,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. |
@@ -171,13 +170,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()); |
@@ -211,14 +209,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. |
@@ -259,7 +256,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. |
@@ -267,7 +263,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()); |
@@ -296,7 +292,6 @@ |
// Confirm item is removed. |
--item_count; |
ASSERT_EQ(item_count, launcher_->model()->item_count()); |
- CloseShellWindowsAndWaitForAppToExit(); |
} |
// Times out on ChromeOS: http://crbug.com/159394 |
@@ -309,7 +304,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()); |
@@ -320,7 +315,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()); |
@@ -346,7 +341,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 |
@@ -361,7 +356,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()); |
@@ -372,7 +367,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()); |
@@ -441,14 +436,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()); |
@@ -461,7 +455,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. |