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

Side by Side Diff: content/browser/security_exploit_browsertest.cc

Issue 187843005: Remove stale frame ID references for RequestTransferURL. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove incorrect check. Created 6 years, 9 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
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 "base/command_line.h" 5 #include "base/command_line.h"
6 #include "base/containers/hash_tables.h" 6 #include "base/containers/hash_tables.h"
7 #include "content/browser/dom_storage/dom_storage_context_wrapper.h" 7 #include "content/browser/dom_storage/dom_storage_context_wrapper.h"
8 #include "content/browser/dom_storage/session_storage_namespace_impl.h" 8 #include "content/browser/dom_storage/session_storage_namespace_impl.h"
9 #include "content/browser/frame_host/navigator.h" 9 #include "content/browser/frame_host/navigator.h"
10 #include "content/browser/renderer_host/render_view_host_factory.h" 10 #include "content/browser/renderer_host/render_view_host_factory.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 shell2->web_contents()->GetRenderViewHost()->GetRoutingID(); 53 shell2->web_contents()->GetRenderViewHost()->GetRoutingID();
54 EXPECT_NE(*target_routing_id, 54 EXPECT_NE(*target_routing_id,
55 shell->web_contents()->GetRenderViewHost()->GetRoutingID()); 55 shell->web_contents()->GetRenderViewHost()->GetRoutingID());
56 56
57 // Now, simulate a link click coming from the renderer. 57 // Now, simulate a link click coming from the renderer.
58 GURL extension_url("https://bar.com/files/simple_page.html"); 58 GURL extension_url("https://bar.com/files/simple_page.html");
59 WebContentsImpl* wc = static_cast<WebContentsImpl*>(shell->web_contents()); 59 WebContentsImpl* wc = static_cast<WebContentsImpl*>(shell->web_contents());
60 wc->GetFrameTree()->root()->navigator()->RequestOpenURL( 60 wc->GetFrameTree()->root()->navigator()->RequestOpenURL(
61 wc->GetFrameTree()->root()->current_frame_host(), extension_url, 61 wc->GetFrameTree()->root()->current_frame_host(), extension_url,
62 Referrer(), CURRENT_TAB, 62 Referrer(), CURRENT_TAB,
63 wc->GetFrameTree()->root()->current_frame_host()->GetRoutingID(),
64 false, true); 63 false, true);
65 64
66 // Since the navigation above requires a cross-process swap, there will be a 65 // Since the navigation above requires a cross-process swap, there will be a
67 // pending RenderViewHost. Ensure it exists and is in a different process 66 // pending RenderViewHost. Ensure it exists and is in a different process
68 // than the initial page. 67 // than the initial page.
69 RenderViewHostImpl* pending_rvh = 68 RenderViewHostImpl* pending_rvh =
70 wc->GetRenderManagerForTesting()->pending_render_view_host(); 69 wc->GetRenderManagerForTesting()->pending_render_view_host();
71 EXPECT_TRUE(pending_rvh != NULL); 70 EXPECT_TRUE(pending_rvh != NULL);
72 EXPECT_NE(shell->web_contents()->GetRenderViewHost()->GetProcess()->GetID(), 71 EXPECT_NE(shell->web_contents()->GetRenderViewHost()->GetProcess()->GetID(),
73 pending_rvh->GetProcess()->GetID()); 72 pending_rvh->GetProcess()->GetID());
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 // Since this test executes on the UI thread and hopping threads might cause 158 // Since this test executes on the UI thread and hopping threads might cause
160 // different timing in the test, let's simulate a CreateNewWidget call coming 159 // different timing in the test, let's simulate a CreateNewWidget call coming
161 // from the IO thread. Use the existing window routing id to cause a 160 // from the IO thread. Use the existing window routing id to cause a
162 // deliberate collision. 161 // deliberate collision.
163 pending_rvh->CreateNewWidget(duplicate_routing_id, blink::WebPopupTypeSelect); 162 pending_rvh->CreateNewWidget(duplicate_routing_id, blink::WebPopupTypeSelect);
164 163
165 // If the above operation doesn't crash, the test has succeeded! 164 // If the above operation doesn't crash, the test has succeeded!
166 } 165 }
167 166
168 } // namespace content 167 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698