Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(48)

Side by Side Diff: third_party/WebKit/LayoutTests/fast/frames/unique-name-all-subframes-have-same-name.html

Issue 1968213002: Try harder to make sure that blink::FrameTree::m_uniqueName is truly unique. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed CR comments from dcheng@. Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/frames/unique-name-all-subframes-have-same-name-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/frames/unique-name-all-subframes-have-same-name-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698