summaryrefslogtreecommitdiffstats
path: root/net/test
diff options
context:
space:
mode:
authorakalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-27 05:57:56 +0000
committerakalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-27 05:57:56 +0000
commit47b3c39b87cb9969d30ea05a15d07f177570cde2 (patch)
tree82857f4243c318291902ef2d7ff5ea38ea47dcbc /net/test
parentc67895dc60ddd5b37c5a9a2a5510548f642ab11f (diff)
downloadchromium_src-47b3c39b87cb9969d30ea05a15d07f177570cde2.zip
chromium_src-47b3c39b87cb9969d30ea05a15d07f177570cde2.tar.gz
chromium_src-47b3c39b87cb9969d30ea05a15d07f177570cde2.tar.bz2
[Sync] Make sync integration tests use local xmpp servers.
Fixed signed/unsigned bug with the port number. BUG=53934 TEST=sync integration tests Review URL: http://codereview.chromium.org/5239001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@67491 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/test')
-rw-r--r--net/test/test_server.cc9
-rw-r--r--net/test/test_server.h5
2 files changed, 12 insertions, 2 deletions
diff --git a/net/test/test_server.cc b/net/test/test_server.cc
index 91ef115..0eaf8b5 100644
--- a/net/test/test_server.cc
+++ b/net/test/test_server.cc
@@ -189,6 +189,11 @@ const HostPortPair& TestServer::host_port_pair() const {
return host_port_pair_;
}
+const DictionaryValue& TestServer::server_data() const {
+ DCHECK(started_);
+ return *server_data_;
+}
+
std::string TestServer::GetScheme() const {
switch (type_) {
case TYPE_FTP:
@@ -391,9 +396,9 @@ bool TestServer::ParseServerData(const std::string& server_data) {
<< json_reader.GetErrorMessage();
return false;
}
- DictionaryValue* dict = static_cast<DictionaryValue*>(value.get());
+ server_data_.reset(static_cast<DictionaryValue*>(value.release()));
int port = 0;
- if (!dict->GetInteger("port", &port)) {
+ if (!server_data_->GetInteger("port", &port)) {
LOG(ERROR) << "Could not find port value";
return false;
}
diff --git a/net/test/test_server.h b/net/test/test_server.h
index 5c11038..00a8fc9 100644
--- a/net/test/test_server.h
+++ b/net/test/test_server.h
@@ -28,6 +28,7 @@
#endif
class CommandLine;
+class DictionaryValue;
class GURL;
namespace net {
@@ -116,6 +117,7 @@ class TestServer {
const FilePath& document_root() const { return document_root_; }
const HostPortPair& host_port_pair() const;
+ const DictionaryValue& server_data() const;
std::string GetScheme() const;
bool GetAddressList(AddressList* address_list) const WARN_UNUSED_RESULT;
@@ -172,6 +174,9 @@ class TestServer {
// Address the test server listens on.
HostPortPair host_port_pair_;
+ // Holds the data sent from the server (e.g., port number).
+ scoped_ptr<DictionaryValue> server_data_;
+
// Handle of the Python process running the test server.
base::ProcessHandle process_handle_;