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

Unified Diff: util/mach/exc_server_variants_test.cc

Issue 565793005: Add exception_behaviors and its test (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: 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/mach/exc_client_variants_test.cc ('k') | util/mach/exception_behaviors.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: util/mach/exc_server_variants_test.cc
diff --git a/util/mach/exc_server_variants_test.cc b/util/mach/exc_server_variants_test.cc
index 101ab053d9465eb09ed3342cea648950ea7a56d1..6800b4382c9152209db2972be551fae27c5253f1 100644
--- a/util/mach/exc_server_variants_test.cc
+++ b/util/mach/exc_server_variants_test.cc
@@ -21,6 +21,7 @@
#include "base/strings/stringprintf.h"
#include "gmock/gmock.h"
#include "gtest/gtest.h"
+#include "util/mach/exception_behaviors.h"
#include "util/mach/mach_extensions.h"
#include "util/test/mac/mach_errors.h"
#include "util/test/mac/mach_multiprocess.h"
@@ -894,15 +895,10 @@ class TestExcServerVariants : public UniversalMachExcServer,
handled_ = true;
EXPECT_EQ(behavior_, behavior);
- exception_behavior_t basic_behavior = behavior & ~MACH_EXCEPTION_CODES;
- const bool has_identity = basic_behavior == EXCEPTION_DEFAULT ||
- basic_behavior == EXCEPTION_STATE_IDENTITY;
- const bool has_state = basic_behavior == EXCEPTION_STATE ||
- basic_behavior == EXCEPTION_STATE_IDENTITY;
EXPECT_EQ(LocalPort(), exception_port);
- if (has_identity) {
+ if (ExceptionBehaviorHasIdentity(behavior)) {
EXPECT_NE(kMachPortNull, thread);
EXPECT_EQ(ChildTask(), task);
} else {
@@ -921,6 +917,7 @@ class TestExcServerVariants : public UniversalMachExcServer,
SetExpectedChildTermination(kTerminationSignal, sig);
}
+ const bool has_state = ExceptionBehaviorHasState(behavior);
if (has_state) {
EXPECT_EQ(flavor_, *flavor);
EXPECT_EQ(state_count_, old_state_count);
« no previous file with comments | « util/mach/exc_client_variants_test.cc ('k') | util/mach/exception_behaviors.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698