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 "ipc/ipc_message_utils.h" |
| 6 |
5 #include "base/file_path.h" | 7 #include "base/file_path.h" |
6 #include "ipc/ipc_message.h" | 8 #include "ipc/ipc_message.h" |
7 #include "ipc/ipc_message_utils.h" | |
8 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
9 | 10 |
10 using namespace IPC; | 11 namespace IPC { |
11 | |
12 namespace { | 12 namespace { |
13 | 13 |
14 // Tests nesting of messages as parameters to other messages. | 14 // Tests nesting of messages as parameters to other messages. |
15 TEST(IPCMessageUtilsTest, NestedMessages) { | 15 TEST(IPCMessageUtilsTest, NestedMessages) { |
16 int32 nested_routing = 12; | 16 int32 nested_routing = 12; |
17 uint32 nested_type = 78; | 17 uint32 nested_type = 78; |
18 int nested_content = 456789; | 18 int nested_content = 456789; |
19 Message::PriorityValue nested_priority = Message::PRIORITY_HIGH; | 19 Message::PriorityValue nested_priority = Message::PRIORITY_HIGH; |
20 Message nested_msg(nested_routing, nested_type, nested_priority); | 20 Message nested_msg(nested_routing, nested_type, nested_priority); |
21 nested_msg.set_sync(); | 21 nested_msg.set_sync(); |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 ParamTraits<base::FilePath::StringType>::Write(&message, bad_string); | 64 ParamTraits<base::FilePath::StringType>::Write(&message, bad_string); |
65 | 65 |
66 PickleIterator iter(message); | 66 PickleIterator iter(message); |
67 base::FilePath ok_path; | 67 base::FilePath ok_path; |
68 base::FilePath bad_path; | 68 base::FilePath bad_path; |
69 ASSERT_TRUE(ParamTraits<base::FilePath>::Read(&message, &iter, &ok_path)); | 69 ASSERT_TRUE(ParamTraits<base::FilePath>::Read(&message, &iter, &ok_path)); |
70 ASSERT_FALSE(ParamTraits<base::FilePath>::Read(&message, &iter, &bad_path)); | 70 ASSERT_FALSE(ParamTraits<base::FilePath>::Read(&message, &iter, &bad_path)); |
71 } | 71 } |
72 | 72 |
73 } // namespace | 73 } // namespace |
| 74 } // namespace IPC |
OLD | NEW |