Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(260)

Side by Side Diff: chrome/common/service_process_util_unittest.cc

Issue 1233043003: Remove some legacy versions of StartsWith and EndsWith. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/common/importer/firefox_importer_utils.cc ('k') | chrome/installer/gcapi/gcapi.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « chrome/common/importer/firefox_importer_utils.cc ('k') | chrome/installer/gcapi/gcapi.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698