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

Unified 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, 7 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/fast/frames/unique-name-all-subframes-have-same-name.html
diff --git a/third_party/WebKit/LayoutTests/fast/frames/unique-name-all-subframes-have-same-name.html b/third_party/WebKit/LayoutTests/fast/frames/unique-name-all-subframes-have-same-name.html
new file mode 100644
index 0000000000000000000000000000000000000000..128eb781f211e758ee17261e922f20daf3a6e8b4
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/frames/unique-name-all-subframes-have-same-name.html
@@ -0,0 +1,49 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+function runTest()
+{
+ if (window.testRunner) {
+ testRunner.dumpAsText();
+ testRunner.dumpChildFramesAsText();
+ }
+
+ function removeFrameAndAddNewFrame(oldFrameId) {
+ body = document.getElementById('body');
+ oldFrame = document.getElementById(oldFrameId);
+ body.removeChild(oldFrame);
+
+ // newFrame is added to the frame tree when the parent has the same number of
+ // children as when frame5 was being added. This will make
+ // likelyUniqueSuffix the same for frame5 and newFrame - their unique
+ // name will have to be different in some other way.
+ newFrame = document.createElement('iframe');
+ newFrame.name = "sameName";
+ body.appendChild(newFrame);
+ }
+
+ removeFrameAndAddNewFrame('frame2')
+ removeFrameAndAddNewFrame('frame3')
+}
+</script>
+</head>
+<body onload="runTest()" id="body">
+<!--
+Before https://crrev.com/1968213002 the name generated by
+FrameTree::generateOldStyleMaybeUniqueName would be assumed to be unique, but
+in reality could conflict with other names. This scenario is similar, but not
+the same as https://crbug.com/576969#c3.
+
+Additionaly, this test also exercises a scenario where the new
+FrameTree::generateLikelyUniqueSuffix can generate a suffix that
+is not really unique (and where uniquness comes from numberOfTries
+in FrameTree::ensureUniquenessOfUniqueName).
+-->
+<iframe id="frame1" name="sameName"></iframe>
+<iframe id="frame2" name="sameName"></iframe>
+<iframe id="frame3" name="sameName"></iframe>
+<iframe id="frame4" name="sameName"></iframe>
+<iframe id="frame5" name="sameName"></iframe>
+</body>
+</html>
« 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