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

Side by Side Diff: webkit/support/weburl_loader_mock_factory.h

Issue 10735037: Add WebURLLoaderMockFactory::GetLastHandledAsynchronousRequest. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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
« no previous file with comments | « webkit/support/webkit_support.cc ('k') | webkit/support/weburl_loader_mock_factory.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 (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 WEBKIT_SUPPORT_WEBURL_LOADER_MOCK_FACTORY_H_ 5 #ifndef WEBKIT_SUPPORT_WEBURL_LOADER_MOCK_FACTORY_H_
6 #define WEBKIT_SUPPORT_WEBURL_LOADER_MOCK_FACTORY_H_ 6 #define WEBKIT_SUPPORT_WEBURL_LOADER_MOCK_FACTORY_H_
7 7
8 #include <map> 8 #include <map>
9 9
10 #include "base/file_path.h" 10 #include "base/file_path.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 45
46 // Unregisters |url| so it will no longer be mocked. 46 // Unregisters |url| so it will no longer be mocked.
47 void UnregisterURL(const WebKit::WebURL& url); 47 void UnregisterURL(const WebKit::WebURL& url);
48 48
49 // Unregister all URLs so no URL will be mocked anymore. 49 // Unregister all URLs so no URL will be mocked anymore.
50 void UnregisterAllURLs(); 50 void UnregisterAllURLs();
51 51
52 // Serves all the pending asynchronous requests. 52 // Serves all the pending asynchronous requests.
53 void ServeAsynchronousRequests(); 53 void ServeAsynchronousRequests();
54 54
55 // Returns the last request handled by |ServeAsynchronousRequests()|.
56 WebKit::WebURLRequest GetLastHandledAsynchronousRequest();
57
55 // Returns true if |url| was registered for being mocked. 58 // Returns true if |url| was registered for being mocked.
56 bool IsMockedURL(const WebKit::WebURL& url); 59 bool IsMockedURL(const WebKit::WebURL& url);
57 60
58 // Called by the loader to load a resource. 61 // Called by the loader to load a resource.
59 void LoadSynchronously(const WebKit::WebURLRequest& request, 62 void LoadSynchronously(const WebKit::WebURLRequest& request,
60 WebKit::WebURLResponse* response, 63 WebKit::WebURLResponse* response,
61 WebKit::WebURLError* error, 64 WebKit::WebURLError* error,
62 WebKit::WebData* data); 65 WebKit::WebData* data);
63 void LoadAsynchronouly(const WebKit::WebURLRequest& request, 66 void LoadAsynchronouly(const WebKit::WebURLRequest& request,
64 WebURLLoaderMock* loader); 67 WebURLLoaderMock* loader);
(...skipping 19 matching lines...) Expand all
84 static bool ReadFile(const FilePath& file_path, WebKit::WebData* data); 87 static bool ReadFile(const FilePath& file_path, WebKit::WebData* data);
85 88
86 // The loaders that have not being served data yet. 89 // The loaders that have not being served data yet.
87 typedef std::map<WebURLLoaderMock*, WebKit::WebURLRequest> LoaderToRequestMap; 90 typedef std::map<WebURLLoaderMock*, WebKit::WebURLRequest> LoaderToRequestMap;
88 LoaderToRequestMap pending_loaders_; 91 LoaderToRequestMap pending_loaders_;
89 92
90 // Table of the registered URLs and the responses that they should receive. 93 // Table of the registered URLs and the responses that they should receive.
91 typedef std::map<WebKit::WebURL, ResponseInfo> URLToResponseMap; 94 typedef std::map<WebKit::WebURL, ResponseInfo> URLToResponseMap;
92 URLToResponseMap url_to_reponse_info_; 95 URLToResponseMap url_to_reponse_info_;
93 96
97 WebKit::WebURLRequest last_handled_asynchronous_request_;
98
94 DISALLOW_COPY_AND_ASSIGN(WebURLLoaderMockFactory); 99 DISALLOW_COPY_AND_ASSIGN(WebURLLoaderMockFactory);
95 }; 100 };
96 101
97 #endif // WEBKIT_SUPPORT_WEBURL_LOADER_MOCK_FACTORY_H_ 102 #endif // WEBKIT_SUPPORT_WEBURL_LOADER_MOCK_FACTORY_H_
98 103
OLDNEW
« no previous file with comments | « webkit/support/webkit_support.cc ('k') | webkit/support/weburl_loader_mock_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698