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

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: Addressed nits Created 4 years, 9 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 45ecd0a3457d4a13ae7355251007ff30d29b46d9..c8b4b437fb7fb17411290b30b3ac72a07a5c3a01 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)
#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.
« no previous file with comments | « chrome/browser/chrome_content_browser_client.cc ('k') | content/browser/service_worker/embedded_worker_instance.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698