| 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 "apps/app_shim/app_shim_host_manager_mac.h" | 5 #include "apps/app_shim/app_shim_host_manager_mac.h" |
| 6 | 6 |
| 7 #include <unistd.h> | 7 #include <unistd.h> |
| 8 | 8 |
| 9 #include "apps/app_shim/app_shim_messages.h" | 9 #include "apps/app_shim/app_shim_messages.h" |
| 10 #include "apps/app_shim/test/app_shim_host_manager_test_api_mac.h" | 10 #include "apps/app_shim/test/app_shim_host_manager_test_api_mac.h" |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 RunAndExitGracefully(); | 196 RunAndExitGracefully(); |
| 197 EXPECT_EQ(apps::APP_SHIM_LAUNCH_REGISTER_ONLY, last_launch_type_); | 197 EXPECT_EQ(apps::APP_SHIM_LAUNCH_REGISTER_ONLY, last_launch_type_); |
| 198 EXPECT_TRUE(last_launch_files_.empty()); | 198 EXPECT_TRUE(last_launch_files_.empty()); |
| 199 } | 199 } |
| 200 | 200 |
| 201 // Ensure the domain socket can be created in a fresh user data dir. | 201 // Ensure the domain socket can be created in a fresh user data dir. |
| 202 IN_PROC_BROWSER_TEST_F(AppShimHostManagerBrowserTest, | 202 IN_PROC_BROWSER_TEST_F(AppShimHostManagerBrowserTest, |
| 203 PRE_ReCreate) { | 203 PRE_ReCreate) { |
| 204 test::AppShimHostManagerTestApi test_api( | 204 test::AppShimHostManagerTestApi test_api( |
| 205 g_browser_process->platform_part()->app_shim_host_manager()); | 205 g_browser_process->platform_part()->app_shim_host_manager()); |
| 206 EXPECT_TRUE(test_api.factory()); | 206 EXPECT_TRUE(test_api.acceptor()); |
| 207 } | 207 } |
| 208 | 208 |
| 209 // Ensure the domain socket can be re-created after a prior browser process has | 209 // Ensure the domain socket can be re-created after a prior browser process has |
| 210 // quit. | 210 // quit. |
| 211 IN_PROC_BROWSER_TEST_F(AppShimHostManagerBrowserTest, | 211 IN_PROC_BROWSER_TEST_F(AppShimHostManagerBrowserTest, |
| 212 ReCreate) { | 212 ReCreate) { |
| 213 test::AppShimHostManagerTestApi test_api( | 213 test::AppShimHostManagerTestApi test_api( |
| 214 g_browser_process->platform_part()->app_shim_host_manager()); | 214 g_browser_process->platform_part()->app_shim_host_manager()); |
| 215 EXPECT_TRUE(test_api.factory()); | 215 EXPECT_TRUE(test_api.acceptor()); |
| 216 } | 216 } |
| 217 | 217 |
| 218 // Tests for the files created by AppShimHostManager. | 218 // Tests for the files created by AppShimHostManager. |
| 219 class AppShimHostManagerBrowserTestSocketFiles | 219 class AppShimHostManagerBrowserTestSocketFiles |
| 220 : public AppShimHostManagerBrowserTest { | 220 : public AppShimHostManagerBrowserTest { |
| 221 public: | 221 public: |
| 222 AppShimHostManagerBrowserTestSocketFiles() {} | 222 AppShimHostManagerBrowserTestSocketFiles() {} |
| 223 | 223 |
| 224 protected: | 224 protected: |
| 225 base::FilePath directory_in_tmp_; | 225 base::FilePath directory_in_tmp_; |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 262 EXPECT_TRUE(base::PathExists(directory_in_tmp_)); | 262 EXPECT_TRUE(base::PathExists(directory_in_tmp_)); |
| 263 EXPECT_TRUE(base::PathExists(symlink_path_)); | 263 EXPECT_TRUE(base::PathExists(symlink_path_)); |
| 264 | 264 |
| 265 // Check that the symlink has been replaced. | 265 // Check that the symlink has been replaced. |
| 266 base::FilePath socket_path; | 266 base::FilePath socket_path; |
| 267 ASSERT_TRUE(base::ReadSymbolicLink(symlink_path_, &socket_path)); | 267 ASSERT_TRUE(base::ReadSymbolicLink(symlink_path_, &socket_path)); |
| 268 EXPECT_EQ(app_mode::kAppShimSocketShortName, socket_path.BaseName().value()); | 268 EXPECT_EQ(app_mode::kAppShimSocketShortName, socket_path.BaseName().value()); |
| 269 } | 269 } |
| 270 | 270 |
| 271 } // namespace | 271 } // namespace |
| OLD | NEW |