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

Unified Diff: util/mac/service_management_test.mm

Issue 597533002: Add, test, and use clock utilities (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: (no change) Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « util/mac/service_management.cc ('k') | util/mach/mach_message_server.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: util/mac/service_management_test.mm
diff --git a/util/mac/service_management_test.mm b/util/mac/service_management_test.mm
index 3c1d638394dc2fb08b6d8940870aa42596ab4b28..9ca2e15ae61df9fd0233108f1f6bb3b64456f29c 100644
--- a/util/mac/service_management_test.mm
+++ b/util/mac/service_management_test.mm
@@ -16,7 +16,6 @@
#import <Foundation/Foundation.h>
#include <launch.h>
-#include <time.h>
#include <string>
#include <vector>
@@ -27,6 +26,7 @@
#include "base/strings/sys_string_conversions.h"
#include "base/rand_util.h"
#include "gtest/gtest.h"
+#include "util/misc/clock.h"
#include "util/posix/process_util.h"
#include "util/stdlib/objc.h"
@@ -53,10 +53,7 @@ void ExpectProcessIsRunning(pid_t pid, std::string& last_arg) {
break;
}
if (inner_tries > 0) {
- timespec sleep_time;
- sleep_time.tv_sec = 0;
- sleep_time.tv_nsec = 1E6; // 1 millisecond
- nanosleep(&sleep_time, NULL);
+ SleepNanoseconds(1E6); // 1 millisecond
}
} while (inner_tries--);
ASSERT_TRUE(success);
@@ -68,10 +65,7 @@ void ExpectProcessIsRunning(pid_t pid, std::string& last_arg) {
}
if (outer_tries > 0) {
- timespec sleep_time;
- sleep_time.tv_sec = 0;
- sleep_time.tv_nsec = 1E6; // 1 millisecond
- nanosleep(&sleep_time, NULL);
+ SleepNanoseconds(1E6); // 1 millisecond
}
}
@@ -101,10 +95,7 @@ void ExpectProcessIsNotRunning(pid_t pid, std::string& last_arg) {
}
if (tries > 0) {
- timespec sleep_time;
- sleep_time.tv_sec = 0;
- sleep_time.tv_nsec = 1E6; // 1 millisecond
- nanosleep(&sleep_time, NULL);
+ SleepNanoseconds(1E6); // 1 millisecond
}
}
« no previous file with comments | « util/mac/service_management.cc ('k') | util/mach/mach_message_server.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698