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/mac/mock_launchd.h" | 5 #include "chrome/common/mac/mock_launchd.h" |
6 | 6 |
7 #include <CoreFoundation/CoreFoundation.h> | 7 #include <CoreFoundation/CoreFoundation.h> |
8 #include <sys/socket.h> | 8 #include <sys/socket.h> |
9 #include <sys/un.h> | 9 #include <sys/un.h> |
10 | 10 |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 return CFDictionaryCreate(kCFAllocatorDefault, | 219 return CFDictionaryCreate(kCFAllocatorDefault, |
220 keys, | 220 keys, |
221 values, | 221 values, |
222 arraysize(keys), | 222 arraysize(keys), |
223 &kCFTypeDictionaryKeyCallBacks, | 223 &kCFTypeDictionaryKeyCallBacks, |
224 &kCFTypeDictionaryValueCallBacks); | 224 &kCFTypeDictionaryValueCallBacks); |
225 } | 225 } |
226 | 226 |
227 bool MockLaunchd::RemoveJob(CFStringRef label, CFErrorRef* error) { | 227 bool MockLaunchd::RemoveJob(CFStringRef label, CFErrorRef* error) { |
228 remove_called_ = true; | 228 remove_called_ = true; |
229 message_loop_->PostTask(FROM_HERE, base::MessageLoop::QuitClosure()); | 229 message_loop_->PostTask(FROM_HERE, base::MessageLoop::QuitWhenIdleClosure()); |
230 return true; | 230 return true; |
231 } | 231 } |
232 | 232 |
233 bool MockLaunchd::RestartJob(Domain domain, | 233 bool MockLaunchd::RestartJob(Domain domain, |
234 Type type, | 234 Type type, |
235 CFStringRef name, | 235 CFStringRef name, |
236 CFStringRef session_type) { | 236 CFStringRef session_type) { |
237 restart_called_ = true; | 237 restart_called_ = true; |
238 message_loop_->PostTask(FROM_HERE, base::MessageLoop::QuitClosure()); | 238 message_loop_->PostTask(FROM_HERE, base::MessageLoop::QuitWhenIdleClosure()); |
239 return true; | 239 return true; |
240 } | 240 } |
241 | 241 |
242 CFMutableDictionaryRef MockLaunchd::CreatePlistFromFile( | 242 CFMutableDictionaryRef MockLaunchd::CreatePlistFromFile( |
243 Domain domain, | 243 Domain domain, |
244 Type type, | 244 Type type, |
245 CFStringRef name) { | 245 CFStringRef name) { |
246 base::ScopedCFTypeRef<CFDictionaryRef> dict(CopyDictionaryByCheckingIn(NULL)); | 246 base::ScopedCFTypeRef<CFDictionaryRef> dict(CopyDictionaryByCheckingIn(NULL)); |
247 return CFDictionaryCreateMutableCopy(kCFAllocatorDefault, 0, dict); | 247 return CFDictionaryCreateMutableCopy(kCFAllocatorDefault, 0, dict); |
248 } | 248 } |
(...skipping 10 matching lines...) Expand all Loading... |
259 Type type, | 259 Type type, |
260 CFStringRef name) { | 260 CFStringRef name) { |
261 delete_called_ = true; | 261 delete_called_ = true; |
262 return true; | 262 return true; |
263 } | 263 } |
264 | 264 |
265 void MockLaunchd::SignalReady() { | 265 void MockLaunchd::SignalReady() { |
266 ASSERT_TRUE(as_service_); | 266 ASSERT_TRUE(as_service_); |
267 running_lock_.reset(TakeNamedLock(pipe_name_, true)); | 267 running_lock_.reset(TakeNamedLock(pipe_name_, true)); |
268 } | 268 } |
OLD | NEW |