| OLD | NEW |
| 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/sync/test/integration/sync_test.h" | 5 #include "chrome/browser/sync/test/integration/sync_test.h" |
| 6 | 6 |
| 7 #include <stdint.h> | |
| 8 | |
| 9 #include <limits> | |
| 10 #include <vector> | 7 #include <vector> |
| 11 | 8 |
| 9 #include "base/basictypes.h" |
| 12 #include "base/bind.h" | 10 #include "base/bind.h" |
| 13 #include "base/command_line.h" | 11 #include "base/command_line.h" |
| 14 #include "base/guid.h" | 12 #include "base/guid.h" |
| 15 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
| 16 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
| 17 #include "base/message_loop/message_loop.h" | 15 #include "base/message_loop/message_loop.h" |
| 18 #include "base/path_service.h" | 16 #include "base/path_service.h" |
| 19 #include "base/process/launch.h" | 17 #include "base/process/launch.h" |
| 20 #include "base/strings/string_split.h" | 18 #include "base/strings/string_split.h" |
| 21 #include "base/strings/string_util.h" | 19 #include "base/strings/string_util.h" |
| (...skipping 828 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 850 std::string sync_service_url = sync_server_.GetURL("chromiumsync").spec(); | 848 std::string sync_service_url = sync_server_.GetURL("chromiumsync").spec(); |
| 851 cl->AppendSwitchASCII(switches::kSyncServiceURL, sync_service_url); | 849 cl->AppendSwitchASCII(switches::kSyncServiceURL, sync_service_url); |
| 852 DVLOG(1) << "Started local python sync server at " << sync_service_url; | 850 DVLOG(1) << "Started local python sync server at " << sync_service_url; |
| 853 } | 851 } |
| 854 | 852 |
| 855 int xmpp_port = 0; | 853 int xmpp_port = 0; |
| 856 if (!sync_server_.server_data().GetInteger("xmpp_port", &xmpp_port)) { | 854 if (!sync_server_.server_data().GetInteger("xmpp_port", &xmpp_port)) { |
| 857 LOG(ERROR) << "Could not find valid xmpp_port value"; | 855 LOG(ERROR) << "Could not find valid xmpp_port value"; |
| 858 return false; | 856 return false; |
| 859 } | 857 } |
| 860 if ((xmpp_port <= 0) || (xmpp_port > std::numeric_limits<uint16_t>::max())) { | 858 if ((xmpp_port <= 0) || (xmpp_port > kuint16max)) { |
| 861 LOG(ERROR) << "Invalid xmpp port: " << xmpp_port; | 859 LOG(ERROR) << "Invalid xmpp port: " << xmpp_port; |
| 862 return false; | 860 return false; |
| 863 } | 861 } |
| 864 | 862 |
| 865 net::HostPortPair xmpp_host_port_pair(sync_server_.host_port_pair()); | 863 net::HostPortPair xmpp_host_port_pair(sync_server_.host_port_pair()); |
| 866 xmpp_host_port_pair.set_port(xmpp_port); | 864 xmpp_host_port_pair.set_port(xmpp_port); |
| 867 xmpp_port_.reset(new net::ScopedPortException(xmpp_port)); | 865 xmpp_port_.reset(new net::ScopedPortException(xmpp_port)); |
| 868 | 866 |
| 869 if (!cl->HasSwitch(invalidation::switches::kSyncNotificationHostPort)) { | 867 if (!cl->HasSwitch(invalidation::switches::kSyncNotificationHostPort)) { |
| 870 cl->AppendSwitchASCII(invalidation::switches::kSyncNotificationHostPort, | 868 cl->AppendSwitchASCII(invalidation::switches::kSyncNotificationHostPort, |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1104 | 1102 |
| 1105 void SyncTest::TriggerSyncForModelTypes(int index, | 1103 void SyncTest::TriggerSyncForModelTypes(int index, |
| 1106 syncer::ModelTypeSet model_types) { | 1104 syncer::ModelTypeSet model_types) { |
| 1107 GetSyncService(index)->TriggerRefresh(model_types); | 1105 GetSyncService(index)->TriggerRefresh(model_types); |
| 1108 } | 1106 } |
| 1109 | 1107 |
| 1110 void SyncTest::SetPreexistingPreferencesFileContents( | 1108 void SyncTest::SetPreexistingPreferencesFileContents( |
| 1111 const std::string& contents) { | 1109 const std::string& contents) { |
| 1112 preexisting_preferences_file_contents_ = contents; | 1110 preexisting_preferences_file_contents_ = contents; |
| 1113 } | 1111 } |
| OLD | NEW |