Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/memory/scoped_ptr.h" | 5 #include "base/memory/scoped_ptr.h" |
| 6 #include "base/message_loop.h" | 6 #include "base/message_loop.h" |
| 7 #include "content/browser/browser_thread.h" | 7 #include "content/browser/browser_thread.h" |
| 8 #include "content/browser/renderer_host/global_request_id.h" | 8 #include "content/browser/renderer_host/global_request_id.h" |
| 9 #include "content/browser/renderer_host/resource_dispatcher_host_request_info.h" | 9 #include "content/browser/renderer_host/resource_dispatcher_host_request_info.h" |
| 10 #include "content/browser/renderer_host/resource_handler.h" | 10 #include "content/browser/renderer_host/resource_handler.h" |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 66 } | 66 } |
| 67 | 67 |
| 68 virtual void OnRequestClosed() { | 68 virtual void OnRequestClosed() { |
| 69 } | 69 } |
| 70 | 70 |
| 71 private: | 71 private: |
| 72 DISALLOW_COPY_AND_ASSIGN(DummyResourceHandler); | 72 DISALLOW_COPY_AND_ASSIGN(DummyResourceHandler); |
| 73 }; | 73 }; |
| 74 | 74 |
| 75 ResourceDispatcherHostRequestInfo* GetRequestInfo(int request_id) { | 75 ResourceDispatcherHostRequestInfo* GetRequestInfo(int request_id) { |
| 76 const content::ResourceContext* context = NULL; | |
|
willchan no longer on Chromium
2011/05/10 18:36:56
I recommend MockResourceContext again, but up to y
jam
2011/05/10 19:27:22
Done.
| |
| 76 return new ResourceDispatcherHostRequestInfo( | 77 return new ResourceDispatcherHostRequestInfo( |
| 77 new DummyResourceHandler(), ChildProcessInfo::RENDER_PROCESS, 0, 0, | 78 new DummyResourceHandler(), ChildProcessInfo::RENDER_PROCESS, 0, 0, |
| 78 request_id, ResourceType::MAIN_FRAME, 0, false, false, false); | 79 request_id, ResourceType::MAIN_FRAME, 0, false, false, false, *context); |
| 79 } | 80 } |
| 80 | 81 |
| 81 void InitializeQueue(ResourceQueue* queue, ResourceQueueDelegate* delegate) { | 82 void InitializeQueue(ResourceQueue* queue, ResourceQueueDelegate* delegate) { |
| 82 ResourceQueue::DelegateSet delegate_set; | 83 ResourceQueue::DelegateSet delegate_set; |
| 83 delegate_set.insert(delegate); | 84 delegate_set.insert(delegate); |
| 84 queue->Initialize(delegate_set); | 85 queue->Initialize(delegate_set); |
| 85 } | 86 } |
| 86 | 87 |
| 87 void InitializeQueue(ResourceQueue* queue, | 88 void InitializeQueue(ResourceQueue* queue, |
| 88 ResourceQueueDelegate* delegate1, | 89 ResourceQueueDelegate* delegate1, |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 286 MessageLoop::current()->RunAllPending(); | 287 MessageLoop::current()->RunAllPending(); |
| 287 EXPECT_EQ(0, response_started_count_); | 288 EXPECT_EQ(0, response_started_count_); |
| 288 | 289 |
| 289 queue.Shutdown(); | 290 queue.Shutdown(); |
| 290 | 291 |
| 291 MessageLoop::current()->RunAllPending(); | 292 MessageLoop::current()->RunAllPending(); |
| 292 EXPECT_EQ(0, response_started_count_); | 293 EXPECT_EQ(0, response_started_count_); |
| 293 } | 294 } |
| 294 | 295 |
| 295 } // namespace | 296 } // namespace |
| OLD | NEW |