Andy Phan | a6d0515d | 2024-10-18 20:41:52 | [diff] [blame] | 1 | // Copyright 2024 The Chromium Authors |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #include"pdf/message_util.h" |
| 6 | |
| 7 | #include"base/test/values_test_util.h" |
| 8 | #include"base/values.h" |
| 9 | #include"testing/gtest/include/gtest/gtest.h" |
| 10 | |
| 11 | namespace chrome_pdf{ |
| 12 | |
| 13 | TEST(PrepareReplyMessageTest,BasicReply){ |
| 14 | base::Value::Dict message; |
| 15 | message.Set("type","typeBasic"); |
| 16 | message.Set("messageId","messageIdBasic"); |
| 17 | |
| 18 | base::Value::Dict reply=PrepareReplyMessage(message); |
| 19 | |
| 20 | const std::string* reply_type= reply.FindString("type"); |
| 21 | ASSERT_TRUE(reply_type); |
| 22 | EXPECT_EQ("typeBasicReply",*reply_type); |
| 23 | |
| 24 | const std::string* reply_message_id= reply.FindString("messageId"); |
| 25 | ASSERT_TRUE(reply_message_id); |
| 26 | EXPECT_EQ("messageIdBasic",*reply_message_id); |
| 27 | } |
| 28 | |
| 29 | }// namespace chrome_pdf |