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

Side by Side Diff: ipc/ipc_sync_channel_unittest.cc

Issue 2349713003: IPC::MessageFilter::OnFilterAdded: IPC::Sender -> IPC::Channel (Closed)
Patch Set: . Created 4 years, 3 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_proxy_unittest.cc ('k') | ipc/ipc_sync_message_filter.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 #include "ipc/ipc_sync_channel.h" 5 #include "ipc/ipc_sync_channel.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <memory> 9 #include <memory>
10 #include <string> 10 #include <string>
(...skipping 977 matching lines...) Expand 10 before | Expand all | Expand 10 after
988 class TestSyncMessageFilter : public SyncMessageFilter { 988 class TestSyncMessageFilter : public SyncMessageFilter {
989 public: 989 public:
990 TestSyncMessageFilter( 990 TestSyncMessageFilter(
991 base::WaitableEvent* shutdown_event, 991 base::WaitableEvent* shutdown_event,
992 Worker* worker, 992 Worker* worker,
993 scoped_refptr<base::SingleThreadTaskRunner> task_runner) 993 scoped_refptr<base::SingleThreadTaskRunner> task_runner)
994 : SyncMessageFilter(shutdown_event), 994 : SyncMessageFilter(shutdown_event),
995 worker_(worker), 995 worker_(worker),
996 task_runner_(task_runner) {} 996 task_runner_(task_runner) {}
997 997
998 void OnFilterAdded(Sender* sender) override { 998 void OnFilterAdded(Channel* channel) override {
999 SyncMessageFilter::OnFilterAdded(sender); 999 SyncMessageFilter::OnFilterAdded(channel);
1000 task_runner_->PostTask( 1000 task_runner_->PostTask(
1001 FROM_HERE, 1001 FROM_HERE,
1002 base::Bind(&TestSyncMessageFilter::SendMessageOnHelperThread, this)); 1002 base::Bind(&TestSyncMessageFilter::SendMessageOnHelperThread, this));
1003 } 1003 }
1004 1004
1005 void SendMessageOnHelperThread() { 1005 void SendMessageOnHelperThread() {
1006 int answer = 0; 1006 int answer = 0;
1007 bool result = Send(new SyncChannelTestMsg_AnswerToLife(&answer)); 1007 bool result = Send(new SyncChannelTestMsg_AnswerToLife(&answer));
1008 DCHECK(result); 1008 DCHECK(result);
1009 DCHECK_EQ(answer, 42); 1009 DCHECK_EQ(answer, 42);
(...skipping 851 matching lines...) Expand 10 before | Expand all | Expand 10 after
1861 } 1861 }
1862 1862
1863 // Windows needs to send an out-of-band secret to verify the client end of the 1863 // Windows needs to send an out-of-band secret to verify the client end of the
1864 // channel. Test that we still connect correctly in that case. 1864 // channel. Test that we still connect correctly in that case.
1865 TEST_F(IPCSyncChannelTest, Verified) { 1865 TEST_F(IPCSyncChannelTest, Verified) {
1866 Verified(); 1866 Verified();
1867 } 1867 }
1868 1868
1869 } // namespace 1869 } // namespace
1870 } // namespace IPC 1870 } // namespace IPC
OLDNEW
« no previous file with comments | « ipc/ipc_channel_proxy_unittest.cc ('k') | ipc/ipc_sync_message_filter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698