| 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_manager_mac.h" | 5 #include "chrome/browser/apps/app_shim/app_shim_host_manager_mac.h" |
| 6 | 6 |
| 7 #include <unistd.h> | 7 #include <unistd.h> |
| 8 | 8 |
| 9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 base::FilePath user_data_dir; | 58 base::FilePath user_data_dir; |
| 59 CHECK(PathService::Get(chrome::DIR_USER_DATA, &user_data_dir)); | 59 CHECK(PathService::Get(chrome::DIR_USER_DATA, &user_data_dir)); |
| 60 base::FilePath symlink_path = | 60 base::FilePath symlink_path = |
| 61 user_data_dir.Append(app_mode::kAppShimSocketSymlinkName); | 61 user_data_dir.Append(app_mode::kAppShimSocketSymlinkName); |
| 62 | 62 |
| 63 base::FilePath socket_path; | 63 base::FilePath socket_path; |
| 64 CHECK(base::ReadSymbolicLink(symlink_path, &socket_path)); | 64 CHECK(base::ReadSymbolicLink(symlink_path, &socket_path)); |
| 65 app_mode::VerifySocketPermissions(socket_path); | 65 app_mode::VerifySocketPermissions(socket_path); |
| 66 | 66 |
| 67 IPC::ChannelHandle handle(socket_path.value()); | 67 IPC::ChannelHandle handle(socket_path.value()); |
| 68 channel_ = IPC::ChannelProxy::Create(handle, IPC::Channel::MODE_NAMED_CLIENT, | 68 channel_ = |
| 69 this, io_thread_.task_runner().get()); | 69 IPC::ChannelProxy::Create(handle, IPC::Channel::MODE_NAMED_CLIENT, this, |
| 70 io_thread_.task_runner().get(), nullptr); |
| 70 } | 71 } |
| 71 | 72 |
| 72 TestShimClient::~TestShimClient() {} | 73 TestShimClient::~TestShimClient() {} |
| 73 | 74 |
| 74 bool TestShimClient::OnMessageReceived(const IPC::Message& message) { | 75 bool TestShimClient::OnMessageReceived(const IPC::Message& message) { |
| 75 return true; | 76 return true; |
| 76 } | 77 } |
| 77 | 78 |
| 78 void TestShimClient::OnChannelError() { | 79 void TestShimClient::OnChannelError() { |
| 79 // Client should not get any channel errors for the current set of tests. | 80 // Client should not get any channel errors for the current set of tests. |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 ASSERT_TRUE(base::ReadSymbolicLink(symlink_path_, &socket_path)); | 278 ASSERT_TRUE(base::ReadSymbolicLink(symlink_path_, &socket_path)); |
| 278 EXPECT_EQ(app_mode::kAppShimSocketShortName, socket_path.BaseName().value()); | 279 EXPECT_EQ(app_mode::kAppShimSocketShortName, socket_path.BaseName().value()); |
| 279 | 280 |
| 280 // Check that the RunningChromeVersion file is correctly written. | 281 // Check that the RunningChromeVersion file is correctly written. |
| 281 base::FilePath version; | 282 base::FilePath version; |
| 282 EXPECT_TRUE(base::ReadSymbolicLink(version_path_, &version)); | 283 EXPECT_TRUE(base::ReadSymbolicLink(version_path_, &version)); |
| 283 EXPECT_EQ(chrome::VersionInfo().Version(), version.value()); | 284 EXPECT_EQ(chrome::VersionInfo().Version(), version.value()); |
| 284 } | 285 } |
| 285 | 286 |
| 286 } // namespace | 287 } // namespace |
| OLD | NEW |