2011-04-10 Daniel Bates <dbates@rim.com>
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 11 Apr 2011 01:45:29 +0000 (01:45 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 11 Apr 2011 01:45:29 +0000 (01:45 +0000)
        Reviewed by Eric Seidel.

        Add layout test to ensure that window.name returns {"_blank", "_parent", "_self", "_top"}
        for a frame of the same name
        https://bugs.webkit.org/show_bug.cgi?id=58189

        Extracted common code from files LayoutTests/fast/frames/resources/frame-element-name-{left, right}.html
        into LayoutTests/fast/frames/resources/frame-element-name.html so that we can use this logic
        to test frames with arbitrary names.

        * fast/frames/frame-element-name-expected.txt:
        * fast/frames/frame-element-name.html: Modified to use resources/frame-element-name.html; Added
          test cases for "_blank", "_parent", "_self", and "_top".
        * fast/frames/resources/frame-element-name-left.html: Removed; Instead, pass expectedName to
          resources/frame-element-name.html
        * fast/frames/resources/frame-element-name-right.html: Ditto.
        * fast/frames/resources/frame-element-name.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@83411 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/fast/frames/frame-element-name-expected.txt
LayoutTests/fast/frames/frame-element-name.html
LayoutTests/fast/frames/resources/frame-element-name-left.html [deleted file]
LayoutTests/fast/frames/resources/frame-element-name-right.html [deleted file]
LayoutTests/fast/frames/resources/frame-element-name.html [new file with mode: 0644]

index 0cce8d3..79a413b 100644 (file)
@@ -1,3 +1,23 @@
+2011-04-10  Daniel Bates  <dbates@rim.com>
+
+        Reviewed by Eric Seidel.
+
+        Add layout test to ensure that window.name returns {"_blank", "_parent", "_self", "_top"}
+        for a frame of the same name
+        https://bugs.webkit.org/show_bug.cgi?id=58189
+
+        Extracted common code from files LayoutTests/fast/frames/resources/frame-element-name-{left, right}.html
+        into LayoutTests/fast/frames/resources/frame-element-name.html so that we can use this logic
+        to test frames with arbitrary names.
+
+        * fast/frames/frame-element-name-expected.txt:
+        * fast/frames/frame-element-name.html: Modified to use resources/frame-element-name.html; Added
+          test cases for "_blank", "_parent", "_self", and "_top".
+        * fast/frames/resources/frame-element-name-left.html: Removed; Instead, pass expectedName to
+          resources/frame-element-name.html
+        * fast/frames/resources/frame-element-name-right.html: Ditto.
+        * fast/frames/resources/frame-element-name.html: Added.
+
 2011-04-10  Dimitri Glazkov  <dglazkov@chromium.org>
 
         Reviewed by Eric Carlson.
index 8d6a136..0e51025 100644 (file)
@@ -13,3 +13,31 @@ Frame: '<!--framePath //<!--frame1-->-->'
 PASS escape(window.frameElement.name) is ""
 PASS escape(window.name) is ""
 
+
+--------
+Frame: '<!--framePath //<!--frame2-->-->'
+--------
+PASS escape(window.frameElement.name) is "_blank"
+PASS escape(window.name) is "_blank"
+
+
+--------
+Frame: '_parent'
+--------
+PASS escape(window.frameElement.name) is "_parent"
+PASS escape(window.name) is "_parent"
+
+
+--------
+Frame: '_self'
+--------
+PASS escape(window.frameElement.name) is "_self"
+PASS escape(window.name) is "_self"
+
+
+--------
+Frame: '_top'
+--------
+PASS escape(window.frameElement.name) is "_top"
+PASS escape(window.name) is "_top"
+
index 93acb17..f26b298 100644 (file)
@@ -5,8 +5,12 @@ if (window.layoutTestController)
     layoutTestController.dumpChildFramesAsText();
 </script>
 </head>
- <frameset border="1" cols="500,*" style='border: solid 1px;'>
-  <frame marginwidth="1" src="resources/frame-element-name-left.html" name='left'>
-  <frame src="resources/frame-element-name-right.html">
+ <frameset border="1" cols="150,150,150,150,150,*" style='border: solid 1px;'>
+  <frame marginwidth="1" src="resources/frame-element-name.html?expectedName=left" name="left">
+  <frame src="resources/frame-element-name.html?expectedName=">
+  <frame src="resources/frame-element-name.html?expectedName=_blank" name="_blank">
+  <frame src="resources/frame-element-name.html?expectedName=_parent" name="_parent">
+  <frame src="resources/frame-element-name.html?expectedName=_self" name="_self">
+  <frame src="resources/frame-element-name.html?expectedName=_top" name="_top">
  </frameset>
 </html>
diff --git a/LayoutTests/fast/frames/resources/frame-element-name-left.html b/LayoutTests/fast/frames/resources/frame-element-name-left.html
deleted file mode 100644 (file)
index da9d9e1..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-<head>
-<title>Left</title>
-<link rel="stylesheet" href="../../js/resources/js-test-style.css">
-<script src="../../js/resources/js-test-pre.js"></script>
-</head>
-<body>
-<div id="console"></div>
-<script>
-shouldBeEqualToString("escape(window.frameElement.name)", "left");
-shouldBeEqualToString("escape(window.name)", "left");
-</script>
-</body>
diff --git a/LayoutTests/fast/frames/resources/frame-element-name-right.html b/LayoutTests/fast/frames/resources/frame-element-name-right.html
deleted file mode 100644 (file)
index 6ab8dfa..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-<head>
-<title>Right</title>
-<link rel="stylesheet" href="../../js/resources/js-test-style.css">
-<script src="../../js/resources/js-test-pre.js"></script>
-</head>
-<body>
-<div id="console"></div>
-<script>
-shouldBeEqualToString("escape(window.frameElement.name)", "");
-shouldBeEqualToString("escape(window.name)", "");
-</script>
-</body>
diff --git a/LayoutTests/fast/frames/resources/frame-element-name.html b/LayoutTests/fast/frames/resources/frame-element-name.html
new file mode 100644 (file)
index 0000000..44ad86c
--- /dev/null
@@ -0,0 +1,12 @@
+<head>
+<link rel="stylesheet" href="../../js/resources/js-test-style.css">
+<script src="../../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<div id="console"></div>
+<script>
+var expectedName = window.location.search.substr("?expectedName=".length);
+shouldBeEqualToString("escape(window.frameElement.name)", expectedName);
+shouldBeEqualToString("escape(window.name)", expectedName);
+</script>
+</body>