#ifndef SYNC_TEST_FAKE_SERVER_FAKE_SERVER_HTTP_HANDLER_H_
#define SYNC_TEST_FAKE_SERVER_FAKE_SERVER_HTTP_HANDLER_H_
#include "net/server/http_server.h"
#include "sync/test/fake_server/fake_server.h"
namespace fake_server {
class FakeSyncServerHttpHandler : public net::HttpServer::Delegate {
public:
FakeSyncServerHttpHandler();
explicit FakeSyncServerHttpHandler(int port);
virtual ~FakeSyncServerHttpHandler();
void Start();
virtual void OnHttpRequest(int connection_id,
const net::HttpServerRequestInfo& info) OVERRIDE;
virtual void OnWebSocketRequest(
int connection_id,
const net::HttpServerRequestInfo& info) OVERRIDE;
virtual void OnWebSocketMessage(int connection_id,
const std::string& data) OVERRIDE;
virtual void OnClose(int connection_id) OVERRIDE;
private:
int requested_port_;
scoped_refptr<net::HttpServer> server_;
fake_server::FakeServer fake_sync_server_;
DISALLOW_COPY_AND_ASSIGN(FakeSyncServerHttpHandler);
};
}
#endif