changeset 1685:200ea1a5797e icedtea-2.4.8pre01

Merge jdk7u55-b14
author andrew
date Wed, 16 Apr 2014 19:41:08 +0100
parents 3055c061e7e2 (current diff) c1964a222000 (diff)
children 43cdaf529543
files .hgtags
diffstat 2 files changed, 162 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags	Tue Apr 15 23:54:36 2014 +0100
+++ b/.hgtags	Wed Apr 16 19:41:08 2014 +0100
@@ -396,6 +396,7 @@
 7f5cfaedb25c2c2774d6839810d6ae543557ca01 jdk7u45-b31
 ef7bdbe7f1fa42fd58723e541d9cdedcacb2649a jdk7u45-b33
 bcb3e939d046d75436c7c8511600b6edce42e6da jdk7u45-b34
+efbda7abd821f280ec3a3aa6819ad62d45595e55 jdk7u45-b35
 18d1864abca976ca68cb71612e9b20c908455d3d jdk7u51-b00
 14d1cf2630aea549cfba9d052200c7ebcabd875c jdk7u51-b01
 f0168ccf171ed6080267fe0a7f7aed0b46bd5713 jdk7u51-b02
@@ -414,3 +415,20 @@
 06eeb77dac248eb62fed00aa25f9f9fa9b4df210 icedtea-2.4.6pre01
 06eeb77dac248eb62fed00aa25f9f9fa9b4df210 icedtea-2.4.6
 8c26a3c3912898619032a5d913ba81ebfa6e4e22 icedtea-2.4.7
+ada23e55d76a378cb2fc2cd7ffae8c147aaf0055 jdk7u51-b30
+e3d4896d52ab4ad0fc0b7a45d60340dbdcb8826d jdk7u51-b31
+5b44df2114e466da85c3816627bfcd1b59c6499d jdk7u55-b00
+3e64e49131b88c839733c9869ff8aebcd15cf828 jdk7u55-b01
+2a9f5c00ba46f895bc9d16a584bf7d80c1822268 jdk7u55-b02
+0479d260ac835eb3f0c7f3d7d15be0599b92a20a jdk7u55-b03
+a244cc40ae0b29028ff8503ee516cb5f9e3db6e3 jdk7u55-b04
+25d63d986653d81522b01bbd2664083ae5fdc243 jdk7u55-b05
+76eeeaace70d38795eef5215f758493421cee0ac jdk7u55-b06
+08f7914d6aa947e73269b4e60110ed12573ffa28 jdk7u55-b07
+e64301b473b43609cb28d8cfe7e5db17d9bf8a4a jdk7u55-b08
+a296112a3fd774c258375912c7ada38daf8eee1e jdk7u55-b09
+faa9f8c51a6e3fcb444729012a798e3ad09c3da4 jdk7u55-b10
+2bdd105e433da7fbf7f37ec2f75fc4bed4e54280 jdk7u55-b11
+a3cdca5d3773f67a49091f9131a4d073bc6b83d9 jdk7u55-b12
+81bf1ca3a3a71c628b7d952ba47c6f200a223f27 jdk7u55-b13
+96d55b4d88fea1d9f8227e70003210a6c10a1dba jdk7u55-b30
--- a/test/com/sun/javadoc/testWindowTitle/TestWindowTitle.java	Tue Apr 15 23:54:36 2014 +0100
+++ b/test/com/sun/javadoc/testWindowTitle/TestWindowTitle.java	Wed Apr 16 19:41:08 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 8016675
+ * @bug 8016675 8026736
  * @summary Test for window title.
  * @author Bhavesh Patel
  * @library ../lib/
