diff options
author | satorux@chromium.org <satorux@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-07 18:08:41 +0000 |
---|---|---|
committer | satorux@chromium.org <satorux@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-07 18:08:41 +0000 |
commit | 4df762d5aa697a92653a127b83dec25a62a2049c (patch) | |
tree | cf7d278b4470d81a3e5c9102dc7e0d3515fcc954 /net/test | |
parent | 444f217666f482c65573e73fb4853fc28f8133a0 (diff) | |
download | chromium_src-4df762d5aa697a92653a127b83dec25a62a2049c.zip chromium_src-4df762d5aa697a92653a127b83dec25a62a2049c.tar.gz chromium_src-4df762d5aa697a92653a127b83dec25a62a2049c.tar.bz2 |
Add the first version of GDataTest.
This CL introduces a browsertest case for gdata by introducing the following
changes:
- testserver: add GDataHandler and TYPE_GDATA.
- InProcessBrowserTest: allow invoking customized test server.
- gdata_browsertest.cc: actual test code. Currently it only covers
a part of full APIs, to make sure if my current approach is looking okay.
BUG=chromium-os:26355
TEST=passed locally
Review URL: https://chromiumcodereview.appspot.com/9597014
Patch from Jun Mukai <mukai@chromium.org>.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@125404 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/test')
-rw-r--r-- | net/test/test_server.cc | 7 | ||||
-rw-r--r-- | net/test/test_server.h | 6 |
2 files changed, 11 insertions, 2 deletions
diff --git a/net/test/test_server.cc b/net/test/test_server.cc index 3d95fb4..397b0bc 100644 --- a/net/test/test_server.cc +++ b/net/test/test_server.cc @@ -69,7 +69,8 @@ FilePath TestServer::HTTPSOptions::GetCertificateFile() const { return FilePath(); } -const char* TestServer::kLocalhost = "127.0.0.1"; +const char TestServer::kLocalhost[] = "127.0.0.1"; +const char TestServer::kGDataAuthToken[] = "testtoken"; TestServer::TestServer(Type type, const std::string& host, @@ -174,6 +175,7 @@ std::string TestServer::GetScheme() const { switch (type_) { case TYPE_FTP: return "ftp"; + case TYPE_GDATA: case TYPE_HTTP: case TYPE_SYNC: return "http"; @@ -377,6 +379,9 @@ bool TestServer::AddCommandLineArguments(CommandLine* command_line) const { command_line->AppendArg("--tcp-echo"); } else if (type_ == TYPE_UDP_ECHO) { command_line->AppendArg("--udp-echo"); + } else if (type_ == TYPE_GDATA) { + // --auth-token will be used in tests for chrome/browser/chromeos/gdata. + command_line->AppendArg(std::string("--auth-token=") + kGDataAuthToken); } else if (type_ == TYPE_HTTPS) { FilePath certificate_path(certificates_dir_); certificate_path = certificate_path.Append( diff --git a/net/test/test_server.h b/net/test/test_server.h index f49a16b..5c04a40 100644 --- a/net/test/test_server.h +++ b/net/test/test_server.h @@ -42,6 +42,7 @@ class TestServer { enum Type { TYPE_FTP, + TYPE_GDATA, TYPE_HTTP, TYPE_HTTPS, TYPE_SYNC, @@ -116,7 +117,10 @@ class TestServer { }; // Pass as the 'host' parameter during construction to server on 127.0.0.1 - static const char* kLocalhost; + static const char kLocalhost[]; + + // The auth token to be used for TYPE_GDATA server. + static const char kGDataAuthToken[]; // Initialize a TestServer listening on the specified host (IP or hostname). TestServer(Type type, const std::string& host, const FilePath& document_root); |