Changeset 150645 in webkit
- Timestamp:
- May 24, 2013 10:16:24 AM (11 years ago)
- Location:
- trunk/LayoutTests
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r150643 r150645 1 2013-05-24 Manuel Rego Casasnovas <rego@igalia.com> 2 3 Improve loader/go-back-cached-main-resource.html test 4 https://bugs.webkit.org/show_bug.cgi?id=116709 5 6 Reviewed by Alexey Proskuryakov. 7 8 It is only needed to register the listeners on the initial load as they 9 are already present when restoring from page cache. Modified the test to 10 use event.persisted property to know if we are handling the first load 11 in order to register the listeners only once. 12 13 * loader/resources/first-page.html: Rename registerListeners() function 14 to a more accurate name didShowPage() and use event.persisted to 15 register the listeners only in the first load. 16 * loader/resources/other-page.html: Ditto. 17 1 18 2013-05-24 Noam Rosenthal <noam@webkit.org> 2 19 -
trunk/LayoutTests/loader/resources/first-page.html
r150594 r150645 2 2 <head> 3 3 <script> 4 function registerListeners() {4 function didShowPage() { 5 5 // Notify opener. 6 6 opener.postMessage('first-page', '*'); 7 7 8 // Our opener will tell us to perform various loads. 9 window.addEventListener('message', function(event) { 8 // We register the listeners in the initial load (this is not needed 9 // when the page is restored from cache). 10 if (!event.persisted) { 11 // Our opener will tell us to perform various loads. 12 window.addEventListener('message', function(event) { 10 13 11 // Navigate to other page.12 if (event.data === 'navigate-other-page') {13 window.location = 'other-page.html';14 return;15 }14 // Navigate to other page. 15 if (event.data === 'navigate-other-page') { 16 window.location = 'other-page.html'; 17 return; 18 } 16 19 17 }, false); 20 }, false); 21 } 18 22 } 19 23 </script> 20 24 </head> 21 <body onpageshow=" registerListeners();">25 <body onpageshow="didShowPage();"> 22 26 </body> 23 27 </html> -
trunk/LayoutTests/loader/resources/other-page.html
r150594 r150645 2 2 <head> 3 3 <script> 4 function registerListeners() {4 function didShowPage() { 5 5 // Notify opener. 6 6 opener.postMessage('other-page', '*'); 7 7 8 // Our opener will tell us to perform various loads. 9 window.addEventListener('message', function(event) { 8 // We register the listeners in the initial load (this is not needed 9 // when the page is restored from cache). 10 if (!event.persisted) { 11 // Our opener will tell us to perform various loads. 12 window.addEventListener('message', function(event) { 10 13 11 // Navigate first resource.12 if (event.data === 'navigate-first-page') {13 window.location = 'first-page.html';14 return;15 }14 // Navigate first resource. 15 if (event.data === 'navigate-first-page') { 16 window.location = 'first-page.html'; 17 return; 18 } 16 19 17 // Navigate back.18 if (event.data === 'navigate-back') {19 window.history.back();20 return;21 }20 // Navigate back. 21 if (event.data === 'navigate-back') { 22 window.history.back(); 23 return; 24 } 22 25 23 }, false); 26 }, false); 27 } 24 28 } 25 29 </script> 26 30 </head> 27 <body onpageshow=" registerListeners();">31 <body onpageshow="didShowPage();"> 28 32 </body> 29 33 </html>
Note: See TracChangeset
for help on using the changeset viewer.