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

Unified Diff: third_party/WebKit/Source/core/loader/FrameFetchContextTest.cpp

Issue 2881073003: Support DataSaver for SharedWorker (Closed)
Patch Set: fix #include "public/web/WebDataSaverFlag.h" Created 3 years, 7 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
Index: third_party/WebKit/Source/core/loader/FrameFetchContextTest.cpp
diff --git a/third_party/WebKit/Source/core/loader/FrameFetchContextTest.cpp b/third_party/WebKit/Source/core/loader/FrameFetchContextTest.cpp
index 894c2b5812315bf3b26fc92cdea9b09203a9f494..f0da04703b8adb7884ee5b85c1899ae27e337db5 100644
--- a/third_party/WebKit/Source/core/loader/FrameFetchContextTest.cpp
+++ b/third_party/WebKit/Source/core/loader/FrameFetchContextTest.cpp
@@ -52,6 +52,7 @@
#include "public/platform/WebCachePolicy.h"
#include "public/platform/WebDocumentSubresourceFilter.h"
#include "public/platform/WebInsecureRequestPolicy.h"
+#include "public/web/WebDataSaverFlag.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -790,7 +791,7 @@ TEST_F(FrameFetchContextTest, SetFirstPartyCookieAndRequestorOrigin) {
// Tests if "Save-Data" header is correctly added on the first load and reload.
TEST_F(FrameFetchContextTest, EnableDataSaver) {
Settings* settings = document->GetFrame()->GetSettings();
- settings->SetDataSaverEnabled(true);
+ settings->SetDataSaverFlag(WebDataSaverFlag::kEnabled);
ResourceRequest resource_request("http://www.example.com");
fetch_context->AddAdditionalRequestHeaders(resource_request,
kFetchMainResource);
@@ -814,24 +815,24 @@ TEST_F(FrameFetchContextTest, DisabledDataSaver) {
// Tests if reload variants can reflect the current data saver setting.
TEST_F(FrameFetchContextTest, ChangeDataSaverConfig) {
Settings* settings = document->GetFrame()->GetSettings();
- settings->SetDataSaverEnabled(true);
+ settings->SetDataSaverFlag(WebDataSaverFlag::kEnabled);
ResourceRequest resource_request("http://www.example.com");
fetch_context->AddAdditionalRequestHeaders(resource_request,
kFetchMainResource);
EXPECT_EQ("on", resource_request.HttpHeaderField("Save-Data"));
- settings->SetDataSaverEnabled(false);
+ settings->SetDataSaverFlag(WebDataSaverFlag::kDisabled);
document->Loader()->SetLoadType(kFrameLoadTypeReload);
fetch_context->AddAdditionalRequestHeaders(resource_request,
kFetchMainResource);
EXPECT_EQ(String(), resource_request.HttpHeaderField("Save-Data"));
- settings->SetDataSaverEnabled(true);
+ settings->SetDataSaverFlag(WebDataSaverFlag::kEnabled);
fetch_context->AddAdditionalRequestHeaders(resource_request,
kFetchMainResource);
EXPECT_EQ("on", resource_request.HttpHeaderField("Save-Data"));
- settings->SetDataSaverEnabled(false);
+ settings->SetDataSaverFlag(WebDataSaverFlag::kDisabled);
document->Loader()->SetLoadType(kFrameLoadTypeReload);
fetch_context->AddAdditionalRequestHeaders(resource_request,
kFetchMainResource);

Powered by Google App Engine
This is Rietveld 408576698