OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/public/common/common_param_traits.h" | 5 #include "content/public/common/common_param_traits.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <string.h> | 8 #include <string.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 out.signed_certificate_timestamps[0].sct->origin); | 248 out.signed_certificate_timestamps[0].sct->origin); |
249 ASSERT_EQ(in.signed_certificate_timestamps[0].sct->log_description, | 249 ASSERT_EQ(in.signed_certificate_timestamps[0].sct->log_description, |
250 out.signed_certificate_timestamps[0].sct->log_description); | 250 out.signed_certificate_timestamps[0].sct->log_description); |
251 | 251 |
252 ASSERT_EQ(in.ct_compliance_details_available, | 252 ASSERT_EQ(in.ct_compliance_details_available, |
253 out.ct_compliance_details_available); | 253 out.ct_compliance_details_available); |
254 ASSERT_EQ(in.ct_ev_policy_compliance, out.ct_ev_policy_compliance); | 254 ASSERT_EQ(in.ct_ev_policy_compliance, out.ct_ev_policy_compliance); |
255 ASSERT_EQ(in.ct_cert_policy_compliance, out.ct_cert_policy_compliance); | 255 ASSERT_EQ(in.ct_cert_policy_compliance, out.ct_cert_policy_compliance); |
256 ASSERT_EQ(in.ocsp_result, out.ocsp_result); | 256 ASSERT_EQ(in.ocsp_result, out.ocsp_result); |
257 } | 257 } |
| 258 |
| 259 TEST(IPCMessageTest, RenderWidgetSurfaceProperties) { |
| 260 content::RenderWidgetSurfaceProperties input; |
| 261 input.size = gfx::Size(23, 45); |
| 262 input.device_scale_factor = 0.8; |
| 263 #ifdef OS_ANDROID |
| 264 input.top_controls_height = 16.5; |
| 265 input.top_controls_shown_ratio = 0.4; |
| 266 input.bottom_controls_height = 23.4; |
| 267 input.bottom_controls_shown_ratio = 0.8; |
| 268 input.selection.start.set_type(gfx::SelectionBound::Type::CENTER); |
| 269 input.has_transparent_background = true; |
| 270 #endif |
| 271 |
| 272 IPC::Message msg(1, 2, IPC::Message::PRIORITY_NORMAL); |
| 273 IPC::ParamTraits<content::RenderWidgetSurfaceProperties>::Write(&msg, input); |
| 274 |
| 275 content::RenderWidgetSurfaceProperties output; |
| 276 base::PickleIterator iter(msg); |
| 277 EXPECT_TRUE(IPC::ParamTraits<content::RenderWidgetSurfaceProperties>::Read( |
| 278 &msg, &iter, &output)); |
| 279 |
| 280 EXPECT_EQ(input.size, output.size); |
| 281 EXPECT_EQ(input.device_scale_factor, output.device_scale_factor); |
| 282 #ifdef OS_ANDROID |
| 283 EXPECT_EQ(input.top_controls_height, output.top_controls_height); |
| 284 EXPECT_EQ(input.top_controls_shown_ratio, output.top_controls_shown_ratio); |
| 285 EXPECT_EQ(input.bottom_controls_height, output.bottom_controls_height); |
| 286 EXPECT_EQ(input.bottom_controls_shown_ratio, |
| 287 output.bottom_controls_shown_ratio); |
| 288 EXPECT_EQ(input.selection, output.selection); |
| 289 EXPECT_EQ(input.has_transparent_background, |
| 290 output.has_transparent_background); |
| 291 #endif |
| 292 } |
OLD | NEW |