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

Side by Side Diff: content/renderer/render_frame_impl_browsertest.cc

Issue 2910783002: Adds Lo-Fi fallback support for new Data Reduction Proxy protocol. (Closed)
Patch Set: Renamed helper method from Update* to Get* Created 3 years, 6 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
« no previous file with comments | « content/renderer/render_frame_impl.cc ('k') | content/test/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <stdint.h> 5 #include <stdint.h>
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/debug/leak_annotations.h" 8 #include "base/debug/leak_annotations.h"
9 #include "base/run_loop.h" 9 #include "base/run_loop.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after
497 } tests[] = { 497 } tests[] = {
498 // With no previews enabled for the frame, no previews should be 498 // With no previews enabled for the frame, no previews should be
499 // activated. 499 // activated.
500 {PREVIEWS_UNSPECIFIED, false, WebURLRequest::kPreviewsUnspecified, false}, 500 {PREVIEWS_UNSPECIFIED, false, WebURLRequest::kPreviewsUnspecified, false},
501 501
502 // If the request already has a previews state set, then Client Lo-Fi 502 // If the request already has a previews state set, then Client Lo-Fi
503 // should only be used if the request already has that bit set. 503 // should only be used if the request already has that bit set.
504 {CLIENT_LOFI_ON, false, WebURLRequest::kServerLoFiOn, false}, 504 {CLIENT_LOFI_ON, false, WebURLRequest::kServerLoFiOn, false},
505 {PREVIEWS_UNSPECIFIED, false, WebURLRequest::kClientLoFiOn, true}, 505 {PREVIEWS_UNSPECIFIED, false, WebURLRequest::kClientLoFiOn, true},
506 {CLIENT_LOFI_ON, false, WebURLRequest::kClientLoFiOn, true}, 506 {CLIENT_LOFI_ON, false, WebURLRequest::kClientLoFiOn, true},
507 {CLIENT_LOFI_ON | SERVER_LITE_PAGE_ON, true,
508 WebURLRequest::kPreviewsUnspecified, true},
509 {CLIENT_LOFI_ON | SERVER_LITE_PAGE_ON, false,
510 WebURLRequest::kPreviewsUnspecified, true},
507 511
508 // If Client Lo-Fi isn't enabled for the frame, then it shouldn't be used 512 // If Client Lo-Fi isn't enabled for the frame, then it shouldn't be used
509 // for any requests. 513 // for any requests.
510 {SERVER_LOFI_ON, true, WebURLRequest::kPreviewsUnspecified, false}, 514 {SERVER_LOFI_ON, true, WebURLRequest::kPreviewsUnspecified, false},
511 515
512 // SERVER_LITE_PAGE_ON, PREVIEWS_NO_TRANSFORM, and PREVIEWS_OFF should 516 // PREVIEWS_NO_TRANSFORM and PREVIEWS_OFF should take precedence
513 // take precedence over Client Lo-Fi. 517 // over Client Lo-Fi.
514 {CLIENT_LOFI_ON | SERVER_LITE_PAGE_ON, false,
515 WebURLRequest::kPreviewsUnspecified, false},
516 {CLIENT_LOFI_ON | SERVER_LITE_PAGE_ON, true,
517 WebURLRequest::kPreviewsUnspecified, false},
518 {CLIENT_LOFI_ON | PREVIEWS_NO_TRANSFORM, false, 518 {CLIENT_LOFI_ON | PREVIEWS_NO_TRANSFORM, false,
519 WebURLRequest::kPreviewsUnspecified, false}, 519 WebURLRequest::kPreviewsUnspecified, false},
520 {CLIENT_LOFI_ON | PREVIEWS_OFF, false, 520 {CLIENT_LOFI_ON | PREVIEWS_OFF, false,
521 WebURLRequest::kPreviewsUnspecified, false}, 521 WebURLRequest::kPreviewsUnspecified, false},
522 522
523 // If both Server Lo-Fi and Client Lo-Fi are enabled for the frame, then 523 // If both Server Lo-Fi and Client Lo-Fi are enabled for the frame, then
524 // only https:// requests should use Client Lo-Fi. 524 // only https:// requests should use Client Lo-Fi.
525 {CLIENT_LOFI_ON | SERVER_LOFI_ON, false, 525 {CLIENT_LOFI_ON | SERVER_LOFI_ON, false,
526 WebURLRequest::kPreviewsUnspecified, false}, 526 WebURLRequest::kPreviewsUnspecified, false},
527 {CLIENT_LOFI_ON | SERVER_LOFI_ON, true, 527 {CLIENT_LOFI_ON | SERVER_LOFI_ON, true,
(...skipping 13 matching lines...) Expand all
541 GURL(test.is_https ? "https://example.com" : "http://example.com")); 541 GURL(test.is_https ? "https://example.com" : "http://example.com"));
542 request.SetPreviewsState(test.initial_request_previews_state); 542 request.SetPreviewsState(test.initial_request_previews_state);
543 543
544 EXPECT_EQ(test.expected_should_use_client_lo_fi_for_request, 544 EXPECT_EQ(test.expected_should_use_client_lo_fi_for_request,
545 frame()->ShouldUseClientLoFiForRequest(request)) 545 frame()->ShouldUseClientLoFiForRequest(request))
546 << (&test - tests); 546 << (&test - tests);
547 } 547 }
548 } 548 }
549 549
550 } // namespace content 550 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/render_frame_impl.cc ('k') | content/test/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698