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

Unified Diff: chromeos/network/onc/onc_utils_unittest.cc

Issue 2619363004: RELAND: ONC: Fix handling of invalid proxy scheme. (Closed)
Patch Set: Fix test Created 3 years, 11 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 | « chromeos/network/onc/onc_utils.cc ('k') | chromeos/test/data/network/proxy_config_from_onc.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/network/onc/onc_utils_unittest.cc
diff --git a/chromeos/network/onc/onc_utils_unittest.cc b/chromeos/network/onc/onc_utils_unittest.cc
index a8577b15c380ed1a09df8c73ae031ee774223cee..ba4a2ed1c66f28dbf22da7003d8458554aea5332 100644
--- a/chromeos/network/onc/onc_utils_unittest.cc
+++ b/chromeos/network/onc/onc_utils_unittest.cc
@@ -167,17 +167,28 @@ TEST(ONCResolveServerCertRefs, ResolveServerCertRefs) {
TEST(ONCUtils, ProxySettingsToProxyConfig) {
std::unique_ptr<base::Value> test_data(ReadTestJson("proxy_config.json"));
- base::ListValue* list_of_tests;
- test_data->GetAsList(&list_of_tests);
- ASSERT_TRUE(list_of_tests);
+ base::ListValue* tests1;
+ test_data->GetAsList(&tests1);
+ ASSERT_TRUE(tests1);
+
+ std::unique_ptr<base::ListValue> list_of_tests = tests1->CreateDeepCopy();
+
+ // Additional ONC -> ProxyConfig test cases to test fixup.
+ test_data = ReadTestJson("proxy_config_from_onc.json");
+ base::ListValue* tests2;
+ test_data->GetAsList(&tests2);
+ ASSERT_TRUE(tests2);
+ for (auto iter1 = tests2->begin(); iter1 != tests2->end(); ++iter1)
+ list_of_tests->Append((*iter1)->CreateDeepCopy());
int index = 0;
- for (base::ListValue::iterator it = list_of_tests->begin();
- it != list_of_tests->end(); ++it, ++index) {
+ for (auto iter2 = list_of_tests->begin(); iter2 != list_of_tests->end();
+ ++iter2, ++index) {
SCOPED_TRACE("Test case #" + base::IntToString(index));
- base::DictionaryValue* test_case;
- (*it)->GetAsDictionary(&test_case);
+ base::DictionaryValue* test_case = nullptr;
+ (*iter2)->GetAsDictionary(&test_case);
+ ASSERT_TRUE(test_case);
base::DictionaryValue* onc_proxy_settings;
test_case->GetDictionary("ONC_ProxySettings", &onc_proxy_settings);
« no previous file with comments | « chromeos/network/onc/onc_utils.cc ('k') | chromeos/test/data/network/proxy_config_from_onc.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698