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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 g_good_shutdown = true; | 56 g_good_shutdown = true; |
57 loop->task_runner()->PostTask(FROM_HERE, base::MessageLoop::QuitClosure()); | 57 loop->task_runner()->PostTask(FROM_HERE, base::MessageLoop::QuitClosure()); |
58 } | 58 } |
59 | 59 |
60 } // namespace | 60 } // namespace |
61 | 61 |
62 TEST(ServiceProcessUtilTest, ScopedVersionedName) { | 62 TEST(ServiceProcessUtilTest, ScopedVersionedName) { |
63 std::string test_str = "test"; | 63 std::string test_str = "test"; |
64 std::string scoped_name = GetServiceProcessScopedVersionedName(test_str); | 64 std::string scoped_name = GetServiceProcessScopedVersionedName(test_str); |
65 chrome::VersionInfo version_info; | 65 chrome::VersionInfo version_info; |
66 EXPECT_TRUE(base::EndsWith(scoped_name, test_str, true)); | 66 EXPECT_TRUE(base::EndsWith(scoped_name, test_str, |
| 67 base::CompareCase::SENSITIVE)); |
67 EXPECT_NE(std::string::npos, scoped_name.find(version_info.Version())); | 68 EXPECT_NE(std::string::npos, scoped_name.find(version_info.Version())); |
68 } | 69 } |
69 | 70 |
70 class ServiceProcessStateTest : public base::MultiProcessTest { | 71 class ServiceProcessStateTest : public base::MultiProcessTest { |
71 public: | 72 public: |
72 ServiceProcessStateTest(); | 73 ServiceProcessStateTest(); |
73 ~ServiceProcessStateTest() override; | 74 ~ServiceProcessStateTest() override; |
74 void SetUp() override; | 75 void SetUp() override; |
75 base::SingleThreadTaskRunner* IOMessageLoopProxy() { | 76 base::SingleThreadTaskRunner* IOMessageLoopProxy() { |
76 return io_thread_.task_runner().get(); | 77 return io_thread_.task_runner().get(); |
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
416 ScopedAttributesRestorer restorer(bundle_path(), 0777); | 417 ScopedAttributesRestorer restorer(bundle_path(), 0777); |
417 GetIOMessageLoopProxy()->PostTask( | 418 GetIOMessageLoopProxy()->PostTask( |
418 FROM_HERE, | 419 FROM_HERE, |
419 base::Bind(&ChangeAttr, bundle_path(), 0222)); | 420 base::Bind(&ChangeAttr, bundle_path(), 0222)); |
420 Run(); | 421 Run(); |
421 ASSERT_TRUE(mock_launchd()->remove_called()); | 422 ASSERT_TRUE(mock_launchd()->remove_called()); |
422 ASSERT_TRUE(mock_launchd()->delete_called()); | 423 ASSERT_TRUE(mock_launchd()->delete_called()); |
423 } | 424 } |
424 | 425 |
425 #endif // !OS_MACOSX | 426 #endif // !OS_MACOSX |
OLD | NEW |