| Index: chrome/browser/policy/policy_browsertest.cc
|
| diff --git a/chrome/browser/policy/policy_browsertest.cc b/chrome/browser/policy/policy_browsertest.cc
|
| index 2ee17950679e17b2238980d71f2ca95a5a14dbc6..dfedc2cf49a474836fb581879f222393acc64666 100644
|
| --- a/chrome/browser/policy/policy_browsertest.cc
|
| +++ b/chrome/browser/policy/policy_browsertest.cc
|
| @@ -43,6 +43,7 @@
|
| #include "chrome/browser/media/media_capture_devices_dispatcher.h"
|
| #include "chrome/browser/media/media_stream_devices_controller.h"
|
| #include "chrome/browser/metrics/variations/variations_service.h"
|
| +#include "chrome/browser/net/prediction_options.h"
|
| #include "chrome/browser/net/url_request_mock_util.h"
|
| #include "chrome/browser/plugins/plugin_prefs.h"
|
| #include "chrome/browser/policy/cloud/test_request_interceptor.h"
|
| @@ -376,6 +377,10 @@ bool IsJavascriptEnabled(content::WebContents* contents) {
|
| return result == 123;
|
| }
|
|
|
| +bool IsNetworkPredictionEnabled(PrefService* prefs) {
|
| + return chrome_browser_net::CanPredictNetworkActionsUI(prefs);
|
| +}
|
| +
|
| void CopyPluginListAndQuit(std::vector<content::WebPluginInfo>* out,
|
| const std::vector<content::WebPluginInfo>& in) {
|
| *out = in;
|
| @@ -1917,6 +1922,35 @@ IN_PROC_BROWSER_TEST_F(PolicyTest, Javascript) {
|
| EXPECT_TRUE(IsJavascriptEnabled(contents));
|
| }
|
|
|
| +IN_PROC_BROWSER_TEST_F(PolicyTest, NetworkPrediction) {
|
| + PrefService* prefs = browser()->profile()->GetPrefs();
|
| +
|
| + // Enabled by default.
|
| + EXPECT_TRUE(IsNetworkPredictionEnabled(prefs));
|
| +
|
| + // Disable by old, deprecated policy.
|
| + PolicyMap policies;
|
| + policies.Set(key::kDnsPrefetchingEnabled,
|
| + POLICY_LEVEL_MANDATORY,
|
| + POLICY_SCOPE_USER,
|
| + new base::FundamentalValue(false),
|
| + NULL);
|
| + UpdateProviderPolicy(policies);
|
| +
|
| + EXPECT_FALSE(IsNetworkPredictionEnabled(prefs));
|
| +
|
| + // Enabled by new policy, this should override old one.
|
| + policies.Set(
|
| + key::kNetworkPredictionOptions,
|
| + POLICY_LEVEL_MANDATORY,
|
| + POLICY_SCOPE_USER,
|
| + new base::FundamentalValue(chrome_browser_net::NETWORK_PREDICTION_ALWAYS),
|
| + NULL);
|
| + UpdateProviderPolicy(policies);
|
| +
|
| + EXPECT_TRUE(IsNetworkPredictionEnabled(prefs));
|
| +}
|
| +
|
| IN_PROC_BROWSER_TEST_F(PolicyTest, SavingBrowserHistoryDisabled) {
|
| // Verifies that browsing history is not saved.
|
| PolicyMap policies;
|
|
|