| 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 request.httpHeaderField( | 58 request.httpHeaderField( |
| 59 WebString::fromUTF8(net::HttpRequestHeaders::kAcceptEncoding)) | 59 WebString::fromUTF8(net::HttpRequestHeaders::kAcceptEncoding)) |
| 60 .utf8(); | 60 .utf8(); |
| 61 return (value.find("identity;q=1") != std::string::npos) && | 61 return (value.find("identity;q=1") != std::string::npos) && |
| 62 (value.find("*;q=0") != std::string::npos); | 62 (value.find("*;q=0") != std::string::npos); |
| 63 } | 63 } |
| 64 | 64 |
| 65 class ResourceMultiBufferDataProviderTest : public testing::Test { | 65 class ResourceMultiBufferDataProviderTest : public testing::Test { |
| 66 public: | 66 public: |
| 67 ResourceMultiBufferDataProviderTest() | 67 ResourceMultiBufferDataProviderTest() |
| 68 : view_(WebView::create(nullptr)), | 68 : view_(WebView::create(nullptr, true)), |
| 69 frame_(WebLocalFrame::create(blink::WebTreeScopeType::Document, | 69 frame_(WebLocalFrame::create(blink::WebTreeScopeType::Document, |
| 70 &client_)) { | 70 &client_)) { |
| 71 view_->setMainFrame(frame_); | 71 view_->setMainFrame(frame_); |
| 72 url_index_.reset(new UrlIndex(frame_, 0)); | 72 url_index_.reset(new UrlIndex(frame_, 0)); |
| 73 | 73 |
| 74 for (int i = 0; i < kDataSize; ++i) { | 74 for (int i = 0; i < kDataSize; ++i) { |
| 75 data_[i] = i; | 75 data_[i] = i; |
| 76 } | 76 } |
| 77 } | 77 } |
| 78 | 78 |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 322 TEST_F(ResourceMultiBufferDataProviderTest, TestRedirects) { | 322 TEST_F(ResourceMultiBufferDataProviderTest, TestRedirects) { |
| 323 // Test redirect. | 323 // Test redirect. |
| 324 Initialize(kHttpUrl, 0); | 324 Initialize(kHttpUrl, 0); |
| 325 Start(); | 325 Start(); |
| 326 Redirect(kHttpRedirect); | 326 Redirect(kHttpRedirect); |
| 327 FullResponse(1024); | 327 FullResponse(1024); |
| 328 StopWhenLoad(); | 328 StopWhenLoad(); |
| 329 } | 329 } |
| 330 | 330 |
| 331 } // namespace media | 331 } // namespace media |
| OLD | NEW |