Commit a94e0ecd authored by aboxhall's avatar aboxhall Committed by Commit bot

Rework types_unittest.cc not to rely on the GetAXNode method.

Should fix build breakage (https://build.chromium.org/p/chromium.chromiumos/builders/Linux%20ChromiumOS%20GN/builds/45952/steps/compile/logs/stdio) caused by modifying the Accessibility model in https://codereview.chromium.org/2322413003/

BUG=

Review-Url: https://codereview.chromium.org/2351693002
Cr-Commit-Position: refs/heads/master@{#419445}
parent e7d28e65
...@@ -9,23 +9,23 @@ ...@@ -9,23 +9,23 @@
namespace headless { namespace headless {
TEST(TypesTest, IntegerProperty) { TEST(TypesTest, IntegerProperty) {
std::unique_ptr<accessibility::GetAXNodeParams> object( std::unique_ptr<page::NavigateToHistoryEntryParams> object(
accessibility::GetAXNodeParams::Builder().SetNodeId(123).Build()); page::NavigateToHistoryEntryParams::Builder().SetEntryId(123).Build());
EXPECT_TRUE(object); EXPECT_TRUE(object);
EXPECT_EQ(123, object->GetNodeId()); EXPECT_EQ(123, object->GetEntryId());
std::unique_ptr<accessibility::GetAXNodeParams> clone(object->Clone()); std::unique_ptr<page::NavigateToHistoryEntryParams> clone(object->Clone());
EXPECT_TRUE(clone); EXPECT_TRUE(clone);
EXPECT_EQ(123, clone->GetNodeId()); EXPECT_EQ(123, clone->GetEntryId());
} }
TEST(TypesTest, IntegerPropertyParseError) { TEST(TypesTest, IntegerPropertyParseError) {
const char* json = "{\"nodeId\": \"foo\"}"; const char* json = "{\"entryId\": \"foo\"}";
std::unique_ptr<base::Value> object = base::JSONReader::Read(json); std::unique_ptr<base::Value> object = base::JSONReader::Read(json);
EXPECT_TRUE(object); EXPECT_TRUE(object);
ErrorReporter errors; ErrorReporter errors;
EXPECT_FALSE(accessibility::GetAXNodeParams::Parse(*object, &errors)); EXPECT_FALSE(page::NavigateToHistoryEntryParams::Parse(*object, &errors));
EXPECT_TRUE(errors.HasErrors()); EXPECT_TRUE(errors.HasErrors());
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment