| 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 #elif defined(OS_POSIX) | 9 #elif defined(OS_POSIX) |
| 10 #include <sys/types.h> | 10 #include <sys/types.h> |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 TEST_F(IPCChannelTest, BasicMessageTest) { | 133 TEST_F(IPCChannelTest, BasicMessageTest) { |
| 134 int v1 = 10; | 134 int v1 = 10; |
| 135 std::string v2("foobar"); | 135 std::string v2("foobar"); |
| 136 std::wstring v3(L"hello world"); | 136 std::wstring v3(L"hello world"); |
| 137 | 137 |
| 138 IPC::Message m(0, 1, IPC::Message::PRIORITY_NORMAL); | 138 IPC::Message m(0, 1, IPC::Message::PRIORITY_NORMAL); |
| 139 EXPECT_TRUE(m.WriteInt(v1)); | 139 EXPECT_TRUE(m.WriteInt(v1)); |
| 140 EXPECT_TRUE(m.WriteString(v2)); | 140 EXPECT_TRUE(m.WriteString(v2)); |
| 141 EXPECT_TRUE(m.WriteWString(v3)); | 141 EXPECT_TRUE(m.WriteWString(v3)); |
| 142 | 142 |
| 143 void* iter = NULL; | 143 PickleIterator iter(m); |
| 144 | 144 |
| 145 int vi; | 145 int vi; |
| 146 std::string vs; | 146 std::string vs; |
| 147 std::wstring vw; | 147 std::wstring vw; |
| 148 | 148 |
| 149 EXPECT_TRUE(m.ReadInt(&iter, &vi)); | 149 EXPECT_TRUE(m.ReadInt(&iter, &vi)); |
| 150 EXPECT_EQ(v1, vi); | 150 EXPECT_EQ(v1, vi); |
| 151 | 151 |
| 152 EXPECT_TRUE(m.ReadString(&iter, &vs)); | 152 EXPECT_TRUE(m.ReadString(&iter, &vs)); |
| 153 EXPECT_EQ(v2, vs); | 153 EXPECT_EQ(v2, vs); |
| (...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 579 #endif // PERFORMANCE_TEST | 579 #endif // PERFORMANCE_TEST |
| 580 | 580 |
| 581 int main(int argc, char** argv) { | 581 int main(int argc, char** argv) { |
| 582 #ifdef PERFORMANCE_TEST | 582 #ifdef PERFORMANCE_TEST |
| 583 int retval = base::PerfTestSuite(argc, argv).Run(); | 583 int retval = base::PerfTestSuite(argc, argv).Run(); |
| 584 #else | 584 #else |
| 585 int retval = base::TestSuite(argc, argv).Run(); | 585 int retval = base::TestSuite(argc, argv).Run(); |
| 586 #endif | 586 #endif |
| 587 return retval; | 587 return retval; |
| 588 } | 588 } |
| OLD | NEW |