Commit 940635ba authored by Istiaque Ahmed's avatar Istiaque Ahmed Committed by Commit Bot

Replace ParseJsonDeprecated with ParseJson.

The callsites were dereferencing return value of
ParseJsonDeprecated anyway, so make it use non-deprecated ParseJson.

Bug: 932873
Test: Unit test cleanup, no behavior change.
Change-Id: I80fd06bc3ecfa39d0f5cad9cb88631e685bc122c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2108004
Commit-Queue: mark a. foltz <mfoltz@chromium.org>
Reviewed-by: default avatarmark a. foltz <mfoltz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#751774}
parent 3bb164ff
......@@ -10,7 +10,7 @@
#include "third_party/openscreen/src/cast/common/channel/proto/cast_channel.pb.h"
using base::test::IsJson;
using base::test::ParseJsonDeprecated;
using base::test::ParseJson;
namespace cast_channel {
......@@ -38,8 +38,7 @@ TEST(CastMessageUtilTest, GetLaunchSessionResponseOk) {
}
)";
LaunchSessionResponse response =
GetLaunchSessionResponse(*ParseJsonDeprecated(payload));
LaunchSessionResponse response = GetLaunchSessionResponse(ParseJson(payload));
EXPECT_EQ(LaunchSessionResponse::Result::kOk, response.result);
EXPECT_TRUE(response.receiver_status);
}
......@@ -52,8 +51,7 @@ TEST(CastMessageUtilTest, GetLaunchSessionResponseError) {
}
)";
LaunchSessionResponse response =
GetLaunchSessionResponse(*ParseJsonDeprecated(payload));
LaunchSessionResponse response = GetLaunchSessionResponse(ParseJson(payload));
EXPECT_EQ(LaunchSessionResponse::Result::kError, response.result);
EXPECT_FALSE(response.receiver_status);
}
......@@ -68,8 +66,7 @@ TEST(CastMessageUtilTest, GetLaunchSessionResponseUnknown) {
}
)";
LaunchSessionResponse response =
GetLaunchSessionResponse(*ParseJsonDeprecated(payload));
LaunchSessionResponse response = GetLaunchSessionResponse(ParseJson(payload));
EXPECT_EQ(LaunchSessionResponse::Result::kUnknown, response.result);
EXPECT_FALSE(response.receiver_status);
}
......@@ -127,8 +124,8 @@ TEST(CastMessageUtilTest, CreateMediaRequest) {
"requestId": 123,
})";
CastMessage message = CreateMediaRequest(*ParseJsonDeprecated(body), 123,
"theSourceId", "theDestinationId");
CastMessage message = CreateMediaRequest(ParseJson(body), 123, "theSourceId",
"theDestinationId");
ASSERT_TRUE(IsCastMessageValid(message));
EXPECT_EQ(kMediaNamespace, message.namespace_());
EXPECT_EQ("theSourceId", message.source_id());
......@@ -147,7 +144,7 @@ TEST(CastMessageUtilTest, CreateVolumeRequest) {
})";
CastMessage message =
CreateSetVolumeRequest(*ParseJsonDeprecated(body), 123, "theSourceId");
CreateSetVolumeRequest(ParseJson(body), 123, "theSourceId");
ASSERT_TRUE(IsCastMessageValid(message));
EXPECT_EQ(kReceiverNamespace, message.namespace_());
EXPECT_EQ("theSourceId", message.source_id());
......
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