| 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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 WebString::fromUTF8(net::HttpRequestHeaders::kAcceptEncoding)) | 65 WebString::fromUTF8(net::HttpRequestHeaders::kAcceptEncoding)) |
| 66 .utf8(); | 66 .utf8(); |
| 67 return (value.find("identity;q=1") != std::string::npos) && | 67 return (value.find("identity;q=1") != std::string::npos) && |
| 68 (value.find("*;q=0") != std::string::npos); | 68 (value.find("*;q=0") != std::string::npos); |
| 69 } | 69 } |
| 70 | 70 |
| 71 class ResourceMultiBufferDataProviderTest : public testing::Test { | 71 class ResourceMultiBufferDataProviderTest : public testing::Test { |
| 72 public: | 72 public: |
| 73 ResourceMultiBufferDataProviderTest() | 73 ResourceMultiBufferDataProviderTest() |
| 74 : view_(WebView::create(nullptr, blink::WebPageVisibilityStateVisible)) { | 74 : view_(WebView::create(nullptr, blink::WebPageVisibilityStateVisible)) { |
| 75 WebLocalFrame* frame = | 75 WebLocalFrame* frame = WebLocalFrame::create( |
| 76 WebLocalFrame::create(blink::WebTreeScopeType::Document, &client_); | 76 blink::WebTreeScopeType::Document, &client_, nullptr, nullptr); |
| 77 view_->setMainFrame(frame); | 77 view_->setMainFrame(frame); |
| 78 url_index_.reset(new UrlIndex(frame, 0)); | 78 url_index_.reset(new UrlIndex(frame, 0)); |
| 79 | 79 |
| 80 for (int i = 0; i < kDataSize; ++i) { | 80 for (int i = 0; i < kDataSize; ++i) { |
| 81 data_[i] = i; | 81 data_[i] = i; |
| 82 } | 82 } |
| 83 } | 83 } |
| 84 | 84 |
| 85 virtual ~ResourceMultiBufferDataProviderTest() { | 85 virtual ~ResourceMultiBufferDataProviderTest() { |
| 86 view_->close(); | 86 view_->close(); |
| (...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 328 TEST_F(ResourceMultiBufferDataProviderTest, TestRedirects) { | 328 TEST_F(ResourceMultiBufferDataProviderTest, TestRedirects) { |
| 329 // Test redirect. | 329 // Test redirect. |
| 330 Initialize(kHttpUrl, 0); | 330 Initialize(kHttpUrl, 0); |
| 331 Start(); | 331 Start(); |
| 332 Redirect(kHttpRedirect); | 332 Redirect(kHttpRedirect); |
| 333 FullResponse(1024); | 333 FullResponse(1024); |
| 334 StopWhenLoad(); | 334 StopWhenLoad(); |
| 335 } | 335 } |
| 336 | 336 |
| 337 } // namespace media | 337 } // namespace media |
| OLD | NEW |