OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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/basictypes.h" | 5 #include "base/basictypes.h" |
6 #include "base/bind.h" | 6 #include "base/bind.h" |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
(...skipping 3233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3244 NavigationControllerImpl& controller = controller_impl(); | 3244 NavigationControllerImpl& controller = controller_impl(); |
3245 Navigator* navigator = | 3245 Navigator* navigator = |
3246 contents()->GetFrameTree()->root()->navigator(); | 3246 contents()->GetFrameTree()->root()->navigator(); |
3247 | 3247 |
3248 const GURL url1("nonexistent:12121"); | 3248 const GURL url1("nonexistent:12121"); |
3249 const GURL url1_fixed("http://nonexistent:12121/"); | 3249 const GURL url1_fixed("http://nonexistent:12121/"); |
3250 const GURL url2("http://foo"); | 3250 const GURL url2("http://foo"); |
3251 | 3251 |
3252 // We create pending entries for renderer-initiated navigations so that we | 3252 // We create pending entries for renderer-initiated navigations so that we |
3253 // can show them in new tabs when it is safe. | 3253 // can show them in new tabs when it is safe. |
3254 main_test_rfh()->SendRendererInitiatedNavigationRequest(url1, false); | |
3255 main_test_rfh()->PrepareForCommit(); | |
Charlie Reis
2015/05/28 17:02:27
These two lines are only needed for PlzNavigate, r
nasko
2015/05/28 17:16:44
While they are fairly PlzNavigate specific, in my
Charlie Reis
2015/05/28 17:40:19
Ok.
| |
3254 navigator->DidStartProvisionalLoad(main_test_rfh(), url1); | 3256 navigator->DidStartProvisionalLoad(main_test_rfh(), url1); |
3255 | 3257 |
3256 // Simulate what happens if a BrowserURLHandler rewrites the URL, causing | 3258 // Simulate what happens if a BrowserURLHandler rewrites the URL, causing |
3257 // the virtual URL to differ from the URL. | 3259 // the virtual URL to differ from the URL. |
3258 controller.GetPendingEntry()->SetURL(url1_fixed); | 3260 controller.GetPendingEntry()->SetURL(url1_fixed); |
3259 controller.GetPendingEntry()->SetVirtualURL(url1); | 3261 controller.GetPendingEntry()->SetVirtualURL(url1); |
3260 | 3262 |
3261 EXPECT_EQ(url1_fixed, controller.GetPendingEntry()->GetURL()); | 3263 EXPECT_EQ(url1_fixed, controller.GetPendingEntry()->GetURL()); |
3262 EXPECT_EQ(url1, controller.GetPendingEntry()->GetVirtualURL()); | 3264 EXPECT_EQ(url1, controller.GetPendingEntry()->GetVirtualURL()); |
3263 EXPECT_TRUE(controller.GetPendingEntry()->is_renderer_initiated()); | 3265 EXPECT_TRUE(controller.GetPendingEntry()->is_renderer_initiated()); |
(...skipping 1630 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4894 { | 4896 { |
4895 LoadCommittedDetails details; | 4897 LoadCommittedDetails details; |
4896 controller_impl().RendererDidNavigate(main_test_rfh(), params, &details); | 4898 controller_impl().RendererDidNavigate(main_test_rfh(), params, &details); |
4897 EXPECT_EQ(PAGE_TYPE_ERROR, | 4899 EXPECT_EQ(PAGE_TYPE_ERROR, |
4898 controller_impl().GetLastCommittedEntry()->GetPageType()); | 4900 controller_impl().GetLastCommittedEntry()->GetPageType()); |
4899 EXPECT_EQ(NAVIGATION_TYPE_IN_PAGE, details.type); | 4901 EXPECT_EQ(NAVIGATION_TYPE_IN_PAGE, details.type); |
4900 } | 4902 } |
4901 } | 4903 } |
4902 | 4904 |
4903 } // namespace content | 4905 } // namespace content |
OLD | NEW |