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

Unified Diff: third_party/WebKit/Source/core/html/HTMLMediaElementTest.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/html/HTMLMediaElementTest.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLMediaElementTest.cpp b/third_party/WebKit/Source/core/html/HTMLMediaElementTest.cpp
index 8ef57988df373a2382b9512aba1c5bca1a1372ee..a0f976c3d0610935fd9a172a4a55b5948b575e0d 100644
--- a/third_party/WebKit/Source/core/html/HTMLMediaElementTest.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLMediaElementTest.cpp
@@ -9,6 +9,7 @@
#include "core/html/HTMLVideoElement.h"
#include "core/testing/DummyPageHolder.h"
#include "platform/network/NetworkStateNotifier.h"
+#include "public/web/WebDataSaverFlag.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace blink {
@@ -92,7 +93,7 @@ String SrcSchemeToURL(TestURLScheme scheme) {
TEST_P(HTMLMediaElementTest, preloadType) {
struct TestData {
- bool data_saver_enabled;
+ WebDataSaverFlag data_saver_flag;
bool force_preload_none_for_media_elements;
bool is_cellular;
TestURLScheme src_scheme;
@@ -101,27 +102,39 @@ TEST_P(HTMLMediaElementTest, preloadType) {
} test_data[] = {
// Tests for conditions in which preload type should be overriden to
// "none".
- {false, true, false, TestURLScheme::kHttp, "auto", "none"},
- {true, true, false, TestURLScheme::kHttps, "auto", "none"},
- {true, true, false, TestURLScheme::kFtp, "metadata", "none"},
- {false, false, false, TestURLScheme::kHttps, "auto", "auto"},
- {false, true, false, TestURLScheme::kFile, "auto", "auto"},
- {false, true, false, TestURLScheme::kData, "metadata", "metadata"},
- {false, true, false, TestURLScheme::kBlob, "auto", "auto"},
- {false, true, false, TestURLScheme::kFile, "none", "none"},
+ {WebDataSaverFlag::kDisabled, true, false, TestURLScheme::kHttp, "auto",
+ "none"},
+ {WebDataSaverFlag::kEnabled, true, false, TestURLScheme::kHttps, "auto",
+ "none"},
+ {WebDataSaverFlag::kEnabled, true, false, TestURLScheme::kFtp, "metadata",
+ "none"},
+ {WebDataSaverFlag::kDisabled, false, false, TestURLScheme::kHttps, "auto",
+ "auto"},
+ {WebDataSaverFlag::kDisabled, true, false, TestURLScheme::kFile, "auto",
+ "auto"},
+ {WebDataSaverFlag::kDisabled, true, false, TestURLScheme::kData,
+ "metadata", "metadata"},
+ {WebDataSaverFlag::kDisabled, true, false, TestURLScheme::kBlob, "auto",
+ "auto"},
+ {WebDataSaverFlag::kDisabled, true, false, TestURLScheme::kFile, "none",
+ "none"},
// Tests for conditions in which preload type should be overriden to
// "metadata".
- {false, false, true, TestURLScheme::kHttp, "auto", "metadata"},
- {false, false, true, TestURLScheme::kHttp, "scheme", "metadata"},
- {false, false, true, TestURLScheme::kHttp, "none", "none"},
+ {WebDataSaverFlag::kDisabled, false, true, TestURLScheme::kHttp, "auto",
+ "metadata"},
+ {WebDataSaverFlag::kDisabled, false, true, TestURLScheme::kHttp, "scheme",
+ "metadata"},
+ {WebDataSaverFlag::kDisabled, false, true, TestURLScheme::kHttp, "none",
+ "none"},
// Tests that the preload is overriden to "auto"
- {false, false, false, TestURLScheme::kHttp, "foo", "auto"},
+ {WebDataSaverFlag::kDisabled, false, false, TestURLScheme::kHttp, "foo",
+ "auto"},
};
int index = 0;
for (const auto& data : test_data) {
- Media()->GetDocument().GetSettings()->SetDataSaverEnabled(
- data.data_saver_enabled);
+ Media()->GetDocument().GetSettings()->SetDataSaverFlag(
+ data.data_saver_flag);
Media()->GetDocument().GetSettings()->SetForcePreloadNoneForMediaElements(
data.force_preload_none_for_media_elements);
if (data.is_cellular) {

Powered by Google App Engine
This is Rietveld 408576698