summaryrefslogtreecommitdiffstats
path: root/net/tools/testserver/run_testserver.cc
diff options
context:
space:
mode:
authordarin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-15 19:07:49 +0000
committerdarin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-15 19:07:49 +0000
commit54d7aeb4c76f0cd80fdac22b08380c79adbd8181 (patch)
treef676f7d10ab4db4e27b1c23cdcf766a42b6360b2 /net/tools/testserver/run_testserver.cc
parent4a180a518d55c74aea5eb0cda0281d60b78e8a8d (diff)
downloadchromium_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.cc9
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());