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

Side by Side Diff: ios/web/public/test/http_server/http_server.h

Issue 2931453002: Re-enable reading list tests (Closed)
Patch Set: nit Created 3 years, 6 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 2014 The Chromium Authors. All rights reserved. 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 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 IOS_WEB_PUBLIC_TEST_HTTP_SERVER_HTTP_SERVER_H_ 5 #ifndef IOS_WEB_PUBLIC_TEST_HTTP_SERVER_HTTP_SERVER_H_
6 #define IOS_WEB_PUBLIC_TEST_HTTP_SERVER_HTTP_SERVER_H_ 6 #define IOS_WEB_PUBLIC_TEST_HTTP_SERVER_HTTP_SERVER_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 // A convenience method for the longer form of 70 // A convenience method for the longer form of
71 // |web::test::HttpServer::GetSharedInstance().MakeUrlForHttpServer| 71 // |web::test::HttpServer::GetSharedInstance().MakeUrlForHttpServer|
72 static GURL MakeUrl(const std::string& url); 72 static GURL MakeUrl(const std::string& url);
73 // Starts the server on the default port 8080. CHECKs if the server can not be 73 // Starts the server on the default port 8080. CHECKs if the server can not be
74 // started. 74 // started.
75 // Must be called from the main thread. 75 // Must be called from the main thread.
76 void StartOrDie(); 76 void StartOrDie();
77 // Stops the server and prevents it from accepting new requests. 77 // Stops the server and prevents it from accepting new requests.
78 // Must be called from the main thread. 78 // Must be called from the main thread.
79 void Stop(); 79 void Stop();
80 // Sets the server to hang and return no response.
81 void SetSuspend(bool suspended);
80 // Returns true if the server is running. 82 // Returns true if the server is running.
81 // Must be called from the main thread. 83 // Must be called from the main thread.
82 bool IsRunning() const; 84 bool IsRunning() const;
83 85
84 // Returns the port that the server is running on. Thread Safe 86 // Returns the port that the server is running on. Thread Safe
85 NSUInteger GetPort() const; 87 NSUInteger GetPort() const;
86 88
87 // Adds a ResponseProvider. Takes ownership of the ResponseProvider. 89 // Adds a ResponseProvider. Takes ownership of the ResponseProvider.
88 // Note for using URLs inside of the |response_provider|: 90 // Note for using URLs inside of the |response_provider|:
89 // The HttpServer cannot run on default HTTP port 80, so URLs used in 91 // The HttpServer cannot run on default HTTP port 80, so URLs used in
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 std::vector<scoped_refptr<RefCountedResponseProviderWrapper>> providers_; 131 std::vector<scoped_refptr<RefCountedResponseProviderWrapper>> providers_;
130 // Returns the response providers for a request. 132 // Returns the response providers for a request.
131 ResponseProvider* GetResponseProviderForProviderRequest( 133 ResponseProvider* GetResponseProviderForProviderRequest(
132 const web::ResponseProvider::Request& request); 134 const web::ResponseProvider::Request& request);
133 // Provides a shim between EmbeddedTestServer and ResponseProvider. This 135 // Provides a shim between EmbeddedTestServer and ResponseProvider. This
134 // handler converts an EmbeddedTestServer request to ResponseProvider 136 // handler converts an EmbeddedTestServer request to ResponseProvider
135 // request, look up the corresponding providers, and then converts the 137 // request, look up the corresponding providers, and then converts the
136 // ResponseProvider response back to EmbeddedTestServer response. 138 // ResponseProvider response back to EmbeddedTestServer response.
137 std::unique_ptr<net::test_server::HttpResponse> GetResponse( 139 std::unique_ptr<net::test_server::HttpResponse> GetResponse(
138 const net::test_server::HttpRequest& request); 140 const net::test_server::HttpRequest& request);
141 // Status tracking if the server is hung.
142 bool isSuspended;
Eugene But (OOO till 7-30) 2017/06/12 02:25:44 s/isSuspended;/is_suspended_ = false; C++ Style a
139 DISALLOW_COPY_AND_ASSIGN(HttpServer); 143 DISALLOW_COPY_AND_ASSIGN(HttpServer);
140 }; 144 };
141 145
142 } // namespace test 146 } // namespace test
143 } // namspace web 147 } // namspace web
144 148
145 #endif // IOS_WEB_PUBLIC_TEST_HTTP_SERVER_HTTP_SERVER_H_ 149 #endif // IOS_WEB_PUBLIC_TEST_HTTP_SERVER_HTTP_SERVER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698