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

Side by Side Diff: ipc/ipc_sync_channel_unittest.cc

Issue 324143002: Decouple IPC::MessageFilter from IPC::Channel (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixing compilation errors Created 6 years, 6 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
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 "ipc/ipc_sync_channel.h" 5 #include "ipc/ipc_sync_channel.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 916 matching lines...) Expand 10 before | Expand all | Expand 10 after
927 class TestSyncMessageFilter : public SyncMessageFilter { 927 class TestSyncMessageFilter : public SyncMessageFilter {
928 public: 928 public:
929 TestSyncMessageFilter(base::WaitableEvent* shutdown_event, 929 TestSyncMessageFilter(base::WaitableEvent* shutdown_event,
930 Worker* worker, 930 Worker* worker,
931 scoped_refptr<base::MessageLoopProxy> message_loop) 931 scoped_refptr<base::MessageLoopProxy> message_loop)
932 : SyncMessageFilter(shutdown_event), 932 : SyncMessageFilter(shutdown_event),
933 worker_(worker), 933 worker_(worker),
934 message_loop_(message_loop) { 934 message_loop_(message_loop) {
935 } 935 }
936 936
937 virtual void OnFilterAdded(Channel* channel) OVERRIDE { 937 virtual void OnFilterAdded(Sender* sender) OVERRIDE {
938 SyncMessageFilter::OnFilterAdded(channel); 938 SyncMessageFilter::OnFilterAdded(sender);
939 message_loop_->PostTask( 939 message_loop_->PostTask(
940 FROM_HERE, 940 FROM_HERE,
941 base::Bind(&TestSyncMessageFilter::SendMessageOnHelperThread, this)); 941 base::Bind(&TestSyncMessageFilter::SendMessageOnHelperThread, this));
942 } 942 }
943 943
944 void SendMessageOnHelperThread() { 944 void SendMessageOnHelperThread() {
945 int answer = 0; 945 int answer = 0;
946 bool result = Send(new SyncChannelTestMsg_AnswerToLife(&answer)); 946 bool result = Send(new SyncChannelTestMsg_AnswerToLife(&answer));
947 DCHECK(result); 947 DCHECK(result);
948 DCHECK_EQ(answer, 42); 948 DCHECK_EQ(answer, 42);
(...skipping 837 matching lines...) Expand 10 before | Expand all | Expand 10 after
1786 } 1786 }
1787 1787
1788 // Windows needs to send an out-of-band secret to verify the client end of the 1788 // Windows needs to send an out-of-band secret to verify the client end of the
1789 // channel. Test that we still connect correctly in that case. 1789 // channel. Test that we still connect correctly in that case.
1790 TEST_F(IPCSyncChannelTest, Verified) { 1790 TEST_F(IPCSyncChannelTest, Verified) {
1791 Verified(); 1791 Verified();
1792 } 1792 }
1793 1793
1794 } // namespace 1794 } // namespace
1795 } // namespace IPC 1795 } // namespace IPC
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698