OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "content/child/web_url_loader_impl.h" | 5 #include "content/child/web_url_loader_impl.h" |
6 | 6 |
7 #include <string.h> | 7 #include <string.h> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
11 #include "base/macros.h" | 11 #include "base/macros.h" |
12 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
13 #include "base/message_loop/message_loop.h" | 13 #include "base/message_loop/message_loop.h" |
14 #include "base/single_thread_task_runner.h" | 14 #include "base/single_thread_task_runner.h" |
15 #include "base/time/time.h" | 15 #include "base/time/time.h" |
| 16 #include "components/scheduler/child/web_task_runner_impl.h" |
16 #include "content/child/request_extra_data.h" | 17 #include "content/child/request_extra_data.h" |
17 #include "content/child/request_info.h" | 18 #include "content/child/request_info.h" |
18 #include "content/child/resource_dispatcher.h" | 19 #include "content/child/resource_dispatcher.h" |
19 #include "content/public/child/fixed_received_data.h" | 20 #include "content/public/child/fixed_received_data.h" |
20 #include "content/public/child/request_peer.h" | 21 #include "content/public/child/request_peer.h" |
21 #include "content/public/common/content_switches.h" | 22 #include "content/public/common/content_switches.h" |
22 #include "content/public/common/resource_response_info.h" | 23 #include "content/public/common/resource_response_info.h" |
23 #include "net/base/net_errors.h" | 24 #include "net/base/net_errors.h" |
24 #include "net/http/http_response_headers.h" | 25 #include "net/http/http_response_headers.h" |
25 #include "net/http/http_util.h" | 26 #include "net/http/http_util.h" |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 GURL url_; | 100 GURL url_; |
100 | 101 |
101 DISALLOW_COPY_AND_ASSIGN(TestResourceDispatcher); | 102 DISALLOW_COPY_AND_ASSIGN(TestResourceDispatcher); |
102 }; | 103 }; |
103 | 104 |
104 class TestWebURLLoaderClient : public blink::WebURLLoaderClient { | 105 class TestWebURLLoaderClient : public blink::WebURLLoaderClient { |
105 public: | 106 public: |
106 TestWebURLLoaderClient( | 107 TestWebURLLoaderClient( |
107 ResourceDispatcher* dispatcher, | 108 ResourceDispatcher* dispatcher, |
108 scoped_refptr<base::SingleThreadTaskRunner> task_runner) | 109 scoped_refptr<base::SingleThreadTaskRunner> task_runner) |
109 : loader_(new WebURLLoaderImpl(dispatcher, task_runner)), | 110 : loader_( |
| 111 new WebURLLoaderImpl( |
| 112 dispatcher, |
| 113 make_scoped_ptr(new scheduler::WebTaskRunnerImpl(task_runner)))), |
110 expect_multipart_response_(false), | 114 expect_multipart_response_(false), |
111 delete_on_receive_redirect_(false), | 115 delete_on_receive_redirect_(false), |
112 delete_on_receive_response_(false), | 116 delete_on_receive_response_(false), |
113 delete_on_receive_data_(false), | 117 delete_on_receive_data_(false), |
114 delete_on_finish_(false), | 118 delete_on_finish_(false), |
115 delete_on_fail_(false), | 119 delete_on_fail_(false), |
116 did_receive_redirect_(false), | 120 did_receive_redirect_(false), |
117 did_receive_response_(false), | 121 did_receive_response_(false), |
118 did_finish_(false) {} | 122 did_finish_(false) {} |
119 | 123 |
(...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
707 EXPECT_EQ(kMimeType, client()->response().mimeType().latin1()); | 711 EXPECT_EQ(kMimeType, client()->response().mimeType().latin1()); |
708 | 712 |
709 DoReceiveData(); | 713 DoReceiveData(); |
710 DoCompleteRequest(); | 714 DoCompleteRequest(); |
711 EXPECT_FALSE(dispatcher()->canceled()); | 715 EXPECT_FALSE(dispatcher()->canceled()); |
712 EXPECT_EQ(kTestData, client()->received_data()); | 716 EXPECT_EQ(kTestData, client()->received_data()); |
713 } | 717 } |
714 | 718 |
715 } // namespace | 719 } // namespace |
716 } // namespace content | 720 } // namespace content |
OLD | NEW |