OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 void LoadRequest(const WebKit::WebURLRequest& request, | 82 void LoadRequest(const WebKit::WebURLRequest& request, |
83 WebKit::WebURLResponse* response, | 83 WebKit::WebURLResponse* response, |
84 WebKit::WebURLError* error, | 84 WebKit::WebURLError* error, |
85 WebKit::WebData* data); | 85 WebKit::WebData* data); |
86 | 86 |
87 // Checks if the loader is pending. Otherwise, it may have been deleted. | 87 // Checks if the loader is pending. Otherwise, it may have been deleted. |
88 bool IsPending(WebURLLoaderMock* loader); | 88 bool IsPending(WebURLLoaderMock* loader); |
89 | 89 |
90 // Reads |m_filePath| and puts its content in |data|. | 90 // Reads |m_filePath| and puts its content in |data|. |
91 // Returns true if it successfully read the file. | 91 // Returns true if it successfully read the file. |
92 static bool ReadFile(const FilePath& file_path, WebKit::WebData* data); | 92 static bool ReadFile(const base::FilePath& file_path, WebKit::WebData* data); |
93 | 93 |
94 // The loaders that have not being served data yet. | 94 // The loaders that have not being served data yet. |
95 typedef std::map<WebURLLoaderMock*, WebKit::WebURLRequest> LoaderToRequestMap; | 95 typedef std::map<WebURLLoaderMock*, WebKit::WebURLRequest> LoaderToRequestMap; |
96 LoaderToRequestMap pending_loaders_; | 96 LoaderToRequestMap pending_loaders_; |
97 | 97 |
98 typedef std::map<WebKit::WebURL, WebKit::WebURLError> URLToErrorMap; | 98 typedef std::map<WebKit::WebURL, WebKit::WebURLError> URLToErrorMap; |
99 URLToErrorMap url_to_error_info_; | 99 URLToErrorMap url_to_error_info_; |
100 | 100 |
101 // Table of the registered URLs and the responses that they should receive. | 101 // Table of the registered URLs and the responses that they should receive. |
102 typedef std::map<WebKit::WebURL, ResponseInfo> URLToResponseMap; | 102 typedef std::map<WebKit::WebURL, ResponseInfo> URLToResponseMap; |
103 URLToResponseMap url_to_reponse_info_; | 103 URLToResponseMap url_to_reponse_info_; |
104 | 104 |
105 WebKit::WebURLRequest last_handled_asynchronous_request_; | 105 WebKit::WebURLRequest last_handled_asynchronous_request_; |
106 | 106 |
107 DISALLOW_COPY_AND_ASSIGN(WebURLLoaderMockFactory); | 107 DISALLOW_COPY_AND_ASSIGN(WebURLLoaderMockFactory); |
108 }; | 108 }; |
109 | 109 |
110 #endif // WEBKIT_SUPPORT_WEBURL_LOADER_MOCK_FACTORY_H_ | 110 #endif // WEBKIT_SUPPORT_WEBURL_LOADER_MOCK_FACTORY_H_ |
111 | 111 |
OLD | NEW |