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