OLD | NEW |
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 Loading... |
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 |
OLD | NEW |