| 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 "build/build_config.h" | 5 #include "build/build_config.h" |
| 6 | 6 |
| 7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
| 8 #include <windows.h> | 8 #include <windows.h> |
| 9 #endif | 9 #endif |
| 10 | 10 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 TEST_F(IPCChannelTest, BasicMessageTest) { | 27 TEST_F(IPCChannelTest, BasicMessageTest) { |
| 28 int v1 = 10; | 28 int v1 = 10; |
| 29 std::string v2("foobar"); | 29 std::string v2("foobar"); |
| 30 base::string16 v3(base::ASCIIToUTF16("hello world")); | 30 base::string16 v3(base::ASCIIToUTF16("hello world")); |
| 31 | 31 |
| 32 IPC::Message m(0, 1, IPC::Message::PRIORITY_NORMAL); | 32 IPC::Message m(0, 1, IPC::Message::PRIORITY_NORMAL); |
| 33 EXPECT_TRUE(m.WriteInt(v1)); | 33 EXPECT_TRUE(m.WriteInt(v1)); |
| 34 EXPECT_TRUE(m.WriteString(v2)); | 34 EXPECT_TRUE(m.WriteString(v2)); |
| 35 EXPECT_TRUE(m.WriteString16(v3)); | 35 EXPECT_TRUE(m.WriteString16(v3)); |
| 36 | 36 |
| 37 PickleIterator iter(m); | 37 base::PickleIterator iter(m); |
| 38 | 38 |
| 39 int vi; | 39 int vi; |
| 40 std::string vs; | 40 std::string vs; |
| 41 base::string16 vs16; | 41 base::string16 vs16; |
| 42 | 42 |
| 43 EXPECT_TRUE(iter.ReadInt(&vi)); | 43 EXPECT_TRUE(iter.ReadInt(&vi)); |
| 44 EXPECT_EQ(v1, vi); | 44 EXPECT_EQ(v1, vi); |
| 45 | 45 |
| 46 EXPECT_TRUE(iter.ReadString(&vs)); | 46 EXPECT_TRUE(iter.ReadString(&vs)); |
| 47 EXPECT_EQ(v2, vs); | 47 EXPECT_EQ(v2, vs); |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 &listener)); | 194 &listener)); |
| 195 CHECK(channel->Connect()); | 195 CHECK(channel->Connect()); |
| 196 listener.Init(channel.get()); | 196 listener.Init(channel.get()); |
| 197 IPC::TestChannelListener::SendOneMessage(channel.get(), "hello from child"); | 197 IPC::TestChannelListener::SendOneMessage(channel.get(), "hello from child"); |
| 198 | 198 |
| 199 base::MessageLoop::current()->Run(); | 199 base::MessageLoop::current()->Run(); |
| 200 return 0; | 200 return 0; |
| 201 } | 201 } |
| 202 | 202 |
| 203 } // namespace | 203 } // namespace |
| OLD | NEW |