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

Side by Side Diff: chrome/browser/chromeos/proxy_config_service_impl_unittest.cc

Issue 1131113004: Convert JsonWriter::Write to taking a const ref for the in-param (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: another rebase Created 5 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 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/chromeos/proxy_config_service_impl.h" 5 #include "chrome/browser/chromeos/proxy_config_service_impl.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/format_macros.h" 9 #include "base/format_macros.h"
10 #include "base/json/json_writer.h" 10 #include "base/json/json_writer.h"
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after
326 new_config.reset(ProxyConfigDictionary::CreateFixedServers( 326 new_config.reset(ProxyConfigDictionary::CreateFixedServers(
327 input.server, input.bypass_rules)); 327 input.server, input.bypass_rules));
328 break; 328 break;
329 } 329 }
330 result->Swap(new_config.get()); 330 result->Swap(new_config.get());
331 } 331 }
332 332
333 void SetUserConfigInShill(base::DictionaryValue* pref_proxy_config_dict) { 333 void SetUserConfigInShill(base::DictionaryValue* pref_proxy_config_dict) {
334 std::string proxy_config; 334 std::string proxy_config;
335 if (pref_proxy_config_dict) 335 if (pref_proxy_config_dict)
336 base::JSONWriter::Write(pref_proxy_config_dict, &proxy_config); 336 base::JSONWriter::Write(*pref_proxy_config_dict, &proxy_config);
337 337
338 NetworkStateHandler* network_state_handler = 338 NetworkStateHandler* network_state_handler =
339 NetworkHandler::Get()->network_state_handler(); 339 NetworkHandler::Get()->network_state_handler();
340 const NetworkState* network = network_state_handler->DefaultNetwork(); 340 const NetworkState* network = network_state_handler->DefaultNetwork();
341 ASSERT_TRUE(network); 341 ASSERT_TRUE(network);
342 DBusThreadManager::Get()->GetShillServiceClient()->GetTestInterface()-> 342 DBusThreadManager::Get()->GetShillServiceClient()->GetTestInterface()->
343 SetServiceProperty(network->path(), 343 SetServiceProperty(network->path(),
344 shill::kProxyConfigProperty, 344 shill::kProxyConfigProperty,
345 base::StringValue(proxy_config)); 345 base::StringValue(proxy_config));
346 } 346 }
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
514 network_configs.release()); 514 network_configs.release());
515 515
516 net::ProxyConfig actual_config; 516 net::ProxyConfig actual_config;
517 SyncGetLatestProxyConfig(&actual_config); 517 SyncGetLatestProxyConfig(&actual_config);
518 net::ProxyConfig expected_config = 518 net::ProxyConfig expected_config =
519 net::ProxyConfig::CreateFromCustomPacURL(GURL("http://domain.com/x")); 519 net::ProxyConfig::CreateFromCustomPacURL(GURL("http://domain.com/x"));
520 EXPECT_TRUE(expected_config.Equals(actual_config)); 520 EXPECT_TRUE(expected_config.Equals(actual_config));
521 } 521 }
522 522
523 } // namespace chromeos 523 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698