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

Side by Side Diff: ipc/ipc_channel_posix_unittest.cc

Issue 666493005: Standardize usage of virtual/override/final in ipc/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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
« no previous file with comments | « ipc/ipc_channel_posix.h ('k') | ipc/ipc_channel_proxy.h » ('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 // These tests are POSIX only. 5 // These tests are POSIX only.
6 6
7 #include "ipc/ipc_channel_posix.h" 7 #include "ipc/ipc_channel_posix.h"
8 8
9 #include <fcntl.h> 9 #include <fcntl.h>
10 #include <sys/socket.h> 10 #include <sys/socket.h>
(...skipping 27 matching lines...) Expand all
38 CONNECTED, 38 CONNECTED,
39 DENIED, 39 DENIED,
40 LISTEN_ERROR 40 LISTEN_ERROR
41 }; 41 };
42 42
43 IPCChannelPosixTestListener(bool quit_only_on_message) 43 IPCChannelPosixTestListener(bool quit_only_on_message)
44 : status_(DISCONNECTED), 44 : status_(DISCONNECTED),
45 quit_only_on_message_(quit_only_on_message) { 45 quit_only_on_message_(quit_only_on_message) {
46 } 46 }
47 47
48 virtual ~IPCChannelPosixTestListener() {} 48 ~IPCChannelPosixTestListener() override {}
49 49
50 virtual bool OnMessageReceived(const IPC::Message& message) override { 50 bool OnMessageReceived(const IPC::Message& message) override {
51 EXPECT_EQ(message.type(), kQuitMessage); 51 EXPECT_EQ(message.type(), kQuitMessage);
52 status_ = MESSAGE_RECEIVED; 52 status_ = MESSAGE_RECEIVED;
53 QuitRunLoop(); 53 QuitRunLoop();
54 return true; 54 return true;
55 } 55 }
56 56
57 virtual void OnChannelConnected(int32 peer_pid) override { 57 void OnChannelConnected(int32 peer_pid) override {
58 status_ = CONNECTED; 58 status_ = CONNECTED;
59 if (!quit_only_on_message_) { 59 if (!quit_only_on_message_) {
60 QuitRunLoop(); 60 QuitRunLoop();
61 } 61 }
62 } 62 }
63 63
64 virtual void OnChannelError() override { 64 void OnChannelError() override {
65 status_ = CHANNEL_ERROR; 65 status_ = CHANNEL_ERROR;
66 QuitRunLoop(); 66 QuitRunLoop();
67 } 67 }
68 68
69 virtual void OnChannelDenied() override { 69 void OnChannelDenied() override {
70 status_ = DENIED; 70 status_ = DENIED;
71 if (!quit_only_on_message_) { 71 if (!quit_only_on_message_) {
72 QuitRunLoop(); 72 QuitRunLoop();
73 } 73 }
74 } 74 }
75 75
76 virtual void OnChannelListenError() override { 76 void OnChannelListenError() override {
77 status_ = LISTEN_ERROR; 77 status_ = LISTEN_ERROR;
78 if (!quit_only_on_message_) { 78 if (!quit_only_on_message_) {
79 QuitRunLoop(); 79 QuitRunLoop();
80 } 80 }
81 } 81 }
82 82
83 STATUS status() { return status_; } 83 STATUS status() { return status_; }
84 84
85 void QuitRunLoop() { 85 void QuitRunLoop() {
86 base::MessageLoopForIO* loop = base::MessageLoopForIO::current(); 86 base::MessageLoopForIO* loop = base::MessageLoopForIO::current();
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after
477 if (connected) { 477 if (connected) {
478 IPCChannelPosixTest::SpinRunLoop(TestTimeouts::action_max_timeout()); 478 IPCChannelPosixTest::SpinRunLoop(TestTimeouts::action_max_timeout());
479 EXPECT_EQ(IPCChannelPosixTestListener::CHANNEL_ERROR, listener.status()); 479 EXPECT_EQ(IPCChannelPosixTestListener::CHANNEL_ERROR, listener.status());
480 } else { 480 } else {
481 EXPECT_EQ(IPCChannelPosixTestListener::DISCONNECTED, listener.status()); 481 EXPECT_EQ(IPCChannelPosixTestListener::DISCONNECTED, listener.status());
482 } 482 }
483 return 0; 483 return 0;
484 } 484 }
485 485
486 } // namespace 486 } // namespace
OLDNEW
« no previous file with comments | « ipc/ipc_channel_posix.h ('k') | ipc/ipc_channel_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698