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

Unified Diff: chrome/browser/chromeos/proxy_config_service_impl_unittest.cc

Issue 14846004: Migrate ProxyConfigServiceImpl to NetworkStateHandler and NetworkProfileHandler. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Renamed ConfigStateToString. Created 7 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: chrome/browser/chromeos/proxy_config_service_impl_unittest.cc
diff --git a/chrome/browser/chromeos/proxy_config_service_impl_unittest.cc b/chrome/browser/chromeos/proxy_config_service_impl_unittest.cc
index 614c8c769cf5a3922268010544853bb7e4a87ab3..2eaf4579b1a45bc96d17ce491cccd66aa8e8c79b 100644
--- a/chrome/browser/chromeos/proxy_config_service_impl_unittest.cc
+++ b/chrome/browser/chromeos/proxy_config_service_impl_unittest.cc
@@ -4,24 +4,27 @@
#include "chrome/browser/chromeos/proxy_config_service_impl.h"
-#include <map>
-#include <string>
#include <vector>
#include "base/format_macros.h"
+#include "base/json/json_writer.h"
#include "base/logging.h"
#include "base/message_loop.h"
#include "base/prefs/testing_pref_service.h"
-#include "base/string_util.h"
#include "base/stringprintf.h"
-#include "chrome/browser/chromeos/cros/cros_library.h"
#include "chrome/browser/chromeos/settings/cros_settings.h"
#include "chrome/browser/chromeos/settings/device_settings_service.h"
#include "chrome/common/pref_names.h"
#include "chromeos/dbus/dbus_thread_manager.h"
+#include "chromeos/dbus/shill_profile_client.h"
+#include "chromeos/dbus/shill_service_client.h"
+#include "chromeos/network/network_profile_handler.h"
+#include "chromeos/network/network_state.h"
+#include "chromeos/network/network_state_handler.h"
#include "content/public/test/test_browser_thread.h"
#include "net/proxy/proxy_config_service_common_unittest.h"
#include "testing/gtest/include/gtest/gtest.h"
+#include "third_party/cros_system_api/dbus/service_constants.h"
using content::BrowserThread;
@@ -29,32 +32,24 @@ namespace chromeos {
namespace {
-struct Input { // Fields of chromeos::ProxyConfigServiceImpl::ProxyConfig.
- ProxyConfigServiceImpl::ProxyConfig::Mode mode;
- const char* pac_url;
- const char* single_uri;
- const char* http_uri;
- const char* https_uri;
- const char* ftp_uri;
- const char* socks_uri;
- const char* bypass_rules;
+struct Input {
+ UIProxyConfig::Mode mode;
+ std::string pac_url;
+ std::string server;
+ std::string bypass_rules;
};
// Builds an identifier for each test in an array.
#define TEST_DESC(desc) base::StringPrintf("at line %d <%s>", __LINE__, desc)
// Shortcuts to declare enums within chromeos's ProxyConfig.
-#define MK_MODE(mode) ProxyConfigServiceImpl::ProxyConfig::MODE_##mode
-#define MK_SCHM(scheme) net::ProxyServer::SCHEME_##scheme
-#define MK_AVAIL(avail) net::ProxyConfigService::CONFIG_##avail
+#define MK_MODE(mode) UIProxyConfig::MODE_##mode
// Inspired from net/proxy/proxy_config_service_linux_unittest.cc.
const struct TestParams {
// Short description to identify the test
std::string description;
- bool is_valid;
-
Input input;
// Expected outputs from fields of net::ProxyConfig (via IO).
@@ -65,8 +60,6 @@ const struct TestParams {
{ // 0
TEST_DESC("No proxying"),
- true, // is_valid
-
{ // Input.
MK_MODE(DIRECT), // mode
},
@@ -80,8 +73,6 @@ const struct TestParams {
{ // 1
TEST_DESC("Auto detect"),
- true, // is_valid
-
{ // Input.
MK_MODE(AUTO_DETECT), // mode
},
@@ -95,8 +86,6 @@ const struct TestParams {
{ // 2
TEST_DESC("Valid PAC URL"),
- true, // is_valid
-
{ // Input.
MK_MODE(PAC_SCRIPT), // mode
"http://wpad/wpad.dat", // pac_url
@@ -111,8 +100,6 @@ const struct TestParams {
{ // 3
TEST_DESC("Invalid PAC URL"),
- false, // is_valid
-
{ // Input.
MK_MODE(PAC_SCRIPT), // mode
"wpad.dat", // pac_url
@@ -127,12 +114,10 @@ const struct TestParams {
{ // 4
TEST_DESC("Single-host in proxy list"),
- true, // is_valid
-
{ // Input.
MK_MODE(SINGLE_PROXY), // mode
- NULL, // pac_url
- "www.google.com", // single_uri
+ "", // pac_url
+ "www.google.com", // server
},
// Expected result.
@@ -146,12 +131,10 @@ const struct TestParams {
{ // 5
TEST_DESC("Single-host, different port"),
- true, // is_valid
-
{ // Input.
MK_MODE(SINGLE_PROXY), // mode
- NULL, // pac_url
- "www.google.com:99", // single_uri
+ "", // pac_url
+ "www.google.com:99", // server
},
// Expected result.
@@ -165,12 +148,10 @@ const struct TestParams {
{ // 6
TEST_DESC("Tolerate a scheme"),
- true, // is_valid
-
{ // Input.
MK_MODE(SINGLE_PROXY), // mode
- NULL, // pac_url
- "http://www.google.com:99", // single_uri
+ "", // pac_url
+ "http://www.google.com:99", // server
},
// Expected result.
@@ -184,16 +165,11 @@ const struct TestParams {
{ // 7
TEST_DESC("Per-scheme proxy rules"),
- true, // is_valid
-
{ // Input.
MK_MODE(PROXY_PER_SCHEME), // mode
- NULL, // pac_url
- NULL, // single_uri
- "www.google.com:80", // http_uri
- "www.foo.com:110", // https_uri
- "ftp.foo.com:121", // ftp_uri
- "socks.com:888", // socks_uri
+ "", // pac_url
+ "http=www.google.com:80;https=https://www.foo.com:110;"
+ "ftp=ftp.foo.com:121;socks=socks5://socks.com:888", // server
},
// Expected result.
@@ -210,13 +186,10 @@ const struct TestParams {
{ // 8
TEST_DESC("Bypass rules"),
- true, // is_valid
-
{ // Input.
MK_MODE(SINGLE_PROXY), // mode
- NULL, // pac_url
- "www.google.com", // single_uri
- NULL, NULL, NULL, NULL, // per-proto
+ "", // pac_url
+ "www.google.com", // server
"*.google.com, *foo.com:99, 1.2.3.4:22, 127.0.0.1/8", // bypass_rules
},
@@ -230,20 +203,27 @@ const struct TestParams {
},
}; // tests
-template<typename TESTBASE>
-class ProxyConfigServiceImplTestBase : public TESTBASE {
+const char* kUserProfilePath = "user_profile";
+
+} // namespace
+
+class ProxyConfigServiceImplTest : public testing::Test {
protected:
- ProxyConfigServiceImplTestBase()
+ ProxyConfigServiceImplTest()
: ui_thread_(BrowserThread::UI, &loop_),
io_thread_(BrowserThread::IO, &loop_) {}
- virtual void Init(TestingPrefServiceSimple* pref_service) {
- ASSERT_TRUE(pref_service);
- DBusThreadManager::Initialize();
- PrefProxyConfigTrackerImpl::RegisterPrefs(pref_service->registry());
- ProxyConfigServiceImpl::RegisterPrefs(pref_service->registry());
+ virtual void SetUp() {
+ DBusThreadManager::InitializeWithStub();
+ NetworkStateHandler::Initialize();
+ NetworkProfileHandler::Initialize();
+
+ SetUpNetwork();
+
+ PrefProxyConfigTrackerImpl::RegisterPrefs(pref_service_.registry());
+ ProxyConfigServiceImpl::RegisterPrefs(pref_service_.registry());
proxy_config_service_.reset(new ChromeProxyConfigService(NULL));
- config_service_impl_.reset(new ProxyConfigServiceImpl(pref_service));
+ config_service_impl_.reset(new ProxyConfigServiceImpl(&pref_service_));
config_service_impl_->SetChromeProxyConfigService(
proxy_config_service_.get());
// SetChromeProxyConfigService triggers update of initial prefs proxy
@@ -252,112 +232,116 @@ class ProxyConfigServiceImplTestBase : public TESTBASE {
loop_.RunUntilIdle();
}
+ void SetUpNetwork() {
+ ShillProfileClient::TestInterface* profile_test =
+ DBusThreadManager::Get()->GetShillProfileClient()->GetTestInterface();
+ ShillServiceClient::TestInterface* service_test =
+ DBusThreadManager::Get()->GetShillServiceClient()->GetTestInterface();
+
+ service_test->ClearServices();
+
+ // Sends a notification about the added profile.
+ profile_test->AddProfile(kUserProfilePath, "user_hash");
+
+ service_test->AddService("stub_wifi2", "wifi2_PSK",
+ flimflam::kTypeWifi, flimflam::kStateOnline,
+ true /* add to watchlist */);
+ service_test->SetServiceProperty("stub_wifi2",
+ flimflam::kGuidProperty,
+ base::StringValue("stub_wifi2"));
+ service_test->SetServiceProperty("stub_wifi2",
+ flimflam::kProfileProperty,
+ base::StringValue(kUserProfilePath));
+ profile_test->AddService("stub_wifi2");
+
+ loop_.RunUntilIdle();
+ }
+
virtual void TearDown() {
config_service_impl_->DetachFromPrefService();
loop_.RunUntilIdle();
config_service_impl_.reset();
proxy_config_service_.reset();
+ NetworkProfileHandler::Shutdown();
+ NetworkStateHandler::Shutdown();
DBusThreadManager::Shutdown();
}
- void SetAutomaticProxy(
- ProxyConfigServiceImpl::ProxyConfig::Mode mode,
- const char* pac_url,
- ProxyConfigServiceImpl::ProxyConfig* config,
- ProxyConfigServiceImpl::ProxyConfig::AutomaticProxy* automatic_proxy) {
- config->mode = mode;
- config->state = ProxyPrefs::CONFIG_SYSTEM;
- if (pac_url)
- automatic_proxy->pac_url = GURL(pac_url);
- }
-
- void SetManualProxy(
- ProxyConfigServiceImpl::ProxyConfig::Mode mode,
- const char* server_uri,
- net::ProxyServer::Scheme scheme,
- ProxyConfigServiceImpl::ProxyConfig* config,
- ProxyConfigServiceImpl::ProxyConfig::ManualProxy* manual_proxy) {
- if (!server_uri)
- return;
- config->mode = mode;
- config->state = ProxyPrefs::CONFIG_SYSTEM;
- manual_proxy->server = net::ProxyServer::FromURI(server_uri, scheme);
- }
-
- void InitConfigWithTestInput(
- const Input& input, ProxyConfigServiceImpl::ProxyConfig* test_config) {
+ void InitConfigWithTestInput(const Input& input,
+ base::DictionaryValue* result) {
+ base::DictionaryValue* new_config = NULL;
switch (input.mode) {
case MK_MODE(DIRECT):
+ new_config = ProxyConfigDictionary::CreateDirect();
+ break;
case MK_MODE(AUTO_DETECT):
+ new_config = ProxyConfigDictionary::CreateAutoDetect();
+ break;
case MK_MODE(PAC_SCRIPT):
- SetAutomaticProxy(input.mode, input.pac_url, test_config,
- &test_config->automatic_proxy);
- return;
- case MK_MODE(SINGLE_PROXY):
- SetManualProxy(input.mode, input.single_uri, MK_SCHM(HTTP),
- test_config, &test_config->single_proxy);
+ new_config =
+ ProxyConfigDictionary::CreatePacScript(input.pac_url, false);
break;
+ case MK_MODE(SINGLE_PROXY):
case MK_MODE(PROXY_PER_SCHEME):
- SetManualProxy(input.mode, input.http_uri, MK_SCHM(HTTP),
- test_config, &test_config->http_proxy);
- SetManualProxy(input.mode, input.https_uri, MK_SCHM(HTTPS),
- test_config, &test_config->https_proxy);
- SetManualProxy(input.mode, input.ftp_uri, MK_SCHM(HTTP),
- test_config, &test_config->ftp_proxy);
- SetManualProxy(input.mode, input.socks_uri, MK_SCHM(SOCKS5),
- test_config, &test_config->socks_proxy);
+ new_config =
+ ProxyConfigDictionary::CreateFixedServers(input.server,
+ input.bypass_rules);
break;
}
- if (input.bypass_rules)
- test_config->bypass_rules.ParseFromString(input.bypass_rules);
+ result->Swap(new_config);
+ delete new_config;
+ }
+
+ void SetConfig(base::DictionaryValue* pref_proxy_config_dict) {
+ std::string proxy_config;
+ if (pref_proxy_config_dict)
+ base::JSONWriter::Write(pref_proxy_config_dict, &proxy_config);
+
+ NetworkStateHandler* network_state_handler = NetworkStateHandler::Get();
+ const NetworkState* network = network_state_handler->DefaultNetwork();
+ ASSERT_TRUE(network);
+ DBusThreadManager::Get()->GetShillServiceClient()->GetTestInterface()->
+ SetServiceProperty(network->path(),
+ flimflam::kProxyConfigProperty,
+ StringValue(proxy_config));
}
// Synchronously gets the latest proxy config.
- net::ProxyConfigService::ConfigAvailability SyncGetLatestProxyConfig(
- net::ProxyConfig* config) {
+ void SyncGetLatestProxyConfig(net::ProxyConfig* config) {
*config = net::ProxyConfig();
- // Let message loop process all messages.
+ // Let message loop process all messages. This will run
+ // ChromeProxyConfigService::UpdateProxyConfig, which is posted on IO from
+ // PrefProxyConfigTrackerImpl::OnProxyConfigChanged.
loop_.RunUntilIdle();
- // Calls ChromeProIOGetProxyConfig (which is called from
- // ProxyConfigService::GetLatestProxyConfig), running on faked IO thread.
- return proxy_config_service_->GetLatestProxyConfig(config);
+ net::ProxyConfigService::ConfigAvailability availability =
+ proxy_config_service_->GetLatestProxyConfig(config);
+
+ EXPECT_EQ(net::ProxyConfigService::CONFIG_VALID, availability);
}
MessageLoop loop_;
scoped_ptr<ChromeProxyConfigService> proxy_config_service_;
scoped_ptr<ProxyConfigServiceImpl> config_service_impl_;
+ TestingPrefServiceSimple pref_service_;
private:
- // Default stub state has ethernet as the active connected network and
- // PROFILE_SHARED as profile type, which this unittest expects.
- ScopedStubCrosEnabler stub_cros_enabler_;
ScopedTestDeviceSettingsService test_device_settings_service_;
ScopedTestCrosSettings test_cros_settings_;
content::TestBrowserThread ui_thread_;
content::TestBrowserThread io_thread_;
};
-class ProxyConfigServiceImplTest
- : public ProxyConfigServiceImplTestBase<testing::Test> {
- protected:
- virtual void SetUp() {
- Init(&pref_service_);
- }
-
- TestingPrefServiceSimple pref_service_;
-};
-
TEST_F(ProxyConfigServiceImplTest, NetworkProxy) {
for (size_t i = 0; i < ARRAYSIZE_UNSAFE(tests); ++i) {
SCOPED_TRACE(base::StringPrintf("Test[%" PRIuS "] %s", i,
- tests[i].description.c_str()));
+ tests[i].description.c_str()));
- ProxyConfigServiceImpl::ProxyConfig test_config;
+ base::DictionaryValue test_config;
InitConfigWithTestInput(tests[i].input, &test_config);
- config_service_impl_->SetTesting(&test_config);
+ SetConfig(&test_config);
net::ProxyConfig config;
- EXPECT_EQ(MK_AVAIL(VALID), SyncGetLatestProxyConfig(&config));
+ SyncGetLatestProxyConfig(&config);
EXPECT_EQ(tests[i].auto_detect, config.auto_detect());
EXPECT_EQ(tests[i].pac_url, config.pac_url());
@@ -365,99 +349,6 @@ TEST_F(ProxyConfigServiceImplTest, NetworkProxy) {
}
}
-TEST_F(ProxyConfigServiceImplTest, ModifyFromUI) {
- for (size_t i = 0; i < ARRAYSIZE_UNSAFE(tests); ++i) {
- SCOPED_TRACE(base::StringPrintf("Test[%" PRIuS "] %s", i,
- tests[i].description.c_str()));
-
- // Init with direct.
- ProxyConfigServiceImpl::ProxyConfig test_config;
- SetAutomaticProxy(MK_MODE(DIRECT), NULL, &test_config,
- &test_config.automatic_proxy);
- config_service_impl_->SetTesting(&test_config);
-
- // Set config to tests[i].input via UI.
- net::ProxyBypassRules bypass_rules;
- const Input& input = tests[i].input;
- switch (input.mode) {
- case MK_MODE(DIRECT) :
- config_service_impl_->UISetProxyConfigToDirect();
- break;
- case MK_MODE(AUTO_DETECT) :
- config_service_impl_->UISetProxyConfigToAutoDetect();
- break;
- case MK_MODE(PAC_SCRIPT) :
- config_service_impl_->UISetProxyConfigToPACScript(GURL(input.pac_url));
- break;
- case MK_MODE(SINGLE_PROXY) :
- config_service_impl_->UISetProxyConfigToSingleProxy(
- net::ProxyServer::FromURI(input.single_uri, MK_SCHM(HTTP)));
- if (input.bypass_rules) {
- bypass_rules.ParseFromString(input.bypass_rules);
- config_service_impl_->UISetProxyConfigBypassRules(bypass_rules);
- }
- break;
- case MK_MODE(PROXY_PER_SCHEME) :
- if (input.http_uri) {
- config_service_impl_->UISetProxyConfigToProxyPerScheme("http",
- net::ProxyServer::FromURI(input.http_uri, MK_SCHM(HTTP)));
- }
- if (input.https_uri) {
- config_service_impl_->UISetProxyConfigToProxyPerScheme("https",
- net::ProxyServer::FromURI(input.https_uri, MK_SCHM(HTTPS)));
- }
- if (input.ftp_uri) {
- config_service_impl_->UISetProxyConfigToProxyPerScheme("ftp",
- net::ProxyServer::FromURI(input.ftp_uri, MK_SCHM(HTTP)));
- }
- if (input.socks_uri) {
- config_service_impl_->UISetProxyConfigToProxyPerScheme("socks",
- net::ProxyServer::FromURI(input.socks_uri, MK_SCHM(SOCKS5)));
- }
- if (input.bypass_rules) {
- bypass_rules.ParseFromString(input.bypass_rules);
- config_service_impl_->UISetProxyConfigBypassRules(bypass_rules);
- }
- break;
- }
-
- // Retrieve config from IO thread.
- net::ProxyConfig io_config;
- EXPECT_EQ(MK_AVAIL(VALID), SyncGetLatestProxyConfig(&io_config));
- EXPECT_EQ(tests[i].auto_detect, io_config.auto_detect());
- EXPECT_EQ(tests[i].pac_url, io_config.pac_url());
- EXPECT_TRUE(tests[i].proxy_rules.Matches(io_config.proxy_rules()));
-
- // Retrieve config from UI thread.
- ProxyConfigServiceImpl::ProxyConfig ui_config;
- config_service_impl_->UIGetProxyConfig(&ui_config);
- EXPECT_EQ(input.mode, ui_config.mode);
- if (tests[i].is_valid) {
- if (input.pac_url)
- EXPECT_EQ(GURL(input.pac_url), ui_config.automatic_proxy.pac_url);
- const net::ProxyRulesExpectation& proxy_rules = tests[i].proxy_rules;
- if (input.single_uri)
- EXPECT_EQ(proxy_rules.single_proxy,
- ui_config.single_proxy.server.ToURI());
- if (input.http_uri)
- EXPECT_EQ(proxy_rules.proxy_for_http,
- ui_config.http_proxy.server.ToURI());
- if (input.https_uri)
- EXPECT_EQ(proxy_rules.proxy_for_https,
- ui_config.https_proxy.server.ToURI());
- if (input.ftp_uri)
- EXPECT_EQ(proxy_rules.proxy_for_ftp,
- ui_config.ftp_proxy.server.ToURI());
- if (input.socks_uri) {
- EXPECT_EQ(proxy_rules.fallback_proxy,
- ui_config.socks_proxy.server.ToURI());
- }
- if (input.bypass_rules)
- EXPECT_TRUE(bypass_rules.Equals(ui_config.bypass_rules));
- }
- }
-}
-
TEST_F(ProxyConfigServiceImplTest, DynamicPrefsOverride) {
// Groupings of 3 test inputs to use for managed, recommended and network
// proxies respectively. Only valid and non-direct test inputs are used.
@@ -494,22 +385,21 @@ TEST_F(ProxyConfigServiceImplTest, DynamicPrefsOverride) {
recommended_params.description.c_str(),
network_params.description.c_str()));
- ProxyConfigServiceImpl::ProxyConfig managed_config;
+ base::DictionaryValue managed_config;
InitConfigWithTestInput(managed_params.input, &managed_config);
- ProxyConfigServiceImpl::ProxyConfig recommended_config;
+ base::DictionaryValue recommended_config;
InitConfigWithTestInput(recommended_params.input, &recommended_config);
- ProxyConfigServiceImpl::ProxyConfig network_config;
+ base::DictionaryValue network_config;
InitConfigWithTestInput(network_params.input, &network_config);
// Managed proxy pref should take effect over recommended proxy and
// non-existent network proxy.
- config_service_impl_->SetTesting(NULL);
- pref_service_.SetManagedPref(prefs::kProxy,
- managed_config.ToPrefProxyConfig());
+ SetConfig(NULL);
+ pref_service_.SetManagedPref(prefs::kProxy, managed_config.DeepCopy());
pref_service_.SetRecommendedPref(prefs::kProxy,
- recommended_config.ToPrefProxyConfig());
+ recommended_config.DeepCopy());
net::ProxyConfig actual_config;
- EXPECT_EQ(MK_AVAIL(VALID), SyncGetLatestProxyConfig(&actual_config));
+ SyncGetLatestProxyConfig(&actual_config);
EXPECT_EQ(managed_params.auto_detect, actual_config.auto_detect());
EXPECT_EQ(managed_params.pac_url, actual_config.pac_url());
EXPECT_TRUE(managed_params.proxy_rules.Matches(
@@ -518,24 +408,23 @@ TEST_F(ProxyConfigServiceImplTest, DynamicPrefsOverride) {
// Recommended proxy pref should take effect when managed proxy pref is
// removed.
pref_service_.RemoveManagedPref(prefs::kProxy);
- EXPECT_EQ(MK_AVAIL(VALID), SyncGetLatestProxyConfig(&actual_config));
+ SyncGetLatestProxyConfig(&actual_config);
EXPECT_EQ(recommended_params.auto_detect, actual_config.auto_detect());
EXPECT_EQ(recommended_params.pac_url, actual_config.pac_url());
EXPECT_TRUE(recommended_params.proxy_rules.Matches(
actual_config.proxy_rules()));
// Network proxy should take take effect over recommended proxy pref.
- config_service_impl_->SetTesting(&network_config);
- EXPECT_EQ(MK_AVAIL(VALID), SyncGetLatestProxyConfig(&actual_config));
+ SetConfig(&network_config);
+ SyncGetLatestProxyConfig(&actual_config);
EXPECT_EQ(network_params.auto_detect, actual_config.auto_detect());
EXPECT_EQ(network_params.pac_url, actual_config.pac_url());
EXPECT_TRUE(network_params.proxy_rules.Matches(
actual_config.proxy_rules()));
// Managed proxy pref should take effect over network proxy.
- pref_service_.SetManagedPref(prefs::kProxy,
- managed_config.ToPrefProxyConfig());
- EXPECT_EQ(MK_AVAIL(VALID), SyncGetLatestProxyConfig(&actual_config));
+ pref_service_.SetManagedPref(prefs::kProxy, managed_config.DeepCopy());
+ SyncGetLatestProxyConfig(&actual_config);
EXPECT_EQ(managed_params.auto_detect, actual_config.auto_detect());
EXPECT_EQ(managed_params.pac_url, actual_config.pac_url());
EXPECT_TRUE(managed_params.proxy_rules.Matches(
@@ -544,7 +433,7 @@ TEST_F(ProxyConfigServiceImplTest, DynamicPrefsOverride) {
// Network proxy should take effect over recommended proxy pref when managed
// proxy pref is removed.
pref_service_.RemoveManagedPref(prefs::kProxy);
- EXPECT_EQ(MK_AVAIL(VALID), SyncGetLatestProxyConfig(&actual_config));
+ SyncGetLatestProxyConfig(&actual_config);
EXPECT_EQ(network_params.auto_detect, actual_config.auto_detect());
EXPECT_EQ(network_params.pac_url, actual_config.pac_url());
EXPECT_TRUE(network_params.proxy_rules.Matches(
@@ -552,7 +441,7 @@ TEST_F(ProxyConfigServiceImplTest, DynamicPrefsOverride) {
// Removing recommended proxy pref should have no effect on network proxy.
pref_service_.RemoveRecommendedPref(prefs::kProxy);
- EXPECT_EQ(MK_AVAIL(VALID), SyncGetLatestProxyConfig(&actual_config));
+ SyncGetLatestProxyConfig(&actual_config);
EXPECT_EQ(network_params.auto_detect, actual_config.auto_detect());
EXPECT_EQ(network_params.pac_url, actual_config.pac_url());
EXPECT_TRUE(network_params.proxy_rules.Matches(
@@ -560,6 +449,4 @@ TEST_F(ProxyConfigServiceImplTest, DynamicPrefsOverride) {
}
}
-} // namespace
-
} // namespace chromeos

Powered by Google App Engine
This is Rietveld 408576698