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

Unified Diff: third_party/WebKit/LayoutTests/fast/frames/unique-name-set-same-name.html

Issue 2053903002: Returning early when setting a frame name to the same name. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/fast/frames/unique-name-set-same-name.html
diff --git a/third_party/WebKit/LayoutTests/fast/frames/unique-name-set-same-name.html b/third_party/WebKit/LayoutTests/fast/frames/unique-name-set-same-name.html
new file mode 100644
index 0000000000000000000000000000000000000000..e9234f1a5be1311699fb6226cc44db46d926850f
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/frames/unique-name-set-same-name.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+function runTest()
+{
+ if (window.testRunner) {
+ testRunner.dumpAsText();
+ testRunner.dumpChildFramesAsText();
+ }
+ body = document.getElementById('body');
+ frame1 = document.getElementById('frame1');
+ body.removeChild(frame1);
+
+ // Below we effectively execute (pseudo-code):
+ // window.name = "same name as before"
+ // This shouldn't trigger a recalculation of unique name (which can result
+ // in a different unique name, because right now there is no frame1 with
+ // a conflicting window.name=="foo").
+ frame2 = document.getElementById('frame2');
+ frame2.contentWindow.name = "foo";
+
+ // Before fixes, this test used to trigger a DCHECK in
+ // void FrameTreeNode::SetFrameName(...) {
+ // if (name == replication_state_.name) {
+ // // |unique_name| shouldn't change unless |name| changes.
+ // DCHECK_EQ(unique_name, replication_state_.unique_name);
+ // return;
+ // }
+}
+</script>
+</head>
+<body onload="runTest()" id="body">
+<iframe name="foo" id="frame1"></iframe>
+<iframe name="foo" id="frame2"></iframe>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698