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

Side by Side Diff: Source/web/tests/mocks/MockRequest.h

Issue 1313013005: Add a test that we resume commits after inserting the body. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: remove extra incs. Created 5 years, 3 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright 2015 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 MockRequest_h
6 #define MockRequest_h
7
8 #include "public/platform/WebURLError.h"
9 #include "public/platform/WebURLResponse.h"
10 #include "wtf/text/WTFString.h"
11
12 namespace blink {
13
14 class MockNetwork;
15 class WebURLLoader;
16 class WebURLLoaderClient;
17
18 class MockRequest {
19 public:
20 MockRequest(String url, String mimeType);
21
22 void didReceiveResponse(WebURLLoaderClient*, WebURLLoader*, const WebURLResp onse&);
23 void didFail(const WebURLError&);
24
25 void start();
26 void write(const String& data);
27 void finish();
28
29 bool isReady() const { return m_isReady; }
30 const String& url() const { return m_url; }
31 const WebURLError& error() const { return m_error; }
32 const WebURLResponse& response() const { return m_response; }
33
34 void reset();
35
36 private:
37 String m_url;
38 WebURLLoader* m_loader;
39 WebURLResponse m_response;
40 WebURLError m_error;
41 WebURLLoaderClient* m_client;
42 unsigned m_totalEncodedDataLength;
43 bool m_isReady;
44 };
45
46 } // namespace blink
47
48 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698