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

Unified Diff: util/mach/mach_message_test.cc

Issue 773943002: Add MachMessageWithDeadline() and supporting characters (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@mach_message_util_move
Patch Set: Created 6 years 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/mach/mach_message.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: util/mach/mach_message_test.cc
diff --git a/util/mach/mach_message_test.cc b/util/mach/mach_message_test.cc
index b807b7ed5205f098b788936f56cf0616d61ba18c..eed6c8e21820deaef30e10a2100bef89e7546c39 100644
--- a/util/mach/mach_message_test.cc
+++ b/util/mach/mach_message_test.cc
@@ -22,6 +22,20 @@ namespace crashpad {
namespace test {
namespace {
+TEST(MachMessage, MachMessageDeadlineFromTimeout) {
+ MachMessageDeadline deadline_0 = MachMessageDeadlineFromTimeout(0);
+ EXPECT_EQ(kMachMessageNonblocking, deadline_0);
+
+ deadline_0 = MachMessageDeadlineFromTimeout(1);
+ MachMessageDeadline deadline_1 = MachMessageDeadlineFromTimeout(100);
+
+ EXPECT_NE(kMachMessageNonblocking, deadline_0);
+ EXPECT_NE(kMachMessageWaitIndefinitely, deadline_0);
+ EXPECT_NE(kMachMessageNonblocking, deadline_1);
+ EXPECT_NE(kMachMessageWaitIndefinitely, deadline_1);
+ EXPECT_GE(deadline_1, deadline_0);
+}
+
TEST(MachMessage, PrepareMIGReplyFromRequest_SetMIGReplyError) {
mach_msg_header_t request;
request.msgh_bits =
« no previous file with comments | « util/mach/mach_message.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698