Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2024)

Unified Diff: apps/app_shim/extension_app_shim_handler_mac_unittest.cc

Issue 14579006: Start app shim when app launched. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comment Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « apps/app_shim/extension_app_shim_handler_mac.cc ('k') | chrome/app/chrome_main_app_mode_mac.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: apps/app_shim/extension_app_shim_handler_mac_unittest.cc
diff --git a/apps/app_shim/extension_app_shim_handler_mac_unittest.cc b/apps/app_shim/extension_app_shim_handler_mac_unittest.cc
index dbbbd13c800a66773975c872b6d429ac7f292d9d..651d597a1302063b0e281470315069522e9ed321 100644
--- a/apps/app_shim/extension_app_shim_handler_mac_unittest.cc
+++ b/apps/app_shim/extension_app_shim_handler_mac_unittest.cc
@@ -31,7 +31,9 @@ class TestingExtensionAppShimHandler : public ExtensionAppShimHandler {
content::NotificationRegistrar& GetRegistrar() { return registrar(); }
protected:
- virtual bool LaunchApp(Profile* profile, const std::string& app_id) OVERRIDE {
+ virtual bool LaunchApp(Profile* profile,
+ const std::string& app_id,
+ AppShimLaunchType launch_type) OVERRIDE {
return !fails_launch_;
}
@@ -96,20 +98,20 @@ class ExtensionAppShimHandlerTest : public testing::Test {
TEST_F(ExtensionAppShimHandlerTest, LaunchAndCloseShim) {
// If launch fails, the host is not added to the map.
handler_->set_fails_launch(true);
- EXPECT_EQ(false, handler_->OnShimLaunch(&host_aa_));
+ EXPECT_EQ(false, handler_->OnShimLaunch(&host_aa_, APP_SHIM_LAUNCH_NORMAL));
EXPECT_FALSE(handler_->FindHost(&profile_a_, kTestAppIdA));
// Normal startup.
handler_->set_fails_launch(false);
- EXPECT_EQ(true, handler_->OnShimLaunch(&host_aa_));
+ EXPECT_EQ(true, handler_->OnShimLaunch(&host_aa_, APP_SHIM_LAUNCH_NORMAL));
EXPECT_EQ(&host_aa_, handler_->FindHost(&profile_a_, kTestAppIdA));
EXPECT_TRUE(handler_->GetRegistrar().IsRegistered(
handler_.get(),
chrome::NOTIFICATION_EXTENSION_HOST_DESTROYED,
content::Source<Profile>(&profile_a_)));
- EXPECT_EQ(true, handler_->OnShimLaunch(&host_ab_));
+ EXPECT_EQ(true, handler_->OnShimLaunch(&host_ab_, APP_SHIM_LAUNCH_NORMAL));
EXPECT_EQ(&host_ab_, handler_->FindHost(&profile_a_, kTestAppIdB));
- EXPECT_EQ(true, handler_->OnShimLaunch(&host_bb_));
+ EXPECT_EQ(true, handler_->OnShimLaunch(&host_bb_, APP_SHIM_LAUNCH_NORMAL));
EXPECT_EQ(&host_bb_, handler_->FindHost(&profile_b_, kTestAppIdB));
EXPECT_TRUE(handler_->GetRegistrar().IsRegistered(
handler_.get(),
@@ -117,7 +119,8 @@ TEST_F(ExtensionAppShimHandlerTest, LaunchAndCloseShim) {
content::Source<Profile>(&profile_b_)));
// Starting and closing a second host does nothing.
- EXPECT_EQ(false, handler_->OnShimLaunch(&host_aa_duplicate_));
+ EXPECT_EQ(false, handler_->OnShimLaunch(&host_aa_duplicate_,
+ APP_SHIM_LAUNCH_NORMAL));
EXPECT_EQ(&host_aa_, handler_->FindHost(&profile_a_, kTestAppIdA));
handler_->OnShimClose(&host_aa_duplicate_);
EXPECT_EQ(&host_aa_, handler_->FindHost(&profile_a_, kTestAppIdA));
« no previous file with comments | « apps/app_shim/extension_app_shim_handler_mac.cc ('k') | chrome/app/chrome_main_app_mode_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698