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

Side by Side Diff: Source/core/fetch/ClientHintsPreferencesTest.cpp

Issue 1189523015: Add use-counters for Client-Hints features (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Changed to counting functions Created 5 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 | « Source/core/fetch/ClientHintsPreferences.cpp ('k') | Source/core/fetch/FetchContext.h » ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "config.h" 5 #include "config.h"
6 #include "core/fetch/ClientHintsPreferences.h" 6 #include "core/fetch/ClientHintsPreferences.h"
7 7
8 #include <gtest/gtest.h> 8 #include <gtest/gtest.h>
9 9
10 namespace blink { 10 namespace blink {
(...skipping 14 matching lines...) Expand all
25 {"WIDTH, DPR, VIWEPROT-Width", true, true, false}, 25 {"WIDTH, DPR, VIWEPROT-Width", true, true, false},
26 {"VIewporT-Width, wutwut, width", true, false, true}, 26 {"VIewporT-Width, wutwut, width", true, false, true},
27 {"dprw", false, false, false}, 27 {"dprw", false, false, false},
28 {"DPRW", false, false, false}, 28 {"DPRW", false, false, false},
29 }; 29 };
30 30
31 for (const auto& testCase : cases) { 31 for (const auto& testCase : cases) {
32 ClientHintsPreferences preferences; 32 ClientHintsPreferences preferences;
33 const char* value = testCase.headerValue; 33 const char* value = testCase.headerValue;
34 34
35 handleAcceptClientHintsHeader(value, preferences); 35 handleAcceptClientHintsHeader(value, preferences, nullptr);
36 EXPECT_EQ(testCase.expectationResourceWidth, preferences.shouldSendResou rceWidth()); 36 EXPECT_EQ(testCase.expectationResourceWidth, preferences.shouldSendResou rceWidth());
37 EXPECT_EQ(testCase.expectationDPR, preferences.shouldSendDPR()); 37 EXPECT_EQ(testCase.expectationDPR, preferences.shouldSendDPR());
38 EXPECT_EQ(testCase.expectationViewportWidth, preferences.shouldSendViewp ortWidth()); 38 EXPECT_EQ(testCase.expectationViewportWidth, preferences.shouldSendViewp ortWidth());
39 } 39 }
40 } 40 }
41 41
42 } // namespace blink 42 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/fetch/ClientHintsPreferences.cpp ('k') | Source/core/fetch/FetchContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698