OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 <vector> | 5 #include <vector> |
6 | 6 |
7 #include "base/file_path.h" | 7 #include "base/file_path.h" |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "base/process_util.h" | 9 #include "base/process_util.h" |
10 #include "chrome/browser/child_process_security_policy.h" | 10 #include "chrome/browser/child_process_security_policy.h" |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 | 140 |
141 DISALLOW_COPY_AND_ASSIGN(ForwardingReceiver); | 141 DISALLOW_COPY_AND_ASSIGN(ForwardingReceiver); |
142 }; | 142 }; |
143 | 143 |
144 class ResourceDispatcherHostTest : public testing::Test, | 144 class ResourceDispatcherHostTest : public testing::Test, |
145 public ResourceDispatcherHost::Receiver { | 145 public ResourceDispatcherHost::Receiver { |
146 public: | 146 public: |
147 ResourceDispatcherHostTest() | 147 ResourceDispatcherHostTest() |
148 : Receiver(ChildProcessInfo::RENDER_PROCESS, -1), | 148 : Receiver(ChildProcessInfo::RENDER_PROCESS, -1), |
149 io_thread_(ChromeThread::IO, &message_loop_), | 149 io_thread_(ChromeThread::IO, &message_loop_), |
150 host_(NULL), | |
151 old_factory_(NULL) { | 150 old_factory_(NULL) { |
152 set_handle(base::GetCurrentProcessHandle()); | 151 set_handle(base::GetCurrentProcessHandle()); |
153 } | 152 } |
154 // ResourceDispatcherHost::Receiver implementation | 153 // ResourceDispatcherHost::Receiver implementation |
155 virtual bool Send(IPC::Message* msg) { | 154 virtual bool Send(IPC::Message* msg) { |
156 accum_.AddMessage(*msg); | 155 accum_.AddMessage(*msg); |
157 delete msg; | 156 delete msg; |
158 return true; | 157 return true; |
159 } | 158 } |
160 | 159 |
(...skipping 709 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
870 | 869 |
871 // Sorts out all the messages we saw by request. | 870 // Sorts out all the messages we saw by request. |
872 ResourceIPCAccumulator::ClassifiedMessages msgs; | 871 ResourceIPCAccumulator::ClassifiedMessages msgs; |
873 accum_.GetClassifiedMessages(&msgs); | 872 accum_.GetClassifiedMessages(&msgs); |
874 ASSERT_EQ(1U, msgs.size()); | 873 ASSERT_EQ(1U, msgs.size()); |
875 | 874 |
876 ResourceResponseHead response_head; | 875 ResourceResponseHead response_head; |
877 GetResponseHead(msgs[0], &response_head); | 876 GetResponseHead(msgs[0], &response_head); |
878 ASSERT_EQ("text/plain", response_head.mime_type); | 877 ASSERT_EQ("text/plain", response_head.mime_type); |
879 } | 878 } |
OLD | NEW |