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 <string> | 5 #include <string> |
6 #include <vector> | 6 #include <vector> |
7 | 7 |
8 #include "base/process.h" | 8 #include "base/process.h" |
9 #include "base/scoped_ptr.h" | 9 #include "base/scoped_ptr.h" |
10 #include "chrome/common/filter_policy.h" | 10 #include "chrome/common/filter_policy.h" |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 memcpy(put_data_here, test_page_contents, test_page_contents_len); | 113 memcpy(put_data_here, test_page_contents, test_page_contents_len); |
114 base::SharedMemoryHandle dup_handle; | 114 base::SharedMemoryHandle dup_handle; |
115 EXPECT_TRUE(shared_mem.GiveToProcess( | 115 EXPECT_TRUE(shared_mem.GiveToProcess( |
116 base::Process::Current().handle(), &dup_handle)); | 116 base::Process::Current().handle(), &dup_handle)); |
117 dispatcher_->OnReceivedData( | 117 dispatcher_->OnReceivedData( |
118 message_queue_[0], request_id, dup_handle, test_page_contents_len); | 118 message_queue_[0], request_id, dup_handle, test_page_contents_len); |
119 | 119 |
120 message_queue_.erase(message_queue_.begin()); | 120 message_queue_.erase(message_queue_.begin()); |
121 | 121 |
122 // read the ack message. | 122 // read the ack message. |
123 int request_ack = -1; | 123 Tuple1<int> request_ack; |
124 ASSERT_TRUE(ViewHostMsg_DataReceived_ACK::Read( | 124 ASSERT_TRUE(ViewHostMsg_DataReceived_ACK::Read( |
125 &message_queue_[0], &request_ack)); | 125 &message_queue_[0], &request_ack)); |
126 | 126 |
127 ASSERT_EQ(request_ack, request_id); | 127 ASSERT_EQ(request_ack.a, request_id); |
128 | 128 |
129 message_queue_.erase(message_queue_.begin()); | 129 message_queue_.erase(message_queue_.begin()); |
130 } | 130 } |
131 } | 131 } |
132 | 132 |
133 protected: | 133 protected: |
134 static ResourceDispatcher* GetResourceDispatcher(WebFrame* unused) { | 134 static ResourceDispatcher* GetResourceDispatcher(WebFrame* unused) { |
135 return dispatcher_.get(); | 135 return dispatcher_.get(); |
136 } | 136 } |
137 | 137 |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 // FIXME | 182 // FIXME |
183 } | 183 } |
184 | 184 |
185 TEST_F(ResourceDispatcherTest, Cookies) { | 185 TEST_F(ResourceDispatcherTest, Cookies) { |
186 // FIXME | 186 // FIXME |
187 } | 187 } |
188 | 188 |
189 TEST_F(ResourceDispatcherTest, SerializedPostData) { | 189 TEST_F(ResourceDispatcherTest, SerializedPostData) { |
190 // FIXME | 190 // FIXME |
191 } | 191 } |
OLD | NEW |