diff options
author | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-15 19:07:49 +0000 |
---|---|---|
committer | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-15 19:07:49 +0000 |
commit | 54d7aeb4c76f0cd80fdac22b08380c79adbd8181 (patch) | |
tree | f676f7d10ab4db4e27b1c23cdcf766a42b6360b2 /net/tools/testserver/run_testserver.cc | |
parent | 4a180a518d55c74aea5eb0cda0281d60b78e8a8d (diff) | |
download | chromium_src-54d7aeb4c76f0cd80fdac22b08380c79adbd8181.zip chromium_src-54d7aeb4c76f0cd80fdac22b08380c79adbd8181.tar.gz chromium_src-54d7aeb4c76f0cd80fdac22b08380c79adbd8181.tar.bz2 |
Make run_testserver.exe complain if the given --doc-root parameter
is invalid.
R=eroman@chromium.org
Review URL: http://codereview.chromium.org/6873011
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@81780 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/tools/testserver/run_testserver.cc')
-rw-r--r-- | net/tools/testserver/run_testserver.cc | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/net/tools/testserver/run_testserver.cc b/net/tools/testserver/run_testserver.cc index bfaa682..06fa577 100644 --- a/net/tools/testserver/run_testserver.cc +++ b/net/tools/testserver/run_testserver.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -9,6 +9,7 @@ #include "base/file_path.h" #include "base/logging.h" #include "base/message_loop.h" +#include "base/utf_string_conversions.h" #include "net/test/test_server.h" static void PrintUsage() { @@ -62,6 +63,12 @@ int main(int argc, const char* argv[]) { return -1; } + if (!file_util::DirectoryExists(test_server.document_root())) { + printf("Error: invalid doc root: \"%s\" does not exist!\n", + UTF16ToUTF8(test_server.document_root().LossyDisplayName()).c_str()); + return -1; + } + printf("testserver running at %s (type ctrl+c to exit)\n", test_server.host_port_pair().ToString().c_str()); |