OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <html> |
| 3 <head> |
| 4 <script> |
| 5 function runTest() |
| 6 { |
| 7 if (window.testRunner) { |
| 8 testRunner.dumpAsText(); |
| 9 testRunner.dumpChildFramesAsText(); |
| 10 } |
| 11 |
| 12 function removeFrameAndAddNewFrame(oldFrameId) { |
| 13 body = document.getElementById('body'); |
| 14 oldFrame = document.getElementById(oldFrameId); |
| 15 body.removeChild(oldFrame); |
| 16 |
| 17 // newFrame is added to the frame tree when the parent has the same numb
er of |
| 18 // children as when frame5 was being added. This will make |
| 19 // likelyUniqueSuffix the same for frame5 and newFrame - their unique |
| 20 // name will have to be different in some other way. |
| 21 newFrame = document.createElement('iframe'); |
| 22 newFrame.name = "sameName"; |
| 23 body.appendChild(newFrame); |
| 24 } |
| 25 |
| 26 removeFrameAndAddNewFrame('frame2') |
| 27 removeFrameAndAddNewFrame('frame3') |
| 28 } |
| 29 </script> |
| 30 </head> |
| 31 <body onload="runTest()" id="body"> |
| 32 <!-- |
| 33 Before https://crrev.com/1968213002 the name generated by |
| 34 FrameTree::generateOldStyleMaybeUniqueName would be assumed to be unique, but |
| 35 in reality could conflict with other names. This scenario is similar, but not |
| 36 the same as https://crbug.com/576969#c3. |
| 37 |
| 38 Additionaly, this test also exercises a scenario where the new |
| 39 FrameTree::generateLikelyUniqueSuffix can generate a suffix that |
| 40 is not really unique (and where uniquness comes from numberOfTries |
| 41 in FrameTree::ensureUniquenessOfUniqueName). |
| 42 --> |
| 43 <iframe id="frame1" name="sameName"></iframe> |
| 44 <iframe id="frame2" name="sameName"></iframe> |
| 45 <iframe id="frame3" name="sameName"></iframe> |
| 46 <iframe id="frame4" name="sameName"></iframe> |
| 47 <iframe id="frame5" name="sameName"></iframe> |
| 48 </body> |
| 49 </html> |
OLD | NEW |