OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/common/service_process_util.h" | 5 #include "chrome/common/service_process_util.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 std::string test_str = "test"; | 61 std::string test_str = "test"; |
62 std::string scoped_name = GetServiceProcessScopedVersionedName(test_str); | 62 std::string scoped_name = GetServiceProcessScopedVersionedName(test_str); |
63 chrome::VersionInfo version_info; | 63 chrome::VersionInfo version_info; |
64 EXPECT_TRUE(EndsWith(scoped_name, test_str, true)); | 64 EXPECT_TRUE(EndsWith(scoped_name, test_str, true)); |
65 EXPECT_NE(std::string::npos, scoped_name.find(version_info.Version())); | 65 EXPECT_NE(std::string::npos, scoped_name.find(version_info.Version())); |
66 } | 66 } |
67 | 67 |
68 class ServiceProcessStateTest : public base::MultiProcessTest { | 68 class ServiceProcessStateTest : public base::MultiProcessTest { |
69 public: | 69 public: |
70 ServiceProcessStateTest(); | 70 ServiceProcessStateTest(); |
71 virtual ~ServiceProcessStateTest(); | 71 ~ServiceProcessStateTest() override; |
72 virtual void SetUp(); | 72 void SetUp() override; |
73 base::MessageLoopProxy* IOMessageLoopProxy() { | 73 base::MessageLoopProxy* IOMessageLoopProxy() { |
74 return io_thread_.message_loop_proxy().get(); | 74 return io_thread_.message_loop_proxy().get(); |
75 } | 75 } |
76 void LaunchAndWait(const std::string& name); | 76 void LaunchAndWait(const std::string& name); |
77 | 77 |
78 private: | 78 private: |
79 // This is used to release the ServiceProcessState singleton after each test. | 79 // This is used to release the ServiceProcessState singleton after each test. |
80 base::ShadowingAtExitManager at_exit_manager_; | 80 base::ShadowingAtExitManager at_exit_manager_; |
81 base::Thread io_thread_; | 81 base::Thread io_thread_; |
82 }; | 82 }; |
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
415 ScopedAttributesRestorer restorer(bundle_path(), 0777); | 415 ScopedAttributesRestorer restorer(bundle_path(), 0777); |
416 GetIOMessageLoopProxy()->PostTask( | 416 GetIOMessageLoopProxy()->PostTask( |
417 FROM_HERE, | 417 FROM_HERE, |
418 base::Bind(&ChangeAttr, bundle_path(), 0222)); | 418 base::Bind(&ChangeAttr, bundle_path(), 0222)); |
419 Run(); | 419 Run(); |
420 ASSERT_TRUE(mock_launchd()->remove_called()); | 420 ASSERT_TRUE(mock_launchd()->remove_called()); |
421 ASSERT_TRUE(mock_launchd()->delete_called()); | 421 ASSERT_TRUE(mock_launchd()->delete_called()); |
422 } | 422 } |
423 | 423 |
424 #endif // !OS_MACOSX | 424 #endif // !OS_MACOSX |
OLD | NEW |