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

Unified Diff: util/net/http_multipart_builder_test.cc

Issue 992693003: Add ASSERT_DEATH_CHECK() to do ASSERT_DEATH() of CHECK() failures (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: Address review feedback Created 5 years, 9 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/misc/scoped_forbid_return_test.cc ('k') | util/test/gtest_death_check.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: util/net/http_multipart_builder_test.cc
diff --git a/util/net/http_multipart_builder_test.cc b/util/net/http_multipart_builder_test.cc
index e185e4ac36d2c066a3fdefd4559d547e416974ea..5517f67baaa5ea0a1b7f6ae7ec01c91f42a2a4cf 100644
--- a/util/net/http_multipart_builder_test.cc
+++ b/util/net/http_multipart_builder_test.cc
@@ -19,6 +19,7 @@
#include "gtest/gtest.h"
#include "util/net/http_body.h"
#include "util/net/http_body_test_util.h"
+#include "util/test/gtest_death_check.h"
#include "util/test/paths.h"
namespace crashpad {
@@ -273,10 +274,14 @@ TEST(HTTPMultipartBuilder, SharedFormDataAndAttachmentKeyNamespace) {
TEST(HTTPMultipartBuilderDeathTest, AssertUnsafeMIMEType) {
HTTPMultipartBuilder builder;
// Invalid and potentially dangerous:
- ASSERT_DEATH(builder.SetFileAttachment("", "", base::FilePath(), "\r\n"), "");
- ASSERT_DEATH(builder.SetFileAttachment("", "", base::FilePath(), "\""), "");
- ASSERT_DEATH(builder.SetFileAttachment("", "", base::FilePath(), "\x12"), "");
- ASSERT_DEATH(builder.SetFileAttachment("", "", base::FilePath(), "<>"), "");
+ ASSERT_DEATH_CHECK(
+ builder.SetFileAttachment("", "", base::FilePath(), "\r\n"), "");
+ ASSERT_DEATH_CHECK(
+ builder.SetFileAttachment("", "", base::FilePath(), "\""), "");
+ ASSERT_DEATH_CHECK(
+ builder.SetFileAttachment("", "", base::FilePath(), "\x12"), "");
+ ASSERT_DEATH_CHECK(
+ builder.SetFileAttachment("", "", base::FilePath(), "<>"), "");
// Invalid but safe:
builder.SetFileAttachment("", "", base::FilePath(), "0/totally/-invalid.pdf");
// Valid and safe:
« no previous file with comments | « util/misc/scoped_forbid_return_test.cc ('k') | util/test/gtest_death_check.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698