Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(543)

Side by Side Diff: net/test/local_test_server.h

Issue 10986042: Fix the failed cases in URLFetcherFileTest on Android. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: move GetDocumentRoot to test server Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 #ifndef NET_TEST_LOCAL_TEST_SERVER_H_ 5 #ifndef NET_TEST_LOCAL_TEST_SERVER_H_
6 #define NET_TEST_LOCAL_TEST_SERVER_H_ 6 #define NET_TEST_LOCAL_TEST_SERVER_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/file_util.h" 10 #include "base/file_util.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 static bool SetPythonPath() WARN_UNUSED_RESULT; 46 static bool SetPythonPath() WARN_UNUSED_RESULT;
47 47
48 // Returns true if successfully stored the FilePath for the directory of the 48 // Returns true if successfully stored the FilePath for the directory of the
49 // testserver python script in |*directory|. 49 // testserver python script in |*directory|.
50 static bool GetTestServerDirectory(FilePath* directory) WARN_UNUSED_RESULT; 50 static bool GetTestServerDirectory(FilePath* directory) WARN_UNUSED_RESULT;
51 51
52 // Adds the command line arguments for the Python test server to 52 // Adds the command line arguments for the Python test server to
53 // |command_line|. Returns true on success. 53 // |command_line|. Returns true on success.
54 virtual bool AddCommandLineArguments(CommandLine* command_line) const; 54 virtual bool AddCommandLineArguments(CommandLine* command_line) const;
55 55
56 FilePath GetDocumentRoot() const { return document_root(); };
wtc 2012/10/23 18:28:31 Please document this function.
Shouqun Liu 2012/10/24 02:32:47 Done.
57
56 private: 58 private:
57 bool Init(const FilePath& document_root); 59 bool Init(const FilePath& document_root);
58 60
59 // Launches the Python test server. Returns true on success. 61 // Launches the Python test server. Returns true on success.
60 bool LaunchPython(const FilePath& testserver_path) WARN_UNUSED_RESULT; 62 bool LaunchPython(const FilePath& testserver_path) WARN_UNUSED_RESULT;
61 63
62 // Waits for the server to start. Returns true on success. 64 // Waits for the server to start. Returns true on success.
63 bool WaitToStart() WARN_UNUSED_RESULT; 65 bool WaitToStart() WARN_UNUSED_RESULT;
64 66
65 // Handle of the Python process running the test server. 67 // Handle of the Python process running the test server.
(...skipping 15 matching lines...) Expand all
81 int child_fd_; 83 int child_fd_;
82 file_util::ScopedFD child_fd_closer_; 84 file_util::ScopedFD child_fd_closer_;
83 #endif 85 #endif
84 86
85 DISALLOW_COPY_AND_ASSIGN(LocalTestServer); 87 DISALLOW_COPY_AND_ASSIGN(LocalTestServer);
86 }; 88 };
87 89
88 } // namespace net 90 } // namespace net
89 91
90 #endif // NET_TEST_LOCAL_TEST_SERVER_H_ 92 #endif // NET_TEST_LOCAL_TEST_SERVER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698