Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(436)

Side by Side Diff: media/blink/resource_multibuffer_data_provider_unittest.cc

Issue 2714583002: media: Stop sending if-match headers for media fetch requests. (Closed)
Patch Set: update comment Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 const char kHttpRedirect[] = "http://test/ing"; 48 const char kHttpRedirect[] = "http://test/ing";
49 const char kEtag[] = "\"arglebargle glopy-glyf?\""; 49 const char kEtag[] = "\"arglebargle glopy-glyf?\"";
50 50
51 const int kDataSize = 1024; 51 const int kDataSize = 1024;
52 const int kHttpOK = 200; 52 const int kHttpOK = 200;
53 const int kHttpPartialContent = 206; 53 const int kHttpPartialContent = 206;
54 54
55 enum NetworkState { NONE, LOADED, LOADING }; 55 enum NetworkState { NONE, LOADED, LOADING };
56 56
57 // Predicate that tests that request disallows compressed data. 57 // Predicate that tests that request disallows compressed data.
58 static bool CorrectAcceptEncodingAndEtag(const blink::WebURLRequest& request) { 58 // Disabled, see crbug/504194 and crbug/689989 for more information.
59 static bool DIABLED_CorrectAcceptEncodingAndEtag(
DaleCurtis 2017/02/22 22:43:28 Misspelled. I also don't think this works outside
hubbe 2017/02/22 23:13:09 Ops, fixed.
60 const blink::WebURLRequest& request) {
59 std::string etag = 61 std::string etag =
60 request.httpHeaderField(WebString::fromUTF8("If-Match")).utf8(); 62 request.httpHeaderField(WebString::fromUTF8("If-Match")).utf8();
61 EXPECT_EQ(etag, kEtag); 63 EXPECT_EQ(etag, kEtag);
62 64
63 std::string value = 65 std::string value =
64 request.httpHeaderField( 66 request.httpHeaderField(
65 WebString::fromUTF8(net::HttpRequestHeaders::kAcceptEncoding)) 67 WebString::fromUTF8(net::HttpRequestHeaders::kAcceptEncoding))
66 .utf8(); 68 .utf8();
67 return (value.find("identity;q=1") != std::string::npos) && 69 return (value.find("identity;q=1") != std::string::npos) &&
68 (value.find("*;q=0") != std::string::npos); 70 (value.find("*;q=0") != std::string::npos);
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
328 TEST_F(ResourceMultiBufferDataProviderTest, TestRedirects) { 330 TEST_F(ResourceMultiBufferDataProviderTest, TestRedirects) {
329 // Test redirect. 331 // Test redirect.
330 Initialize(kHttpUrl, 0); 332 Initialize(kHttpUrl, 0);
331 Start(); 333 Start();
332 Redirect(kHttpRedirect); 334 Redirect(kHttpRedirect);
333 FullResponse(1024); 335 FullResponse(1024);
334 StopWhenLoad(); 336 StopWhenLoad();
335 } 337 }
336 338
337 } // namespace media 339 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698