| 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 <stddef.h> | 5 #include <stddef.h> |
| 6 #include <string.h> | 6 #include <string.h> |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "base/values.h" | 11 #include "base/values.h" |
| 12 #include "content/public/common/common_param_traits.h" | 12 #include "content/public/common/common_param_traits.h" |
| 13 #include "content/public/common/content_constants.h" | 13 #include "content/public/common/content_constants.h" |
| 14 #include "ipc/ipc_message.h" | 14 #include "ipc/ipc_message.h" |
| 15 #include "ipc/ipc_message_utils.h" | 15 #include "ipc/ipc_message_utils.h" |
| 16 #include "net/base/host_port_pair.h" | 16 #include "net/base/host_port_pair.h" |
| 17 #include "printing/backend/print_backend.h" | 17 #include "printing/backend/print_backend.h" |
| 18 #include "printing/page_range.h" | 18 #include "printing/page_range.h" |
| 19 #include "testing/gtest/include/gtest/gtest.h" | 19 #include "testing/gtest/include/gtest/gtest.h" |
| 20 #include "third_party/skia/include/core/SkBitmap.h" | 20 #include "third_party/skia/include/core/SkBitmap.h" |
| 21 #include "ui/gfx/geometry/rect.h" | 21 #include "ui/gfx/geometry/rect.h" |
| 22 #include "ui/gfx/ipc/gfx_param_traits.h" | 22 #include "ui/gfx/ipc/gfx_param_traits.h" |
| 23 #include "ui/gfx/ipc/skia/gfx_skia_param_traits.h" |
| 23 | 24 |
| 24 // Tests std::pair serialization | 25 // Tests std::pair serialization |
| 25 TEST(IPCMessageTest, Pair) { | 26 TEST(IPCMessageTest, Pair) { |
| 26 typedef std::pair<std::string, std::string> TestPair; | 27 typedef std::pair<std::string, std::string> TestPair; |
| 27 | 28 |
| 28 TestPair input("foo", "bar"); | 29 TestPair input("foo", "bar"); |
| 29 IPC::Message msg(1, 2, IPC::Message::PRIORITY_NORMAL); | 30 IPC::Message msg(1, 2, IPC::Message::PRIORITY_NORMAL); |
| 30 IPC::ParamTraits<TestPair>::Write(&msg, input); | 31 IPC::ParamTraits<TestPair>::Write(&msg, input); |
| 31 | 32 |
| 32 TestPair output; | 33 TestPair output; |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 | 140 |
| 140 IPC::Message msg(1, 2, IPC::Message::PRIORITY_NORMAL); | 141 IPC::Message msg(1, 2, IPC::Message::PRIORITY_NORMAL); |
| 141 IPC::ParamTraits<net::HostPortPair>::Write(&msg, input); | 142 IPC::ParamTraits<net::HostPortPair>::Write(&msg, input); |
| 142 | 143 |
| 143 net::HostPortPair output; | 144 net::HostPortPair output; |
| 144 base::PickleIterator iter(msg); | 145 base::PickleIterator iter(msg); |
| 145 EXPECT_TRUE(IPC::ParamTraits<net::HostPortPair>::Read(&msg, &iter, &output)); | 146 EXPECT_TRUE(IPC::ParamTraits<net::HostPortPair>::Read(&msg, &iter, &output)); |
| 146 EXPECT_EQ(input.host(), output.host()); | 147 EXPECT_EQ(input.host(), output.host()); |
| 147 EXPECT_EQ(input.port(), output.port()); | 148 EXPECT_EQ(input.port(), output.port()); |
| 148 } | 149 } |
| OLD | NEW |