Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(668)

Side by Side Diff: ipc/ipc_message_utils_unittest.cc

Issue 11865015: Move IPC tests into anonymous namespaces. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ipc/ipc_message_unittest.cc ('k') | ipc/ipc_perftests.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "base/file_path.h" 5 #include "base/file_path.h"
6 #include "ipc/ipc_message.h" 6 #include "ipc/ipc_message.h"
7 #include "ipc/ipc_message_utils.h" 7 #include "ipc/ipc_message_utils.h"
8 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
9 9
10 namespace IPC { 10 using namespace IPC;
11
12 namespace {
11 13
12 // Tests nesting of messages as parameters to other messages. 14 // Tests nesting of messages as parameters to other messages.
13 TEST(IPCMessageUtilsTest, NestedMessages) { 15 TEST(IPCMessageUtilsTest, NestedMessages) {
14 int32 nested_routing = 12; 16 int32 nested_routing = 12;
15 uint32 nested_type = 78; 17 uint32 nested_type = 78;
16 int nested_content = 456789; 18 int nested_content = 456789;
17 Message::PriorityValue nested_priority = Message::PRIORITY_HIGH; 19 Message::PriorityValue nested_priority = Message::PRIORITY_HIGH;
18 Message nested_msg(nested_routing, nested_type, nested_priority); 20 Message nested_msg(nested_routing, nested_type, nested_priority);
19 nested_msg.set_sync(); 21 nested_msg.set_sync();
20 ParamTraits<int>::Write(&nested_msg, nested_content); 22 ParamTraits<int>::Write(&nested_msg, nested_content);
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 FilePath okPath(okString); 61 FilePath okPath(okString);
60 FilePath badPath(badString); 62 FilePath badPath(badString);
61 ParamTraits<FilePath>::Write(&message, okPath); 63 ParamTraits<FilePath>::Write(&message, okPath);
62 ParamTraits<FilePath>::Write(&message, badPath); 64 ParamTraits<FilePath>::Write(&message, badPath);
63 65
64 PickleIterator iter(message); 66 PickleIterator iter(message);
65 ASSERT_TRUE(ParamTraits<FilePath>::Read(&message, &iter, &okPath)); 67 ASSERT_TRUE(ParamTraits<FilePath>::Read(&message, &iter, &okPath));
66 ASSERT_FALSE(ParamTraits<FilePath>::Read(&message, &iter, &badPath)); 68 ASSERT_FALSE(ParamTraits<FilePath>::Read(&message, &iter, &badPath));
67 } 69 }
68 70
69 } // namespace IPC 71 } // namespace
OLDNEW
« no previous file with comments | « ipc/ipc_message_unittest.cc ('k') | ipc/ipc_perftests.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698