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

Unified Diff: chrome/browser/chrome_content_browser_client_unittest.cc

Issue 1708583003: Pass data saver pref value into embedded worker (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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: chrome/browser/chrome_content_browser_client_unittest.cc
diff --git a/chrome/browser/chrome_content_browser_client_unittest.cc b/chrome/browser/chrome_content_browser_client_unittest.cc
index e4b60d6a085d64cbd62bff4ec8bf056e6f89e352..0699121156a0b3a6cca98d973e2090f4ca3574e8 100644
--- a/chrome/browser/chrome_content_browser_client_unittest.cc
+++ b/chrome/browser/chrome_content_browser_client_unittest.cc
@@ -28,6 +28,7 @@
#if !defined(OS_ANDROID) && !defined(OS_IOS)
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
+#include "chrome/common/pref_names.h"
#include "chrome/test/base/browser_with_test_window_test.h"
#include "chrome/test/base/search_test_utils.h"
#endif
@@ -53,6 +54,14 @@ static void DidOpenURLForWindowTest(content::WebContents** target_contents,
*target_contents = opened_contents;
}
+TEST_F(ChromeContentBrowserClientWindowTest, IsDataSaverEnabled) {
+ ChromeContentBrowserClient client;
+ content::BrowserContext* context = browser()->profile();
+ EXPECT_FALSE(client.IsDataSaverEnabled(context));
+ browser()->profile()->GetPrefs()->SetBoolean(prefs::kDataSaverEnabled, true);
+ EXPECT_TRUE(client.IsDataSaverEnabled(context));
+}
+
// This test opens two URLs using ContentBrowserClient::OpenURL. It expects the
// URLs to be opened in new tabs and activated, changing the active tabs after
// each call and increasing the tab count by 2.

Powered by Google App Engine
This is Rietveld 408576698