summaryrefslogtreecommitdiffstats
path: root/chrome_frame/test/test_server.h
diff options
context:
space:
mode:
authorkkania@chromium.org <kkania@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-12 22:07:03 +0000
committerkkania@chromium.org <kkania@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-12 22:07:03 +0000
commit6448b3abcfa035eaf65b7c0c15bb728513f228fe (patch)
tree3d8ee0bf2f528e93616a1d7721bc721ef6726189 /chrome_frame/test/test_server.h
parentbb2eb35a70fcbc47be253bf50c8648c65271a19e (diff)
downloadchromium_src-6448b3abcfa035eaf65b7c0c15bb728513f228fe.zip
chromium_src-6448b3abcfa035eaf65b7c0c15bb728513f228fe.tar.gz
chromium_src-6448b3abcfa035eaf65b7c0c15bb728513f228fe.tar.bz2
[chrome_frame] Refactor/merge IE no interference tests with other mock event sink tests. Have the test mock contain, not inherit the IE event sink. Use the new test server to verify the right requests are being sent.
BUG=none TEST=none Review URL: http://codereview.chromium.org/2822016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52137 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/test/test_server.h')
-rw-r--r--chrome_frame/test/test_server.h21
1 files changed, 17 insertions, 4 deletions
diff --git a/chrome_frame/test/test_server.h b/chrome_frame/test/test_server.h
index c3fab96..2b8454a 100644
--- a/chrome_frame/test/test_server.h
+++ b/chrome_frame/test/test_server.h
@@ -370,16 +370,29 @@ class ConfigurableConnection : public base::RefCounted<ConfigurableConnection> {
// instance to send the response.
class HTTPTestServer : public ListenSocket::ListenSocketDelegate {
public:
- explicit HTTPTestServer(int port, const char* address);
+ explicit HTTPTestServer(int port, const std::wstring& address,
+ FilePath root_dir);
virtual ~HTTPTestServer();
+
// HTTP GET request is received. Override in derived classes.
// |connection| can be used to send the response.
virtual void Get(ConfigurableConnection* connection,
- const std::string& path, const Request& r) = 0;
+ const std::wstring& path, const Request& r) = 0;
+
// HTTP POST request is received. Override in derived classes.
// |connection| can be used to send the response
virtual void Post(ConfigurableConnection* connection,
- const std::string& path, const Request& r) = 0;
+ const std::wstring& path, const Request& r) = 0;
+
+ // Return the appropriate url with the specified path for this server.
+ std::wstring Resolve(const std::wstring& path);
+
+ FilePath root_dir() { return root_dir_; }
+
+ protected:
+ int port_;
+ std::wstring address_;
+ FilePath root_dir_;
private:
typedef std::list<scoped_refptr<ConfigurableConnection> > ConnectionList;
@@ -394,10 +407,10 @@ class HTTPTestServer : public ListenSocket::ListenSocketDelegate {
scoped_refptr<ListenSocket> server_;
ConnectionList connection_list_;
+
DISALLOW_COPY_AND_ASSIGN(HTTPTestServer);
};
-
} // namespace test_server
#endif // CHROME_FRAME_TEST_TEST_SERVER_H_