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 #include "content/test/test_web_contents.h" | 5 #include "content/test/test_web_contents.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "content/browser/browser_url_handler_impl.h" | 10 #include "content/browser/browser_url_handler_impl.h" |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 // navigate. | 150 // navigate. |
151 // PlzNavigate: the pending RFH is not created before the navigation commit, | 151 // PlzNavigate: the pending RFH is not created before the navigation commit, |
152 // so it is necessary to simulate the IO thread response here to commit in the | 152 // so it is necessary to simulate the IO thread response here to commit in the |
153 // proper renderer. It is necessary to call PrepareForCommit before getting | 153 // proper renderer. It is necessary to call PrepareForCommit before getting |
154 // the main and the pending frame because when we are trying to navigate to a | 154 // the main and the pending frame because when we are trying to navigate to a |
155 // webui from a new tab, a RenderFrameHost is created to display it that is | 155 // webui from a new tab, a RenderFrameHost is created to display it that is |
156 // committed immediately (since it is a new tab). Therefore the main frame is | 156 // committed immediately (since it is a new tab). Therefore the main frame is |
157 // replaced without a pending frame being created, and we don't get the right | 157 // replaced without a pending frame being created, and we don't get the right |
158 // values for the RFH to navigate: we try to use the old one that has been | 158 // values for the RFH to navigate: we try to use the old one that has been |
159 // deleted in the meantime. | 159 // deleted in the meantime. |
160 GetMainFrame()->PrepareForCommit(entry->GetURL()); | 160 GetMainFrame()->PrepareForCommit(); |
161 | 161 |
162 TestRenderFrameHost* old_rfh = GetMainFrame(); | 162 TestRenderFrameHost* old_rfh = GetMainFrame(); |
163 TestRenderFrameHost* rfh = GetPendingMainFrame(); | 163 TestRenderFrameHost* rfh = GetPendingMainFrame(); |
164 if (!rfh) | 164 if (!rfh) |
165 rfh = old_rfh; | 165 rfh = old_rfh; |
166 | 166 |
167 int page_id = entry->GetPageID(); | 167 int page_id = entry->GetPageID(); |
168 if (page_id == -1) { | 168 if (page_id == -1) { |
169 // It's a new navigation, assign a never-seen page id to it. | 169 // It's a new navigation, assign a never-seen page id to it. |
170 page_id = GetMaxPageIDForSiteInstance(rfh->GetSiteInstance()) + 1; | 170 page_id = GetMaxPageIDForSiteInstance(rfh->GetSiteInstance()) + 1; |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 } | 257 } |
258 | 258 |
259 void TestWebContents::ShowCreatedWidget(int route_id, | 259 void TestWebContents::ShowCreatedWidget(int route_id, |
260 const gfx::Rect& initial_rect) { | 260 const gfx::Rect& initial_rect) { |
261 } | 261 } |
262 | 262 |
263 void TestWebContents::ShowCreatedFullscreenWidget(int route_id) { | 263 void TestWebContents::ShowCreatedFullscreenWidget(int route_id) { |
264 } | 264 } |
265 | 265 |
266 } // namespace content | 266 } // namespace content |
OLD | NEW |