activation-after-bfcache-cross-origin.html (1231B)
1 <!doctype html> 2 <script src="/resources/testharness.js"></script> 3 <script src="/resources/testharnessreport.js"></script> 4 <script src="/common/utils.js"></script> 5 <script src="/common/dispatcher/dispatcher.js"></script> 6 <script src="/html/browsers/browsing-the-web/back-forward-cache/resources/helper.sub.js"></script> 7 <script src="resources/is_uuid.js"></script> 8 9 <script> 10 // This test ensures that navigation.activation is properly updated when a page 11 // is restored from bfcache. 12 runBfcacheTest({ 13 targetOrigin: originSameSite, 14 async funcAfterAssertion(pageA, pageB) { 15 const activationData = await pageA.execute_script(() => { 16 return { entryURL : navigation.activation.entry.url, 17 fromIsNull : navigation.activation.from === null, 18 navigationType : navigation.activation.navigationType } 19 }); 20 21 // activation.entry should be the currently activated page, and 22 // activation.from should be omitted because it is a different origin. 23 assert_equals(activationData.entryURL, pageA.url); 24 assert_true(activationData.fromIsNull); 25 assert_equals(activationData.navigationType, "traverse"); 26 } 27 }, "navigation.activation must be updated when restored from bfcache"); 28 </script>