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

Side by Side Diff: content/public/test/render_view_test.cc

Issue 1202593002: Move browser-to-renderer opener plumbing to frame routing IDs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@opener-create-opener-render-views
Patch Set: More cleanup Created 5 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
OLDNEW
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 #include "content/public/test/render_view_test.h" 5 #include "content/public/test/render_view_test.h"
6 6
7 #include <cctype> 7 #include <cctype>
8 8
9 #include "base/location.h" 9 #include "base/location.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 using blink::WebGestureEvent; 51 using blink::WebGestureEvent;
52 using blink::WebInputEvent; 52 using blink::WebInputEvent;
53 using blink::WebLocalFrame; 53 using blink::WebLocalFrame;
54 using blink::WebMouseEvent; 54 using blink::WebMouseEvent;
55 using blink::WebScriptSource; 55 using blink::WebScriptSource;
56 using blink::WebString; 56 using blink::WebString;
57 using blink::WebURLRequest; 57 using blink::WebURLRequest;
58 58
59 namespace { 59 namespace {
60 60
61 const int32 kOpenerId = -2;
62 const int32 kRouteId = 5; 61 const int32 kRouteId = 5;
63 const int32 kMainFrameRouteId = 6; 62 const int32 kMainFrameRouteId = 6;
64 const int32 kNewWindowRouteId = 7; 63 const int32 kNewWindowRouteId = 7;
65 const int32 kNewFrameRouteId = 10; 64 const int32 kNewFrameRouteId = 10;
66 const int32 kSurfaceId = 42; 65 const int32 kSurfaceId = 42;
67 66
68 // Converts |ascii_character| into |key_code| and returns true on success. 67 // Converts |ascii_character| into |key_code| and returns true on success.
69 // Handles only the characters needed by tests. 68 // Handles only the characters needed by tests.
70 bool GetWindowsKeyCode(char ascii_character, int* key_code) { 69 bool GetWindowsKeyCode(char ascii_character, int* key_code) {
71 if (isalnum(ascii_character)) { 70 if (isalnum(ascii_character)) {
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 // suite implementation than for content_unittests). For browser_tests, this 229 // suite implementation than for content_unittests). For browser_tests, this
231 // is already initialized. 230 // is already initialized.
232 if (!ui::ResourceBundle::HasSharedInstance()) 231 if (!ui::ResourceBundle::HasSharedInstance())
233 ui::ResourceBundle::InitSharedInstanceWithLocale( 232 ui::ResourceBundle::InitSharedInstanceWithLocale(
234 "en-US", NULL, ui::ResourceBundle::DO_NOT_LOAD_COMMON_RESOURCES); 233 "en-US", NULL, ui::ResourceBundle::DO_NOT_LOAD_COMMON_RESOURCES);
235 234
236 compositor_deps_.reset(new FakeCompositorDependencies); 235 compositor_deps_.reset(new FakeCompositorDependencies);
237 mock_process_.reset(new MockRenderProcess); 236 mock_process_.reset(new MockRenderProcess);
238 237
239 ViewMsg_New_Params view_params; 238 ViewMsg_New_Params view_params;
240 view_params.opener_route_id = kOpenerId; 239 view_params.opener_frame_route_id = MSG_ROUTING_NONE;
241 view_params.window_was_created_with_opener = false; 240 view_params.window_was_created_with_opener = false;
242 view_params.renderer_preferences = RendererPreferences(); 241 view_params.renderer_preferences = RendererPreferences();
243 view_params.web_preferences = WebPreferences(); 242 view_params.web_preferences = WebPreferences();
244 view_params.view_id = kRouteId; 243 view_params.view_id = kRouteId;
245 view_params.main_frame_routing_id = kMainFrameRouteId; 244 view_params.main_frame_routing_id = kMainFrameRouteId;
246 view_params.surface_id = kSurfaceId; 245 view_params.surface_id = kSurfaceId;
247 view_params.session_storage_namespace_id = kInvalidSessionStorageNamespaceId; 246 view_params.session_storage_namespace_id = kInvalidSessionStorageNamespaceId;
248 view_params.swapped_out = false; 247 view_params.swapped_out = false;
249 view_params.replicated_frame_state = FrameReplicationState(); 248 view_params.replicated_frame_state = FrameReplicationState();
250 view_params.proxy_routing_id = MSG_ROUTING_NONE; 249 view_params.proxy_routing_id = MSG_ROUTING_NONE;
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after
578 TestRenderFrame* frame = 577 TestRenderFrame* frame =
579 static_cast<TestRenderFrame*>(impl->GetMainRenderFrame()); 578 static_cast<TestRenderFrame*>(impl->GetMainRenderFrame());
580 frame->Navigate(common_params, StartNavigationParams(), request_params); 579 frame->Navigate(common_params, StartNavigationParams(), request_params);
581 580
582 // The load actually happens asynchronously, so we pump messages to process 581 // The load actually happens asynchronously, so we pump messages to process
583 // the pending continuation. 582 // the pending continuation.
584 FrameLoadWaiter(frame).Wait(); 583 FrameLoadWaiter(frame).Wait();
585 } 584 }
586 585
587 } // namespace content 586 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698