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

Unified Diff: chrome/browser/ui/webui/options/preferences_browsertest.cc

Issue 23451044: Add an Ethernet EAP policy. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased on NetworkStateBase removal and addressed comments. Created 7 years, 3 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/ui/webui/options/preferences_browsertest.cc
diff --git a/chrome/browser/ui/webui/options/preferences_browsertest.cc b/chrome/browser/ui/webui/options/preferences_browsertest.cc
index 365e21147fb9a4868b1060ca7b60336d32ade128..08adf1893c6d04d62beba831b642ab0bc76f70cf 100644
--- a/chrome/browser/ui/webui/options/preferences_browsertest.cc
+++ b/chrome/browser/ui/webui/options/preferences_browsertest.cc
@@ -230,7 +230,8 @@ void PreferencesBrowserTest::VerifyKeyValue(const base::DictionaryValue& dict,
const base::Value& expected) {
const base::Value* actual = NULL;
EXPECT_TRUE(dict.Get(key, &actual)) << "Was checking key: " << key;
- EXPECT_EQ(expected, *actual) << "Was checking key: " << key;
+ if (actual)
+ EXPECT_EQ(expected, *actual) << "Was checking key: " << key;
}
void PreferencesBrowserTest::VerifyPref(const base::DictionaryValue* prefs,
@@ -239,20 +240,21 @@ void PreferencesBrowserTest::VerifyPref(const base::DictionaryValue* prefs,
const std::string& controlledBy,
bool disabled,
bool uncommitted) {
- const base::Value* pref;
- const base::DictionaryValue* dict;
+ const base::Value* pref = NULL;
+ const base::DictionaryValue* dict = NULL;
ASSERT_TRUE(prefs->GetWithoutPathExpansion(name, &pref));
ASSERT_TRUE(pref->GetAsDictionary(&dict));
VerifyKeyValue(*dict, "value", *value);
- if (!controlledBy.empty()) {
+ if (!controlledBy.empty())
VerifyKeyValue(*dict, "controlledBy", base::StringValue(controlledBy));
- } else {
+ else
EXPECT_FALSE(dict->HasKey("controlledBy"));
- }
+
if (disabled)
VerifyKeyValue(*dict, "disabled", base::FundamentalValue(true));
else if (dict->HasKey("disabled"))
VerifyKeyValue(*dict, "disabled", base::FundamentalValue(false));
+
if (uncommitted)
VerifyKeyValue(*dict, "uncommitted", base::FundamentalValue(true));
else if (dict->HasKey("uncommitted"))
@@ -835,6 +837,7 @@ class ProxyPreferencesBrowserTest : public PreferencesBrowserTest {
g_browser_process->local_state(),
*GetDefaultNetwork(),
&actual_source);
+ ASSERT_TRUE(proxy_dict);
std::string actual_proxy_server;
EXPECT_TRUE(proxy_dict->GetProxyServer(&actual_proxy_server));
EXPECT_EQ(expected_server, actual_proxy_server);

Powered by Google App Engine
This is Rietveld 408576698