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

Side by Side Diff: sync/test/fake_server/fake_sync_server_http_handler.h

Issue 264773007: Remove Sync FakeServer standalone executable (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 7 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
« no previous file with comments | « sync/sync_tests.gypi ('k') | sync/test/fake_server/fake_sync_server_http_handler.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef SYNC_TEST_FAKE_SERVER_FAKE_SERVER_HTTP_HANDLER_H_
6 #define SYNC_TEST_FAKE_SERVER_FAKE_SERVER_HTTP_HANDLER_H_
7
8 #include "net/server/http_server.h"
9 #include "sync/test/fake_server/fake_server.h"
10
11 namespace fake_server {
12
13 // An HTTP server that forwards requests to FakeServer, providing a quick way
14 // to test Sync client code.
15 class FakeSyncServerHttpHandler : public net::HttpServer::Delegate {
16 public:
17 // Creates a fake sync server that listens on an available port.
18 FakeSyncServerHttpHandler();
19
20 // Creates a fake sync server that listens on a specified port.
21 explicit FakeSyncServerHttpHandler(int port);
22
23 virtual ~FakeSyncServerHttpHandler();
24
25 // Begin accepting HTTP requests. Must be called from an IO MessageLoop.
26 void Start();
27
28 // Overridden from net::HttpServer::Delegate.
29 // HTTP requests are processed and WebSocket requests are currently
30 // unimplemented.
31 virtual void OnHttpRequest(int connection_id,
32 const net::HttpServerRequestInfo& info) OVERRIDE;
33 virtual void OnWebSocketRequest(
34 int connection_id,
35 const net::HttpServerRequestInfo& info) OVERRIDE;
36
37 virtual void OnWebSocketMessage(int connection_id,
38 const std::string& data) OVERRIDE;
39
40 virtual void OnClose(int connection_id) OVERRIDE;
41
42 private:
43 int requested_port_;
44
45 scoped_refptr<net::HttpServer> server_;
46
47 fake_server::FakeServer fake_sync_server_;
48
49 DISALLOW_COPY_AND_ASSIGN(FakeSyncServerHttpHandler);
50 };
51
52 } // namespace fake_server
53
54 #endif // SYNC_TEST_FAKE_SERVER_FAKE_SERVER_HTTP_HANDLER_H_
OLDNEW
« no previous file with comments | « sync/sync_tests.gypi ('k') | sync/test/fake_server/fake_sync_server_http_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698