OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <string.h> | 5 #include <string.h> |
6 #include <utility> | 6 #include <utility> |
7 | 7 |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/values.h" | 9 #include "base/values.h" |
10 #include "content/common/common_param_traits.h" | 10 #include "content/common/common_param_traits.h" |
11 #include "googleurl/src/gurl.h" | 11 #include "googleurl/src/gurl.h" |
12 #include "ipc/ipc_message.h" | 12 #include "ipc/ipc_message.h" |
13 #include "ipc/ipc_message_utils.h" | 13 #include "ipc/ipc_message_utils.h" |
14 #include "net/base/host_port_pair.h" | 14 #include "net/base/host_port_pair.h" |
15 #include "printing/backend/print_backend.h" | 15 #include "printing/backend/print_backend.h" |
16 #include "printing/page_range.h" | 16 #include "printing/page_range.h" |
17 #include "testing/gtest/include/gtest/gtest.h" | 17 #include "testing/gtest/include/gtest/gtest.h" |
18 #include "third_party/skia/include/core/SkBitmap.h" | 18 #include "third_party/skia/include/core/SkBitmap.h" |
19 #include "ui/gfx/rect.h" | 19 #include "ui/gfx/rect.h" |
20 | 20 |
21 #if defined(OS_WIN) | |
22 #include "printing/native_metafile_factory.h" | |
23 #include "printing/native_metafile.h" | |
24 #endif | |
25 | |
26 // Tests that serialize/deserialize correctly understand each other | 21 // Tests that serialize/deserialize correctly understand each other |
27 TEST(IPCMessageTest, Serialize) { | 22 TEST(IPCMessageTest, Serialize) { |
28 const char* serialize_cases[] = { | 23 const char* serialize_cases[] = { |
29 "http://www.google.com/", | 24 "http://www.google.com/", |
30 "http://user:pass@host.com:888/foo;bar?baz#nop", | 25 "http://user:pass@host.com:888/foo;bar?baz#nop", |
31 "#inva://idurl/", | 26 "#inva://idurl/", |
32 }; | 27 }; |
33 | 28 |
34 for (size_t i = 0; i < arraysize(serialize_cases); i++) { | 29 for (size_t i = 0; i < arraysize(serialize_cases); i++) { |
35 GURL input(serialize_cases[i]); | 30 GURL input(serialize_cases[i]); |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 | 177 |
183 IPC::Message msg(1, 2, IPC::Message::PRIORITY_NORMAL); | 178 IPC::Message msg(1, 2, IPC::Message::PRIORITY_NORMAL); |
184 IPC::ParamTraits<net::HostPortPair>::Write(&msg, input); | 179 IPC::ParamTraits<net::HostPortPair>::Write(&msg, input); |
185 | 180 |
186 net::HostPortPair output; | 181 net::HostPortPair output; |
187 void* iter = NULL; | 182 void* iter = NULL; |
188 EXPECT_TRUE(IPC::ParamTraits<net::HostPortPair>::Read(&msg, &iter, &output)); | 183 EXPECT_TRUE(IPC::ParamTraits<net::HostPortPair>::Read(&msg, &iter, &output)); |
189 EXPECT_EQ(input.host(), output.host()); | 184 EXPECT_EQ(input.host(), output.host()); |
190 EXPECT_EQ(input.port(), output.port()); | 185 EXPECT_EQ(input.port(), output.port()); |
191 } | 186 } |
OLD | NEW |