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

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

Issue 11275088: Remove implicit scoped_refptr operator T* Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 8 years, 1 month 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
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/file_path.h" 10 #include "base/file_path.h"
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 ~ServiceProcessStateTest(); 71 ~ServiceProcessStateTest();
72 virtual void SetUp(); 72 virtual void SetUp();
73 base::MessageLoopProxy* IOMessageLoopProxy() { 73 base::MessageLoopProxy* IOMessageLoopProxy() {
74 return io_thread_.message_loop_proxy(); 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 };
83 83
84 ServiceProcessStateTest::ServiceProcessStateTest() 84 ServiceProcessStateTest::ServiceProcessStateTest()
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 } 216 }
217 217
218 MULTIPROCESS_TEST_MAIN(ServiceProcessStateTestShutdown) { 218 MULTIPROCESS_TEST_MAIN(ServiceProcessStateTestShutdown) {
219 MessageLoop message_loop; 219 MessageLoop message_loop;
220 message_loop.set_thread_name("ServiceProcessStateTestShutdownMainThread"); 220 message_loop.set_thread_name("ServiceProcessStateTestShutdownMainThread");
221 base::Thread io_thread_("ServiceProcessStateTestShutdownIOThread"); 221 base::Thread io_thread_("ServiceProcessStateTestShutdownIOThread");
222 base::Thread::Options options(MessageLoop::TYPE_IO, 0); 222 base::Thread::Options options(MessageLoop::TYPE_IO, 0);
223 EXPECT_TRUE(io_thread_.StartWithOptions(options)); 223 EXPECT_TRUE(io_thread_.StartWithOptions(options));
224 ServiceProcessState state; 224 ServiceProcessState state;
225 EXPECT_TRUE(state.Initialize()); 225 EXPECT_TRUE(state.Initialize());
226 EXPECT_TRUE(state.SignalReady(io_thread_.message_loop_proxy(), 226 EXPECT_TRUE(state.SignalReady(io_thread_.message_loop_proxy().get(),
227 base::Bind(&ShutdownTask, 227 base::Bind(&ShutdownTask,
228 MessageLoop::current()))); 228 MessageLoop::current())));
229 message_loop.PostDelayedTask(FROM_HERE, 229 message_loop.PostDelayedTask(FROM_HERE,
230 MessageLoop::QuitClosure(), 230 MessageLoop::QuitClosure(),
231 TestTimeouts::action_max_timeout()); 231 TestTimeouts::action_max_timeout());
232 EXPECT_FALSE(g_good_shutdown); 232 EXPECT_FALSE(g_good_shutdown);
233 message_loop.Run(); 233 message_loop.Run();
234 EXPECT_TRUE(g_good_shutdown); 234 EXPECT_TRUE(g_good_shutdown);
235 return 0; 235 return 0;
236 } 236 }
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
409 ScopedAttributesRestorer restorer(bundle_path(), 0777); 409 ScopedAttributesRestorer restorer(bundle_path(), 0777);
410 GetIOMessageLoopProxy()->PostTask( 410 GetIOMessageLoopProxy()->PostTask(
411 FROM_HERE, 411 FROM_HERE,
412 base::Bind(&ChangeAttr, bundle_path(), 0222)); 412 base::Bind(&ChangeAttr, bundle_path(), 0222));
413 Run(); 413 Run();
414 ASSERT_TRUE(mock_launchd()->remove_called()); 414 ASSERT_TRUE(mock_launchd()->remove_called());
415 ASSERT_TRUE(mock_launchd()->delete_called()); 415 ASSERT_TRUE(mock_launchd()->delete_called());
416 } 416 }
417 417
418 #endif // !OS_MACOSX 418 #endif // !OS_MACOSX
OLDNEW
« no previous file with comments | « chrome/common/extensions/permissions/permission_set_unittest.cc ('k') | chrome/nacl/nacl_listener.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698