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

Unified Diff: Source/core/fetch/ClientHintsPreferencesTest.cpp

Issue 1183233002: Split RW hint into Width and Viewport-Width (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed and added layout tests 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/fetch/ClientHintsPreferences.cpp ('k') | Source/core/frame/UseCounter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/fetch/ClientHintsPreferencesTest.cpp
diff --git a/Source/core/fetch/ClientHintsPreferencesTest.cpp b/Source/core/fetch/ClientHintsPreferencesTest.cpp
index 3a14759381f24bc10a8c6277063b49d7598ebfc2..de545d911a6e5060bc5988ab2f5328f6ddc4a176 100644
--- a/Source/core/fetch/ClientHintsPreferencesTest.cpp
+++ b/Source/core/fetch/ClientHintsPreferencesTest.cpp
@@ -16,25 +16,26 @@ TEST_F(ClientHintsPreferencesTest, Basic)
{
struct TestCase {
const char* headerValue;
- bool expectationRW;
+ bool expectationResourceWidth;
bool expectationDPR;
+ bool expectationViewportWidth;
} cases[] = {
- {"rw, dpr", true, true},
- {"Rw, dPr", true, true},
- {"RW, DPR", true, true},
- {"dprw", false, false},
- {"DPRW", false, false},
+ {"width, dpr, viewportWidth", true, true, false},
+ {"WiDtH, dPr, viewport-width", true, true, true},
+ {"WIDTH, DPR, VIWEPROT-Width", true, true, false},
+ {"VIewporT-Width, wutwut, width", true, false, true},
+ {"dprw", false, false, false},
+ {"DPRW", false, false, false},
};
- for (auto testCase : cases) {
+ for (const auto& testCase : cases) {
ClientHintsPreferences preferences;
const char* value = testCase.headerValue;
- bool expectationRW = testCase.expectationRW;
- bool expectationDPR = testCase.expectationDPR;
handleAcceptClientHintsHeader(value, preferences);
- EXPECT_EQ(expectationRW, preferences.shouldSendRW());
- EXPECT_EQ(expectationDPR, preferences.shouldSendDPR());
+ EXPECT_EQ(testCase.expectationResourceWidth, preferences.shouldSendResourceWidth());
+ EXPECT_EQ(testCase.expectationDPR, preferences.shouldSendDPR());
+ EXPECT_EQ(testCase.expectationViewportWidth, preferences.shouldSendViewportWidth());
}
}
« no previous file with comments | « Source/core/fetch/ClientHintsPreferences.cpp ('k') | Source/core/frame/UseCounter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698