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/message_loop.h" | 7 #include "base/message_loop.h" |
8 #include "chrome/browser/renderer_host/renderer_security_policy.h" | 8 #include "chrome/browser/renderer_host/renderer_security_policy.h" |
9 #include "chrome/browser/renderer_host/resource_dispatcher_host.h" | 9 #include "chrome/browser/renderer_host/resource_dispatcher_host.h" |
10 #include "chrome/common/chrome_plugin_lib.h" | 10 #include "chrome/common/chrome_plugin_lib.h" |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 | 166 |
167 // The first messages should be received response | 167 // The first messages should be received response |
168 ASSERT_EQ(ViewMsg_Resource_ReceivedResponse::ID, messages[0].type()); | 168 ASSERT_EQ(ViewMsg_Resource_ReceivedResponse::ID, messages[0].type()); |
169 | 169 |
170 // followed by the data, currently we only do the data in one chunk, but | 170 // followed by the data, currently we only do the data in one chunk, but |
171 // should probably test multiple chunks later | 171 // should probably test multiple chunks later |
172 ASSERT_EQ(ViewMsg_Resource_DataReceived::ID, messages[1].type()); | 172 ASSERT_EQ(ViewMsg_Resource_DataReceived::ID, messages[1].type()); |
173 | 173 |
174 void* iter = NULL; | 174 void* iter = NULL; |
175 int request_id; | 175 int request_id; |
176 ASSERT_TRUE(ReadParam(&messages[1], &iter, &request_id)); | 176 ASSERT_TRUE(IPC::ReadParam(&messages[1], &iter, &request_id)); |
177 base::SharedMemoryHandle shm_handle; | 177 base::SharedMemoryHandle shm_handle; |
178 ASSERT_TRUE(ReadParam(&messages[1], &iter, &shm_handle)); | 178 ASSERT_TRUE(IPC::ReadParam(&messages[1], &iter, &shm_handle)); |
179 int data_len; | 179 int data_len; |
180 ASSERT_TRUE(ReadParam(&messages[1], &iter, &data_len)); | 180 ASSERT_TRUE(IPC::ReadParam(&messages[1], &iter, &data_len)); |
181 | 181 |
182 ASSERT_EQ(reference_data.size(), data_len); | 182 ASSERT_EQ(reference_data.size(), data_len); |
183 base::SharedMemory shared_mem(shm_handle, true); // read only | 183 base::SharedMemory shared_mem(shm_handle, true); // read only |
184 shared_mem.Map(data_len); | 184 shared_mem.Map(data_len); |
185 const char* data = static_cast<char*>(shared_mem.memory()); | 185 const char* data = static_cast<char*>(shared_mem.memory()); |
186 ASSERT_EQ(0, memcmp(reference_data.c_str(), data, data_len)); | 186 ASSERT_EQ(0, memcmp(reference_data.c_str(), data, data_len)); |
187 | 187 |
188 // followed by a 0-byte read | 188 // followed by a 0-byte read |
189 //ASSERT_EQ(ViewMsg_Resource_DataReceived::ID, messages[2].type()); | 189 //ASSERT_EQ(ViewMsg_Resource_DataReceived::ID, messages[2].type()); |
190 | 190 |
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
454 MakeTestRequest(0, 0, 1, URLRequestTestJob::test_url_1()); | 454 MakeTestRequest(0, 0, 1, URLRequestTestJob::test_url_1()); |
455 MakeTestRequest(0, 1, 2, URLRequestTestJob::test_url_2()); | 455 MakeTestRequest(0, 1, 2, URLRequestTestJob::test_url_2()); |
456 MakeTestRequest(0, 0, 3, URLRequestTestJob::test_url_3()); | 456 MakeTestRequest(0, 0, 3, URLRequestTestJob::test_url_3()); |
457 MakeTestRequest(1, 1, 4, URLRequestTestJob::test_url_1()); | 457 MakeTestRequest(1, 1, 4, URLRequestTestJob::test_url_1()); |
458 MakeTestRequest(0, 2, 5, URLRequestTestJob::test_url_2()); | 458 MakeTestRequest(0, 2, 5, URLRequestTestJob::test_url_2()); |
459 MakeTestRequest(0, 2, 6, URLRequestTestJob::test_url_3()); | 459 MakeTestRequest(0, 2, 6, URLRequestTestJob::test_url_3()); |
460 | 460 |
461 // Flush all the pending requests. | 461 // Flush all the pending requests. |
462 while (URLRequestTestJob::ProcessOnePendingMessage()); | 462 while (URLRequestTestJob::ProcessOnePendingMessage()); |
463 } | 463 } |
OLD | NEW |