author | lana |
Mon, 11 Aug 2014 09:25:30 -0700 | |
changeset 25880 | e5967ea9bde2 |
parent 24399 | af1a0220d0fa |
child 30730 | d3ce7619db2c |
permissions | -rw-r--r-- |
10 | 1 |
/* |
23971 | 2 |
* Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. |
10 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
7 |
* published by the Free Software Foundation. |
|
8 |
* |
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
13 |
* accompanied this code). |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License version |
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
18 |
* |
|
5520 | 19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
20 |
* or visit www.oracle.com if you need additional information or have any |
|
21 |
* questions. |
|
10 | 22 |
*/ |
23 |
||
24 |
/* |
|
25 |
* @test |
|
20614 | 26 |
* @bug 4645058 4747738 4855054 8024756 |
10 | 27 |
* @summary Javascript IE load error when linked by -linkoffline |
28 |
* Window title shouldn't change when loading left frames (javascript) |
|
29 |
* @author dkramer |
|
24399
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
23971
diff
changeset
|
30 |
* @library ../lib |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
23971
diff
changeset
|
31 |
* @build JavadocTester |
10 | 32 |
* @run main JavascriptWinTitle |
33 |
*/ |
|
34 |
||
24399
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
23971
diff
changeset
|
35 |
public class JavascriptWinTitle extends JavadocTester { |
10 | 36 |
|
24399
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
23971
diff
changeset
|
37 |
public static void main(String... args) throws Exception { |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
23971
diff
changeset
|
38 |
JavascriptWinTitle tester = new JavascriptWinTitle(); |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
23971
diff
changeset
|
39 |
tester.runTests(); |
10 | 40 |
} |
41 |
||
24399
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
23971
diff
changeset
|
42 |
@Test |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
23971
diff
changeset
|
43 |
void test() { |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
23971
diff
changeset
|
44 |
javadoc("-d", "out", |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
23971
diff
changeset
|
45 |
"-doctitle", "Document Title", |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
23971
diff
changeset
|
46 |
"-windowtitle", "Window Title", |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
23971
diff
changeset
|
47 |
"-overview", testSrc("overview.html"), |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
23971
diff
changeset
|
48 |
"-linkoffline", "http://java.sun.com/j2se/1.4/docs/api", testSrc, |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
23971
diff
changeset
|
49 |
"-sourcepath", testSrc, |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
23971
diff
changeset
|
50 |
"p1", "p2"); |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
23971
diff
changeset
|
51 |
checkExit(Exit.OK); |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
23971
diff
changeset
|
52 |
checkOutput("overview-summary.html", true, |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
23971
diff
changeset
|
53 |
"<script type=\"text/javascript\">", |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
23971
diff
changeset
|
54 |
"<body>"); |
10 | 55 |
|
24399
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
23971
diff
changeset
|
56 |
// Test that "onload" is not present in BODY tag: |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
23971
diff
changeset
|
57 |
checkOutput("p1/package-summary.html", true, "<body>"); |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
23971
diff
changeset
|
58 |
checkOutput("overview-frame.html", true, "<body>"); |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
23971
diff
changeset
|
59 |
checkOutput("allclasses-frame.html", true, "<body>"); |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
23971
diff
changeset
|
60 |
checkOutput("p1/package-frame.html", true, "<body>"); |
10 | 61 |
|
24399
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
23971
diff
changeset
|
62 |
// Test that win title javascript is followed by NOSCRIPT code. |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
23971
diff
changeset
|
63 |
checkOutput("p1/C.html", true, |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
23971
diff
changeset
|
64 |
"<script type=\"text/javascript\"><!--\n" |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
23971
diff
changeset
|
65 |
+ " try {\n" |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
23971
diff
changeset
|
66 |
+ " if (location.href.indexOf('is-external=true') == -1) {\n" |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
23971
diff
changeset
|
67 |
+ " parent.document.title=\"C (Window Title)\";\n" |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
23971
diff
changeset
|
68 |
+ " }\n" |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
23971
diff
changeset
|
69 |
+ " }\n" |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
23971
diff
changeset
|
70 |
+ " catch(err) {\n" |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
23971
diff
changeset
|
71 |
+ " }\n" |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
23971
diff
changeset
|
72 |
+ "//-->\n" |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
23971
diff
changeset
|
73 |
+ "</script>"); |
10 | 74 |
} |
75 |
} |