OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <stdint.h> | 5 #include <stdint.h> |
6 | 6 |
7 #include "base/feature_list.h" | 7 #include "base/feature_list.h" |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 if (AreAllSitesIsolatedForTesting()) { | 245 if (AreAllSitesIsolatedForTesting()) { |
246 EXPECT_TRUE( | 246 EXPECT_TRUE( |
247 DidRenderFrameHostRequestCommit(GetSpeculativeRenderFrameHost(node))); | 247 DidRenderFrameHostRequestCommit(GetSpeculativeRenderFrameHost(node))); |
248 } else { | 248 } else { |
249 EXPECT_TRUE(DidRenderFrameHostRequestCommit(main_test_rfh())); | 249 EXPECT_TRUE(DidRenderFrameHostRequestCommit(main_test_rfh())); |
250 } | 250 } |
251 EXPECT_TRUE(main_test_rfh()->is_loading()); | 251 EXPECT_TRUE(main_test_rfh()->is_loading()); |
252 EXPECT_FALSE(node->navigation_request()); | 252 EXPECT_FALSE(node->navigation_request()); |
253 | 253 |
254 // Commit the navigation. | 254 // Commit the navigation. |
255 main_test_rfh()->SendNavigate(0, true, kUrl2); | 255 if (AreAllSitesIsolatedForTesting()) { |
| 256 GetSpeculativeRenderFrameHost(node)->SendNavigate(0, true, kUrl2); |
| 257 } else { |
| 258 main_test_rfh()->SendNavigate(0, true, kUrl2); |
| 259 } |
256 EXPECT_TRUE(main_test_rfh()->is_active()); | 260 EXPECT_TRUE(main_test_rfh()->is_active()); |
257 EXPECT_EQ(kUrl2, contents()->GetLastCommittedURL()); | 261 EXPECT_EQ(kUrl2, contents()->GetLastCommittedURL()); |
258 EXPECT_FALSE(GetSpeculativeRenderFrameHost(node)); | 262 EXPECT_FALSE(GetSpeculativeRenderFrameHost(node)); |
259 EXPECT_FALSE(node->render_manager()->pending_frame_host()); | 263 EXPECT_FALSE(node->render_manager()->pending_frame_host()); |
260 | 264 |
261 // The SiteInstance did not change. | 265 // The SiteInstance did not change unless site-per-process is enabled. |
262 EXPECT_EQ(site_instance_id_1, main_test_rfh()->GetSiteInstance()->GetId()); | 266 if (AreAllSitesIsolatedForTesting()) { |
| 267 EXPECT_NE(site_instance_id_1, main_test_rfh()->GetSiteInstance()->GetId()); |
| 268 } else { |
| 269 EXPECT_EQ(site_instance_id_1, main_test_rfh()->GetSiteInstance()->GetId()); |
| 270 } |
263 } | 271 } |
264 | 272 |
265 // PlzNavigate: Test that a beforeUnload denial cancels the navigation. | 273 // PlzNavigate: Test that a beforeUnload denial cancels the navigation. |
266 TEST_F(NavigatorTestWithBrowserSideNavigation, | 274 TEST_F(NavigatorTestWithBrowserSideNavigation, |
267 BeforeUnloadDenialCancelNavigation) { | 275 BeforeUnloadDenialCancelNavigation) { |
268 const GURL kUrl1("http://www.google.com/"); | 276 const GURL kUrl1("http://www.google.com/"); |
269 const GURL kUrl2("http://www.chromium.org/"); | 277 const GURL kUrl2("http://www.chromium.org/"); |
270 | 278 |
271 contents()->NavigateAndCommit(kUrl1); | 279 contents()->NavigateAndCommit(kUrl1); |
272 | 280 |
(...skipping 1026 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1299 InitNavigateParams(¶ms, 1, false, kUrl2, | 1307 InitNavigateParams(¶ms, 1, false, kUrl2, |
1300 ui::PAGE_TRANSITION_AUTO_SUBFRAME); | 1308 ui::PAGE_TRANSITION_AUTO_SUBFRAME); |
1301 subframe_rfh->SendNavigateWithParams(¶ms); | 1309 subframe_rfh->SendNavigateWithParams(¶ms); |
1302 | 1310 |
1303 FeaturePolicy* subframe_feature_policy = subframe_rfh->feature_policy(); | 1311 FeaturePolicy* subframe_feature_policy = subframe_rfh->feature_policy(); |
1304 ASSERT_TRUE(subframe_feature_policy); | 1312 ASSERT_TRUE(subframe_feature_policy); |
1305 ASSERT_FALSE(subframe_feature_policy->origin_.unique()); | 1313 ASSERT_FALSE(subframe_feature_policy->origin_.unique()); |
1306 } | 1314 } |
1307 | 1315 |
1308 } // namespace content | 1316 } // namespace content |
OLD | NEW |