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

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: Addressed remaining 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
« no previous file with comments | « chrome/browser/chromeos/net/onc_utils.cc ('k') | chromeos/network/device_state.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 8b5a464ba2af9f1b640903ed98a220d3dd43834f..f0cff65dabe0bd46bdbf7f87324a290513633833 100644
--- a/chrome/browser/ui/webui/options/preferences_browsertest.cc
+++ b/chrome/browser/ui/webui/options/preferences_browsertest.cc
@@ -231,7 +231,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,
@@ -240,20 +241,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"))
@@ -841,6 +843,7 @@ class ProxyPreferencesBrowserTest : public PreferencesBrowserTest {
g_browser_process->local_state(),
*network,
&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);
« no previous file with comments | « chrome/browser/chromeos/net/onc_utils.cc ('k') | chromeos/network/device_state.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698