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> |