| 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 CONTENT_TEST_TEST_RENDER_VIEW_HOST_H_ | 5 #ifndef CONTENT_TEST_TEST_RENDER_VIEW_HOST_H_ |
| 6 #define CONTENT_TEST_TEST_RENDER_VIEW_HOST_H_ | 6 #define CONTENT_TEST_TEST_RENDER_VIEW_HOST_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 | 197 |
| 198 void TestOnUpdateStateWithFile(const base::FilePath& file_path); | 198 void TestOnUpdateStateWithFile(const base::FilePath& file_path); |
| 199 | 199 |
| 200 void TestOnStartDragging(const DropData& drop_data); | 200 void TestOnStartDragging(const DropData& drop_data); |
| 201 | 201 |
| 202 // If set, *delete_counter is incremented when this object destructs. | 202 // If set, *delete_counter is incremented when this object destructs. |
| 203 void set_delete_counter(int* delete_counter) { | 203 void set_delete_counter(int* delete_counter) { |
| 204 delete_counter_ = delete_counter; | 204 delete_counter_ = delete_counter; |
| 205 } | 205 } |
| 206 | 206 |
| 207 // If set, *webkit_preferences_changed_counter is incremented when |
| 208 // OnWebkitPreferencesChanged() is called. |
| 209 void set_webkit_preferences_changed_counter(int* counter) { |
| 210 webkit_preferences_changed_counter_ = counter; |
| 211 } |
| 212 |
| 207 // The opener frame route id passed to CreateRenderView(). | 213 // The opener frame route id passed to CreateRenderView(). |
| 208 int opener_frame_route_id() const { return opener_frame_route_id_; } | 214 int opener_frame_route_id() const { return opener_frame_route_id_; } |
| 209 | 215 |
| 210 // RenderWidgetHost overrides (same value, but in the Mock* type) | 216 // RenderWidgetHost overrides (same value, but in the Mock* type) |
| 211 MockRenderProcessHost* GetProcess() const override; | 217 MockRenderProcessHost* GetProcess() const override; |
| 212 | 218 |
| 213 bool CreateTestRenderView(const base::string16& frame_name, | 219 bool CreateTestRenderView(const base::string16& frame_name, |
| 214 int opener_frame_route_id, | 220 int opener_frame_route_id, |
| 215 int proxy_route_id, | 221 int proxy_route_id, |
| 216 bool window_was_created_with_opener) override; | 222 bool window_was_created_with_opener) override; |
| 217 | 223 |
| 218 // RenderViewHost overrides -------------------------------------------------- | 224 // RenderViewHost overrides -------------------------------------------------- |
| 219 | 225 |
| 220 bool CreateRenderView(int opener_frame_route_id, | 226 bool CreateRenderView(int opener_frame_route_id, |
| 221 int proxy_route_id, | 227 int proxy_route_id, |
| 222 const FrameReplicationState& replicated_frame_state, | 228 const FrameReplicationState& replicated_frame_state, |
| 223 bool window_was_created_with_opener) override; | 229 bool window_was_created_with_opener) override; |
| 230 void OnWebkitPreferencesChanged() override; |
| 224 | 231 |
| 225 private: | 232 private: |
| 226 FRIEND_TEST_ALL_PREFIXES(RenderViewHostTest, FilterNavigate); | 233 FRIEND_TEST_ALL_PREFIXES(RenderViewHostTest, FilterNavigate); |
| 227 | 234 |
| 228 void SendNavigateWithTransitionAndResponseCode(const GURL& url, | 235 void SendNavigateWithTransitionAndResponseCode(const GURL& url, |
| 229 ui::PageTransition transition, | 236 ui::PageTransition transition, |
| 230 int response_code); | 237 int response_code); |
| 231 | 238 |
| 232 // Calls OnNavigate on the RenderViewHost with the given information. | 239 // Calls OnNavigate on the RenderViewHost with the given information. |
| 233 // Sets the rest of the parameters in the message to the "typical" values. | 240 // Sets the rest of the parameters in the message to the "typical" values. |
| 234 // This is a helper function for simulating the most common types of loads. | 241 // This is a helper function for simulating the most common types of loads. |
| 235 void SendNavigateWithParameters( | 242 void SendNavigateWithParameters( |
| 236 const GURL& url, | 243 const GURL& url, |
| 237 ui::PageTransition transition, | 244 ui::PageTransition transition, |
| 238 const GURL& original_request_url, | 245 const GURL& original_request_url, |
| 239 int response_code, | 246 int response_code, |
| 240 const base::FilePath* file_path_for_history_item); | 247 const base::FilePath* file_path_for_history_item); |
| 241 | 248 |
| 242 // See set_delete_counter() above. May be NULL. | 249 // See set_delete_counter() above. May be NULL. |
| 243 int* delete_counter_; | 250 int* delete_counter_; |
| 244 | 251 |
| 252 // See set_webkit_preferences_changed_counter() above. May be NULL. |
| 253 int* webkit_preferences_changed_counter_; |
| 254 |
| 245 // See opener_frame_route_id() above. | 255 // See opener_frame_route_id() above. |
| 246 int opener_frame_route_id_; | 256 int opener_frame_route_id_; |
| 247 | 257 |
| 248 DISALLOW_COPY_AND_ASSIGN(TestRenderViewHost); | 258 DISALLOW_COPY_AND_ASSIGN(TestRenderViewHost); |
| 249 }; | 259 }; |
| 250 | 260 |
| 251 #if defined(COMPILER_MSVC) | 261 #if defined(COMPILER_MSVC) |
| 252 #pragma warning(pop) | 262 #pragma warning(pop) |
| 253 #endif | 263 #endif |
| 254 | 264 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 294 private: | 304 private: |
| 295 typedef std::unique_ptr<ui::test::ScopedSetSupportedScaleFactors> | 305 typedef std::unique_ptr<ui::test::ScopedSetSupportedScaleFactors> |
| 296 ScopedSetSupportedScaleFactors; | 306 ScopedSetSupportedScaleFactors; |
| 297 ScopedSetSupportedScaleFactors scoped_set_supported_scale_factors_; | 307 ScopedSetSupportedScaleFactors scoped_set_supported_scale_factors_; |
| 298 DISALLOW_COPY_AND_ASSIGN(RenderViewHostImplTestHarness); | 308 DISALLOW_COPY_AND_ASSIGN(RenderViewHostImplTestHarness); |
| 299 }; | 309 }; |
| 300 | 310 |
| 301 } // namespace content | 311 } // namespace content |
| 302 | 312 |
| 303 #endif // CONTENT_TEST_TEST_RENDER_VIEW_HOST_H_ | 313 #endif // CONTENT_TEST_TEST_RENDER_VIEW_HOST_H_ |
| OLD | NEW |