@@ -34,26 +34,153 @@
 public class TestWindowTitle extends JavadocTester {
 
     private static final String BUG_ID = "8016675";
-    private static final String WIN_TITLE =
+    //Window title with JavaScript special characters.
+    private static final String TITLE_JS_CHARS =
             "Testing \"Window 'Title'\" with a \\ backslash and a / " +
             "forward slash and a \u00e8 unicode char also a    tab and also a " +
             "\t special character another \u0002 unicode)";
-    private static final String[][] TEST = {
-        {BUG_ID + FS  + "overview-summary.html",
+    private static final String[] ARGS_JS_CHARS = new String[]{
+        "-d", BUG_ID + "-1", "-windowtitle", TITLE_JS_CHARS, "-sourcepath", SRC_DIR, "p1", "p2"
+    };
+    private static final String[][] TEST_JS_CHARS = {
+        {BUG_ID + "-1" + FS + "overview-summary.html",
             "parent.document.title=\"Overview (Testing \\\"Window \\\'Title\\\'\\\" " +
             "with a \\\\ backslash and a / forward slash and a \\u00E8 unicode char " +
             "also a    tab and also a \\t special character another \\u0002 unicode))\";"
         },
     };
-    private static final String[][] NEG_TEST = {
-        {BUG_ID + FS + "overview-summary.html",
+    private static final String[][] NEG_TEST_JS_CHARS = {
+        {BUG_ID + "-1" + FS + "overview-summary.html",
             "parent.document.title=\"Overview (Testing \"Window \'Title\'\" " +
             "with a \\ backslash and a / forward slash and a \u00E8 unicode char " +
             "also a    tab and also a \t special character another \u0002 unicode))\";"
+        }
+    };
+
+    //Window title with a script tag.
+    private static final String TITLE_SCRIPT_TAG =
+            "Testing script tag in title </title><script>alert(\"Should not pop up\")</script>.";
+    private static final String[] ARGS_SCRIPT_TAG = new String[]{
+        "-d", BUG_ID + "-2", "-windowtitle", TITLE_SCRIPT_TAG, "-sourcepath", SRC_DIR, "p1", "p2"
+    };
+    private static final String[][] TEST_SCRIPT_TAG = {
+        {BUG_ID + "-2" + FS + "overview-summary.html",
+            "parent.document.title=\"Overview (Testing script tag in title alert" +
+            "(\\\"Should not pop up\\\").)\";"
         },
+        {BUG_ID + "-2" + FS + "p2" + FS + "C2.html",
+            "parent.document.title=\"C2 (Testing script tag in title alert" +
+            "(\\\"Should not pop up\\\").)\";"
+        }
+    };
+    private static final String[][] NEG_TEST_SCRIPT_TAG = {
+        {BUG_ID + "-2" + FS + "overview-summary.html",
+            "parent.document.title=\"Overview (Testing script tag in title </title><script>" +
+            "alert(\\\"Should not pop up\\\")</script>.)\";"
+        },
+        {BUG_ID + "-2" + FS + "p2" + FS + "C2.html",
+            "parent.document.title=\"C2 (Testing script tag in title </title><script>" +
+            "alert(\\\"Should not pop up\\\")</script>.)\";"
+        }
+    };
+
+    //Window title with other HTML tags.
+    private static final String TITLE_HTML_TAGS =
+            "Testing another <p>HTML</p> tag. Another <h1>tag</h1>. A " +
+            "<span id=\"testTag\">tag with attributes</span>. <script and </p are not tags.";
+    private static final String[] ARGS_HTML_TAGS = new String[]{
+        "-d", BUG_ID + "-3", "-windowtitle", TITLE_HTML_TAGS, "-sourcepath", SRC_DIR, "p1", "p2"
+    };
+    private static final String[][] TEST_HTML_TAGS = {
+        {BUG_ID + "-3" + FS + "overview-summary.html",
+            "parent.document.title=\"Overview (Testing another HTML tag. Another tag. A " +
+            "tag with attributes. <script and </p are not tags.)\";"
+        }
+    };
+    private static final String[][] NEG_TEST_HTML_TAGS = {
+        {BUG_ID + "-3" + FS + "overview-summary.html",
+            "parent.document.title=\"Overview (Testing another <p>HTML</p> tag. Another " +
+            "<h1>tag</h1>. A <span id=\"testTag\">tag with attributes</span>. <script and " +
+            "</p are not tags.)\";"
+        }
+    };
+
+    //Window title using entities.
+    private static final String TITLE_HTML_ENTITIES =
+            "Testing entities &lt;script&gt;alert(\"Should not pop up\")&lt;/script&gt;.";
+    private static final String[] ARGS_HTML_ENTITIES = new String[]{
+        "-d", BUG_ID + "-4", "-windowtitle", TITLE_HTML_ENTITIES, "-sourcepath", SRC_DIR, "p1", "p2"
+    };
+    private static final String[][] TEST_HTML_ENTITIES = {
+        {BUG_ID + "-4" + FS + "overview-summary.html",
+            "parent.document.title=\"Overview (Testing entities &lt;script&gt;alert(\\\"Should " +
+            "not pop up\\\")&lt;/script&gt;.)\";"
+        }
     };
-    private static final String[] ARGS = new String[]{
-        "-d", BUG_ID, "-windowtitle", WIN_TITLE, "-sourcepath", SRC_DIR, "p1", "p2"
+    private static final String[][] NEG_TEST_HTML_ENTITIES = {
+        {BUG_ID + "-4" + FS  + "overview-summary.html",
+            "parent.document.title=\"Overview (Testing entities alert(\\\"Should not pop up\\\").)\";"
+        }
+    };
+
+    //Window title with just empty HTML tags.
+    private static final String TITLE_EMPTY_TAGS =
+            "</title><script></script>";
+    private static final String[] ARGS_EMPTY_TAGS = new String[]{
+        "-d", BUG_ID + "-5", "-windowtitle", TITLE_EMPTY_TAGS, "-sourcepath", SRC_DIR, "p1", "p2"
+    };
+    private static final String[][] TEST_EMPTY_TAGS = {
+        {BUG_ID + "-5" + FS + "overview-summary.html",
+            "parent.document.title=\"Overview\";"
+        }
+    };
+    private static final String[][] NEG_TEST_EMPTY_TAGS = {
+        {BUG_ID + "-5" + FS + "overview-summary.html",
+            "parent.document.title=\"Overview (</title><script></script>)\";"
+        }
+    };
+
+    //Window title with unicode characters.
+    private static final String TITLE_UNICODE_CHARS =
+            "Testing unicode \u003cscript\u003ealert(\"Should not pop up\")\u003c/script\u003e.";
+    private static final String[] ARGS_UNICODE_CHARS = new String[]{
+        "-d", BUG_ID + "-6", "-windowtitle", TITLE_UNICODE_CHARS, "-sourcepath", SRC_DIR, "p1", "p2"
+    };
+    private static final String[][] TEST_UNICODE_CHARS = {
+        {BUG_ID + "-6" + FS + "overview-summary.html",
+            "parent.document.title=\"Overview (Testing unicode alert(\\\"Should " +
+            "not pop up\\\").)\";"
+        }
+    };
+    private static final String[][] NEG_TEST_UNICODE_CHARS = {
+        {BUG_ID + "-6" + FS + "overview-summary.html",
+            "parent.document.title=\"Overview (Testing unicode <script>alert(\\\"Should not pop up\\\")" +
+            "</script>.)\";"
+        }
+    };
+
+    //An empty window title.
+    private static final String TITLE_EMPTY =
+            "";
+    private static final String[] ARGS_EMPTY_TITLE = new String[]{
+        "-d", BUG_ID + "-7", "-windowtitle", TITLE_EMPTY, "-sourcepath", SRC_DIR, "p1", "p2"
+    };
+    private static final String[][] TEST_EMPTY = {
+        {BUG_ID + "-7" + FS + "overview-summary.html",
+            "parent.document.title=\"Overview\";"
+        }
+    };
+
+    //Test doctitle.
+    private static final String[] ARGS_DOCTITLE = new String[]{
+        "-d", BUG_ID + "-8", "-doctitle", TITLE_JS_CHARS, "-sourcepath", SRC_DIR, "p1", "p2"
+    };
+    private static final String[][] NEG_TEST_DOCTITLE = {
+        {BUG_ID + "-8" + FS + "overview-summary.html",
+            "parent.document.title=\"Overview (Testing \\\"Window \\\'Title\\\'\\\" " +
+            "with a \\\\ backslash and a / forward slash and a \\u00E8 unicode char " +
+            "also a    tab and also a \\t special character another \\u0002 unicode)\";"
+        },
     };
 
     /**
@@ -62,7 +189,14 @@
      */
     public static void main(String[] args) {
         TestWindowTitle tester = new TestWindowTitle();
-        run(tester, ARGS, TEST, NEG_TEST);
+        run(tester, ARGS_JS_CHARS, TEST_JS_CHARS, NEG_TEST_JS_CHARS);
+        run(tester, ARGS_SCRIPT_TAG, TEST_SCRIPT_TAG, NEG_TEST_SCRIPT_TAG);
+        run(tester, ARGS_HTML_TAGS, TEST_HTML_TAGS, NEG_TEST_HTML_TAGS);
+        run(tester, ARGS_HTML_ENTITIES, TEST_HTML_ENTITIES, NEG_TEST_HTML_ENTITIES);
+        run(tester, ARGS_EMPTY_TAGS, TEST_EMPTY_TAGS, NEG_TEST_EMPTY_TAGS);
+        run(tester, ARGS_UNICODE_CHARS, TEST_UNICODE_CHARS, NEG_TEST_UNICODE_CHARS);
+        run(tester, ARGS_EMPTY_TITLE, TEST_EMPTY, NO_TEST);
+        run(tester, ARGS_DOCTITLE, NO_TEST, NEG_TEST_DOCTITLE);
         tester.printSummary();
     }