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/apps/app_shim/app_shim_host_mac.h" | 5 #include "chrome/browser/apps/app_shim/app_shim_host_mac.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/memory/scoped_vector.h" | 10 #include "base/memory/scoped_vector.h" |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 void OnShimQuit(Host* host) override { ++quit_count_; } | 104 void OnShimQuit(Host* host) override { ++quit_count_; } |
105 | 105 |
106 apps::AppShimLaunchResult launch_result_; | 106 apps::AppShimLaunchResult launch_result_; |
107 int launch_count_; | 107 int launch_count_; |
108 int launch_now_count_; | 108 int launch_now_count_; |
109 int close_count_; | 109 int close_count_; |
110 int focus_count_; | 110 int focus_count_; |
111 int quit_count_; | 111 int quit_count_; |
112 | 112 |
113 private: | 113 private: |
114 virtual void SetUp() override { | 114 void SetUp() override { |
115 testing::Test::SetUp(); | 115 testing::Test::SetUp(); |
116 host_.reset(new TestingAppShimHost()); | 116 host_.reset(new TestingAppShimHost()); |
117 } | 117 } |
118 | 118 |
119 scoped_ptr<TestingAppShimHost> host_; | 119 scoped_ptr<TestingAppShimHost> host_; |
120 | 120 |
121 DISALLOW_COPY_AND_ASSIGN(AppShimHostTest); | 121 DISALLOW_COPY_AND_ASSIGN(AppShimHostTest); |
122 }; | 122 }; |
123 | 123 |
124 | 124 |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 apps::AppShimHandler::RemoveHandler(kTestAppId); | 166 apps::AppShimHandler::RemoveHandler(kTestAppId); |
167 } | 167 } |
168 | 168 |
169 TEST_F(AppShimHostTest, TestFailLaunch) { | 169 TEST_F(AppShimHostTest, TestFailLaunch) { |
170 apps::AppShimHandler::RegisterHandler(kTestAppId, this); | 170 apps::AppShimHandler::RegisterHandler(kTestAppId, this); |
171 launch_result_ = apps::APP_SHIM_LAUNCH_APP_NOT_FOUND; | 171 launch_result_ = apps::APP_SHIM_LAUNCH_APP_NOT_FOUND; |
172 LaunchApp(apps::APP_SHIM_LAUNCH_NORMAL); | 172 LaunchApp(apps::APP_SHIM_LAUNCH_NORMAL); |
173 EXPECT_EQ(apps::APP_SHIM_LAUNCH_APP_NOT_FOUND, GetLaunchResult()); | 173 EXPECT_EQ(apps::APP_SHIM_LAUNCH_APP_NOT_FOUND, GetLaunchResult()); |
174 apps::AppShimHandler::RemoveHandler(kTestAppId); | 174 apps::AppShimHandler::RemoveHandler(kTestAppId); |
175 } | 175 } |
OLD | NEW |