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

Unified Diff: headless/public/domains/types_unittest.cc

Issue 2474433007: headless: Fix ErrorReporter unit tests (Closed)
Patch Set: Created 4 years, 1 month 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 | « no previous file | headless/public/util/error_reporter_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: headless/public/domains/types_unittest.cc
diff --git a/headless/public/domains/types_unittest.cc b/headless/public/domains/types_unittest.cc
index bf59b01151abde3e9c248fd1c0f09819b59a5f8d..11f5ac4fc024e4ab724dee18411bed13c18d6d1f 100644
--- a/headless/public/domains/types_unittest.cc
+++ b/headless/public/domains/types_unittest.cc
@@ -24,9 +24,11 @@ TEST(TypesTest, IntegerPropertyParseError) {
std::unique_ptr<base::Value> object = base::JSONReader::Read(json);
EXPECT_TRUE(object);
+#if DCHECK_IS_ON()
ErrorReporter errors;
EXPECT_FALSE(page::NavigateToHistoryEntryParams::Parse(*object, &errors));
EXPECT_TRUE(errors.HasErrors());
+#endif // DCHECK_IS_ON()
}
TEST(TypesTest, BooleanProperty) {
@@ -48,10 +50,12 @@ TEST(TypesTest, BooleanPropertyParseError) {
std::unique_ptr<base::Value> object = base::JSONReader::Read(json);
EXPECT_TRUE(object);
+#if DCHECK_IS_ON()
ErrorReporter errors;
EXPECT_FALSE(memory::SetPressureNotificationsSuppressedParams::Parse(
*object, &errors));
EXPECT_TRUE(errors.HasErrors());
+#endif // DCHECK_IS_ON()
}
TEST(TypesTest, DoubleProperty) {
@@ -70,9 +74,11 @@ TEST(TypesTest, DoublePropertyParseError) {
std::unique_ptr<base::Value> object = base::JSONReader::Read(json);
EXPECT_TRUE(object);
+#if DCHECK_IS_ON()
ErrorReporter errors;
EXPECT_FALSE(page::SetGeolocationOverrideParams::Parse(*object, &errors));
EXPECT_TRUE(errors.HasErrors());
+#endif // DCHECK_IS_ON()
}
TEST(TypesTest, StringProperty) {
@@ -91,9 +97,11 @@ TEST(TypesTest, StringPropertyParseError) {
std::unique_ptr<base::Value> object = base::JSONReader::Read(json);
EXPECT_TRUE(object);
+#if DCHECK_IS_ON()
ErrorReporter errors;
EXPECT_FALSE(page::NavigateParams::Parse(*object, &errors));
EXPECT_TRUE(errors.HasErrors());
+#endif // DCHECK_IS_ON()
}
TEST(TypesTest, EnumProperty) {
@@ -114,9 +122,11 @@ TEST(TypesTest, EnumPropertyParseError) {
std::unique_ptr<base::Value> object = base::JSONReader::Read(json);
EXPECT_TRUE(object);
+#if DCHECK_IS_ON()
ErrorReporter errors;
EXPECT_FALSE(runtime::RemoteObject::Parse(*object, &errors));
EXPECT_TRUE(errors.HasErrors());
+#endif // DCHECK_IS_ON()
}
TEST(TypesTest, ArrayProperty) {
@@ -146,9 +156,11 @@ TEST(TypesTest, ArrayPropertyParseError) {
std::unique_ptr<base::Value> object = base::JSONReader::Read(json);
EXPECT_TRUE(object);
+#if DCHECK_IS_ON()
ErrorReporter errors;
EXPECT_FALSE(dom::QuerySelectorAllResult::Parse(*object, &errors));
EXPECT_TRUE(errors.HasErrors());
+#endif // DCHECK_IS_ON()
}
TEST(TypesTest, ObjectProperty) {
@@ -173,9 +185,11 @@ TEST(TypesTest, ObjectPropertyParseError) {
std::unique_ptr<base::Value> object = base::JSONReader::Read(json);
EXPECT_TRUE(object);
+#if DCHECK_IS_ON()
ErrorReporter errors;
EXPECT_FALSE(runtime::EvaluateResult::Parse(*object, &errors));
EXPECT_TRUE(errors.HasErrors());
+#endif // DCHECK_IS_ON()
}
TEST(TypesTest, AnyProperty) {
« no previous file with comments | « no previous file | headless/public/util/error_reporter_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698