OLD | NEW |
---|---|
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/memory/ptr_util.h" | |
5 #include "blimp/common/create_blimp_message.h" | 6 #include "blimp/common/create_blimp_message.h" |
6 #include "blimp/common/proto/blimp_message.pb.h" | 7 #include "blimp/common/proto/blimp_message.pb.h" |
7 #include "blimp/common/proto/compositor.pb.h" | 8 #include "blimp/common/proto/compositor.pb.h" |
8 #include "blimp/common/proto/input.pb.h" | 9 #include "blimp/common/proto/input.pb.h" |
9 #include "blimp/common/proto/navigation.pb.h" | 10 #include "blimp/common/proto/navigation.pb.h" |
10 #include "blimp/common/proto/render_widget.pb.h" | 11 #include "blimp/common/proto/render_widget.pb.h" |
11 #include "blimp/common/proto/tab_control.pb.h" | 12 #include "blimp/common/proto/tab_control.pb.h" |
12 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
13 | 14 |
14 namespace blimp { | 15 namespace blimp { |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
84 EXPECT_NE(nullptr, message); | 85 EXPECT_NE(nullptr, message); |
85 EXPECT_EQ(BlimpMessage::PROTOCOL_CONTROL, message->type()); | 86 EXPECT_EQ(BlimpMessage::PROTOCOL_CONTROL, message->type()); |
86 EXPECT_EQ(ProtocolControlMessage::START_CONNECTION, | 87 EXPECT_EQ(ProtocolControlMessage::START_CONNECTION, |
87 message->protocol_control().type()); | 88 message->protocol_control().type()); |
88 EXPECT_EQ(client_token, | 89 EXPECT_EQ(client_token, |
89 message->protocol_control().start_connection().client_token()); | 90 message->protocol_control().start_connection().client_token()); |
90 EXPECT_EQ(protocol_version, | 91 EXPECT_EQ(protocol_version, |
91 message->protocol_control().start_connection().protocol_version()); | 92 message->protocol_control().start_connection().protocol_version()); |
92 } | 93 } |
93 | 94 |
95 TEST(CreateBlimpMessageTest, BlobChannelMessage) { | |
96 BlobChannelMessage* details = new BlobChannelMessage; | |
97 std::unique_ptr<BlimpMessage> message = | |
98 CreateBlimpMessage(base::WrapUnique(details)); | |
99 EXPECT_NE(nullptr, message); | |
Wez
2016/05/20 21:46:17
nit: EXPECT_TRUE(message) or even ASSERT_TRUE(mess
| |
100 EXPECT_EQ(details, &message->blob_channel()); | |
101 EXPECT_EQ(BlimpMessage::BLOB_CHANNEL, message->type()); | |
102 } | |
103 | |
104 | |
94 } // namespace | 105 } // namespace |
95 } // namespace blimp | 106 } // namespace blimp |
OLD | NEW |