OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // RenderViewFakeResourcesTest can be used as a base class for tests that need | 5 // RenderViewFakeResourcesTest can be used as a base class for tests that need |
6 // to simulate loading network resources (such as http: urls) into a | 6 // to simulate loading network resources (such as http: urls) into a |
7 // RenderView. It does this by handling the relevant IPC messages that the | 7 // RenderView. It does this by handling the relevant IPC messages that the |
8 // renderer would normally send to the browser, and responding with static | 8 // renderer would normally send to the browser, and responding with static |
9 // content from an internal map. A request for a url that is not in the map | 9 // content from an internal map. A request for a url that is not in the map |
10 // will return a 404. Currently, content is always returned as text/html, and | 10 // will return a 404. Currently, content is always returned as text/html, and |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 RenderView* view_; // not owned, deletes itself on close | 133 RenderView* view_; // not owned, deletes itself on close |
134 | 134 |
135 // Map of url -> response body for network requests from the renderer. | 135 // Map of url -> response body for network requests from the renderer. |
136 // Any urls not in this map are served a 404 error. | 136 // Any urls not in this map are served a 404 error. |
137 std::map<std::string, std::string> responses_; | 137 std::map<std::string, std::string> responses_; |
138 | 138 |
139 private: | 139 private: |
140 // A helper for GoBack and GoForward. | 140 // A helper for GoBack and GoForward. |
141 void GoToOffset(int offset, const WebKit::WebHistoryItem& history_item); | 141 void GoToOffset(int offset, const WebKit::WebHistoryItem& history_item); |
142 | 142 |
| 143 // The previous state for whether sandbox support was enabled in |
| 144 // RenderViewWebKitPlatformSupportImpl. |
| 145 bool sandbox_was_enabled_; |
| 146 |
143 DISALLOW_COPY_AND_ASSIGN(RenderViewFakeResourcesTest); | 147 DISALLOW_COPY_AND_ASSIGN(RenderViewFakeResourcesTest); |
144 }; | 148 }; |
145 | 149 |
146 } // namespace content | 150 } // namespace content |
147 | 151 |
148 #endif // CONTENT_PUBLIC_TEST_RENDER_VIEW_FAKE_RESOURCES_TEST_H_ | 152 #endif // CONTENT_PUBLIC_TEST_RENDER_VIEW_FAKE_RESOURCES_TEST_H_ |
OLD | NEW |