OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "media/blink/resource_multibuffer_data_provider.h" | 5 #include "media/blink/resource_multibuffer_data_provider.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 #include <algorithm> | 8 #include <algorithm> |
9 #include <string> | 9 #include <string> |
10 #include <utility> | 10 #include <utility> |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 | 180 |
181 void Redirect(const char* url) { | 181 void Redirect(const char* url) { |
182 GURL redirectUrl(url); | 182 GURL redirectUrl(url); |
183 blink::WebURLRequest newRequest(redirectUrl); | 183 blink::WebURLRequest newRequest(redirectUrl); |
184 blink::WebURLResponse redirectResponse(gurl_); | 184 blink::WebURLResponse redirectResponse(gurl_); |
185 | 185 |
186 EXPECT_CALL(*this, RedirectCallback(_)) | 186 EXPECT_CALL(*this, RedirectCallback(_)) |
187 .WillOnce( | 187 .WillOnce( |
188 Invoke(this, &ResourceMultiBufferDataProviderTest::SetUrlData)); | 188 Invoke(this, &ResourceMultiBufferDataProviderTest::SetUrlData)); |
189 | 189 |
190 loader_->willFollowRedirect(url_loader_, newRequest, redirectResponse, 0); | 190 loader_->willFollowRedirect(url_loader_, newRequest, redirectResponse); |
191 | 191 |
192 base::RunLoop().RunUntilIdle(); | 192 base::RunLoop().RunUntilIdle(); |
193 } | 193 } |
194 | 194 |
195 void StopWhenLoad() { | 195 void StopWhenLoad() { |
196 InSequence s; | 196 InSequence s; |
197 EXPECT_CALL(*url_loader_, cancel()); | 197 EXPECT_CALL(*url_loader_, cancel()); |
198 loader_ = nullptr; | 198 loader_ = nullptr; |
199 url_data_ = nullptr; | 199 url_data_ = nullptr; |
200 } | 200 } |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
331 TEST_F(ResourceMultiBufferDataProviderTest, TestRedirects) { | 331 TEST_F(ResourceMultiBufferDataProviderTest, TestRedirects) { |
332 // Test redirect. | 332 // Test redirect. |
333 Initialize(kHttpUrl, 0); | 333 Initialize(kHttpUrl, 0); |
334 Start(); | 334 Start(); |
335 Redirect(kHttpRedirect); | 335 Redirect(kHttpRedirect); |
336 FullResponse(1024); | 336 FullResponse(1024); |
337 StopWhenLoad(); | 337 StopWhenLoad(); |
338 } | 338 } |
339 | 339 |
340 } // namespace media | 340 } // namespace media |
OLD | NEW |