| 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 g_good_shutdown = true; | 54 g_good_shutdown = true; |
| 55 loop->PostTask(FROM_HERE, base::MessageLoop::QuitClosure()); | 55 loop->PostTask(FROM_HERE, base::MessageLoop::QuitClosure()); |
| 56 } | 56 } |
| 57 | 57 |
| 58 } // namespace | 58 } // namespace |
| 59 | 59 |
| 60 TEST(ServiceProcessUtilTest, ScopedVersionedName) { | 60 TEST(ServiceProcessUtilTest, ScopedVersionedName) { |
| 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 DCHECK(version_info.is_valid()); | |
| 65 EXPECT_TRUE(EndsWith(scoped_name, test_str, true)); | 64 EXPECT_TRUE(EndsWith(scoped_name, test_str, true)); |
| 66 EXPECT_NE(std::string::npos, scoped_name.find(version_info.Version())); | 65 EXPECT_NE(std::string::npos, scoped_name.find(version_info.Version())); |
| 67 } | 66 } |
| 68 | 67 |
| 69 class ServiceProcessStateTest : public base::MultiProcessTest { | 68 class ServiceProcessStateTest : public base::MultiProcessTest { |
| 70 public: | 69 public: |
| 71 ServiceProcessStateTest(); | 70 ServiceProcessStateTest(); |
| 72 virtual ~ServiceProcessStateTest(); | 71 virtual ~ServiceProcessStateTest(); |
| 73 virtual void SetUp(); | 72 virtual void SetUp(); |
| 74 base::MessageLoopProxy* IOMessageLoopProxy() { | 73 base::MessageLoopProxy* IOMessageLoopProxy() { |
| (...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 416 ScopedAttributesRestorer restorer(bundle_path(), 0777); | 415 ScopedAttributesRestorer restorer(bundle_path(), 0777); |
| 417 GetIOMessageLoopProxy()->PostTask( | 416 GetIOMessageLoopProxy()->PostTask( |
| 418 FROM_HERE, | 417 FROM_HERE, |
| 419 base::Bind(&ChangeAttr, bundle_path(), 0222)); | 418 base::Bind(&ChangeAttr, bundle_path(), 0222)); |
| 420 Run(); | 419 Run(); |
| 421 ASSERT_TRUE(mock_launchd()->remove_called()); | 420 ASSERT_TRUE(mock_launchd()->remove_called()); |
| 422 ASSERT_TRUE(mock_launchd()->delete_called()); | 421 ASSERT_TRUE(mock_launchd()->delete_called()); |
| 423 } | 422 } |
| 424 | 423 |
| 425 #endif // !OS_MACOSX | 424 #endif // !OS_MACOSX |
| OLD | NEW |