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

Side by Side Diff: content/test/weburl_loader_mock.h

Issue 63253002: Rename WebKit namespace to blink (part 3) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month 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
« no previous file with comments | « content/test/webkit_support.cc ('k') | content/test/weburl_loader_mock.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 CONTENT_TEST_WEBURL_LOADER_MOCK_H_ 5 #ifndef CONTENT_TEST_WEBURL_LOADER_MOCK_H_
6 #define CONTENT_TEST_WEBURL_LOADER_MOCK_H_ 6 #define CONTENT_TEST_WEBURL_LOADER_MOCK_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "third_party/WebKit/public/platform/WebURLLoader.h" 10 #include "third_party/WebKit/public/platform/WebURLLoader.h"
11 11
12 namespace WebKit { 12 namespace blink {
13 class WebData; 13 class WebData;
14 struct WebURLError; 14 struct WebURLError;
15 class WebURLLoaderClient; 15 class WebURLLoaderClient;
16 class WebURLRequest; 16 class WebURLRequest;
17 class WebURLResponse; 17 class WebURLResponse;
18 } 18 }
19 19
20 class WebURLLoaderMockFactory; 20 class WebURLLoaderMockFactory;
21 21
22 // A simple class for mocking WebURLLoader. 22 // A simple class for mocking WebURLLoader.
23 // If the WebURLLoaderMockFactory it is associated with has been configured to 23 // If the WebURLLoaderMockFactory it is associated with has been configured to
24 // mock the request it gets, it serves the mocked resource. Otherwise it just 24 // mock the request it gets, it serves the mocked resource. Otherwise it just
25 // forwards it to the default loader. 25 // forwards it to the default loader.
26 class WebURLLoaderMock : public WebKit::WebURLLoader { 26 class WebURLLoaderMock : public blink::WebURLLoader {
27 public: 27 public:
28 // This object becomes the owner of |default_loader|. 28 // This object becomes the owner of |default_loader|.
29 WebURLLoaderMock(WebURLLoaderMockFactory* factory, 29 WebURLLoaderMock(WebURLLoaderMockFactory* factory,
30 WebKit::WebURLLoader* default_loader); 30 blink::WebURLLoader* default_loader);
31 virtual ~WebURLLoaderMock(); 31 virtual ~WebURLLoaderMock();
32 32
33 // Simulates the asynchronous request being served. 33 // Simulates the asynchronous request being served.
34 void ServeAsynchronousRequest(const WebKit::WebURLResponse& response, 34 void ServeAsynchronousRequest(const blink::WebURLResponse& response,
35 const WebKit::WebData& data, 35 const blink::WebData& data,
36 const WebKit::WebURLError& error); 36 const blink::WebURLError& error);
37 37
38 // Simulates the redirect being served. 38 // Simulates the redirect being served.
39 WebKit::WebURLRequest ServeRedirect( 39 blink::WebURLRequest ServeRedirect(
40 const WebKit::WebURLResponse& redirectResponse); 40 const blink::WebURLResponse& redirectResponse);
41 41
42 // WebURLLoader methods: 42 // WebURLLoader methods:
43 virtual void loadSynchronously(const WebKit::WebURLRequest& request, 43 virtual void loadSynchronously(const blink::WebURLRequest& request,
44 WebKit::WebURLResponse& response, 44 blink::WebURLResponse& response,
45 WebKit::WebURLError& error, 45 blink::WebURLError& error,
46 WebKit::WebData& data); 46 blink::WebData& data);
47 virtual void loadAsynchronously(const WebKit::WebURLRequest& request, 47 virtual void loadAsynchronously(const blink::WebURLRequest& request,
48 WebKit::WebURLLoaderClient* client); 48 blink::WebURLLoaderClient* client);
49 virtual void cancel(); 49 virtual void cancel();
50 virtual void setDefersLoading(bool defer); 50 virtual void setDefersLoading(bool defer);
51 51
52 bool isDeferred() { return is_deferred_; } 52 bool isDeferred() { return is_deferred_; }
53 53
54 private: 54 private:
55 WebURLLoaderMockFactory* factory_; 55 WebURLLoaderMockFactory* factory_;
56 WebKit::WebURLLoaderClient* client_; 56 blink::WebURLLoaderClient* client_;
57 scoped_ptr<WebKit::WebURLLoader> default_loader_; 57 scoped_ptr<blink::WebURLLoader> default_loader_;
58 bool using_default_loader_; 58 bool using_default_loader_;
59 bool is_deferred_; 59 bool is_deferred_;
60 60
61 DISALLOW_COPY_AND_ASSIGN(WebURLLoaderMock); 61 DISALLOW_COPY_AND_ASSIGN(WebURLLoaderMock);
62 }; 62 };
63 63
64 #endif // CONTENT_TEST_WEBURL_LOADER_MOCK_H_ 64 #endif // CONTENT_TEST_WEBURL_LOADER_MOCK_H_
OLDNEW
« no previous file with comments | « content/test/webkit_support.cc ('k') | content/test/weburl_loader_mock.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698