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

Side by Side Diff: chrome/browser/ui/webui/options/preferences_browsertest.cc

Issue 2030013003: Remove ListValue::Append(new {Fundamental,String}Value(...)) pattern in //chrome (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/webui/options/preferences_browsertest.h" 5 #include "chrome/browser/ui/webui/options/preferences_browsertest.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <iostream> 9 #include <iostream>
10 #include <memory> 10 #include <memory>
(...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after
462 pref_names_.push_back(prefs::kRestoreOnStartup); 462 pref_names_.push_back(prefs::kRestoreOnStartup);
463 policy_names_.push_back(policy::key::kRestoreOnStartup); 463 policy_names_.push_back(policy::key::kRestoreOnStartup);
464 non_default_values_.push_back(new base::FundamentalValue(4)); 464 non_default_values_.push_back(new base::FundamentalValue(4));
465 465
466 // List pref. 466 // List pref.
467 if (includeListPref) { 467 if (includeListPref) {
468 types_.push_back("List"); 468 types_.push_back("List");
469 pref_names_.push_back(prefs::kURLsToRestoreOnStartup); 469 pref_names_.push_back(prefs::kURLsToRestoreOnStartup);
470 policy_names_.push_back(policy::key::kRestoreOnStartupURLs); 470 policy_names_.push_back(policy::key::kRestoreOnStartupURLs);
471 base::ListValue* list = new base::ListValue; 471 base::ListValue* list = new base::ListValue;
472 list->Append(new base::StringValue("http://www.example.com")); 472 list->AppendString("http://www.example.com");
473 list->Append(new base::StringValue("http://example.com")); 473 list->AppendString("http://example.com");
474 non_default_values_.push_back(list); 474 non_default_values_.push_back(list);
475 } 475 }
476 476
477 // Retrieve default values. 477 // Retrieve default values.
478 for (std::vector<std::string>::const_iterator name = pref_names_.begin(); 478 for (std::vector<std::string>::const_iterator name = pref_names_.begin();
479 name != pref_names_.end(); ++name) { 479 name != pref_names_.end(); ++name) {
480 default_values_.push_back( 480 default_values_.push_back(
481 pref_service_->GetDefaultPrefValue(name->c_str())->DeepCopy()); 481 pref_service_->GetDefaultPrefValue(name->c_str())->DeepCopy());
482 } 482 }
483 } 483 }
(...skipping 596 matching lines...) Expand 10 before | Expand all | Expand 10 after
1080 SetProxyPref(chromeos::kProxyHttpsPort, base::FundamentalValue(2)); 1080 SetProxyPref(chromeos::kProxyHttpsPort, base::FundamentalValue(2));
1081 SetProxyPref(chromeos::kProxyFtpPort, base::FundamentalValue(3)); 1081 SetProxyPref(chromeos::kProxyFtpPort, base::FundamentalValue(3));
1082 SetProxyPref(chromeos::kProxySocksPort, base::FundamentalValue(4)); 1082 SetProxyPref(chromeos::kProxySocksPort, base::FundamentalValue(4));
1083 1083
1084 VerifyCurrentProxyServer( 1084 VerifyCurrentProxyServer(
1085 "http=a.com:1;https=4.3.2.1:2;ftp=c.com:3;socks=socks4://d.com:4", 1085 "http=a.com:1;https=4.3.2.1:2;ftp=c.com:3;socks=socks4://d.com:4",
1086 onc::ONC_SOURCE_NONE); 1086 onc::ONC_SOURCE_NONE);
1087 } 1087 }
1088 1088
1089 #endif 1089 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698