author | ihse |
Tue, 09 May 2017 12:57:30 +0200 | |
changeset 45028 | b0ea3c0bfb81 |
parent 26750 | d0d6c64a2e2b |
permissions | -rw-r--r-- |
20147
78e51d8fcb92
7129133: [macosx] Accelerators are displayed as Meta instead of the Command symbol
leonidr
parents:
diff
changeset
|
1 |
/* |
45028
b0ea3c0bfb81
8179889: Fix typographic errors in copyright headers
ihse
parents:
26750
diff
changeset
|
2 |
* Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved. |
20147
78e51d8fcb92
7129133: [macosx] Accelerators are displayed as Meta instead of the Command symbol
leonidr
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
78e51d8fcb92
7129133: [macosx] Accelerators are displayed as Meta instead of the Command symbol
leonidr
parents:
diff
changeset
|
4 |
* |
78e51d8fcb92
7129133: [macosx] Accelerators are displayed as Meta instead of the Command symbol
leonidr
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
78e51d8fcb92
7129133: [macosx] Accelerators are displayed as Meta instead of the Command symbol
leonidr
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
78e51d8fcb92
7129133: [macosx] Accelerators are displayed as Meta instead of the Command symbol
leonidr
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
78e51d8fcb92
7129133: [macosx] Accelerators are displayed as Meta instead of the Command symbol
leonidr
parents:
diff
changeset
|
8 |
* |
78e51d8fcb92
7129133: [macosx] Accelerators are displayed as Meta instead of the Command symbol
leonidr
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
78e51d8fcb92
7129133: [macosx] Accelerators are displayed as Meta instead of the Command symbol
leonidr
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
78e51d8fcb92
7129133: [macosx] Accelerators are displayed as Meta instead of the Command symbol
leonidr
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
78e51d8fcb92
7129133: [macosx] Accelerators are displayed as Meta instead of the Command symbol
leonidr
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
78e51d8fcb92
7129133: [macosx] Accelerators are displayed as Meta instead of the Command symbol
leonidr
parents:
diff
changeset
|
13 |
* accompanied this code). |
78e51d8fcb92
7129133: [macosx] Accelerators are displayed as Meta instead of the Command symbol
leonidr
parents:
diff
changeset
|
14 |
* |
78e51d8fcb92
7129133: [macosx] Accelerators are displayed as Meta instead of the Command symbol
leonidr
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
78e51d8fcb92
7129133: [macosx] Accelerators are displayed as Meta instead of the Command symbol
leonidr
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
78e51d8fcb92
7129133: [macosx] Accelerators are displayed as Meta instead of the Command symbol
leonidr
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
78e51d8fcb92
7129133: [macosx] Accelerators are displayed as Meta instead of the Command symbol
leonidr
parents:
diff
changeset
|
18 |
* |
78e51d8fcb92
7129133: [macosx] Accelerators are displayed as Meta instead of the Command symbol
leonidr
parents:
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
78e51d8fcb92
7129133: [macosx] Accelerators are displayed as Meta instead of the Command symbol
leonidr
parents:
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
78e51d8fcb92
7129133: [macosx] Accelerators are displayed as Meta instead of the Command symbol
leonidr
parents:
diff
changeset
|
21 |
* questions. |
78e51d8fcb92
7129133: [macosx] Accelerators are displayed as Meta instead of the Command symbol
leonidr
parents:
diff
changeset
|
22 |
*/ |
78e51d8fcb92
7129133: [macosx] Accelerators are displayed as Meta instead of the Command symbol
leonidr
parents:
diff
changeset
|
23 |
|
78e51d8fcb92
7129133: [macosx] Accelerators are displayed as Meta instead of the Command symbol
leonidr
parents:
diff
changeset
|
24 |
/* |
78e51d8fcb92
7129133: [macosx] Accelerators are displayed as Meta instead of the Command symbol
leonidr
parents:
diff
changeset
|
25 |
* @test |
78e51d8fcb92
7129133: [macosx] Accelerators are displayed as Meta instead of the Command symbol
leonidr
parents:
diff
changeset
|
26 |
* @bug 7129133 |
78e51d8fcb92
7129133: [macosx] Accelerators are displayed as Meta instead of the Command symbol
leonidr
parents:
diff
changeset
|
27 |
* @summary [macosx] Accelerators are displayed as Meta instead of the Command symbol |
78e51d8fcb92
7129133: [macosx] Accelerators are displayed as Meta instead of the Command symbol
leonidr
parents:
diff
changeset
|
28 |
* @author leonid.romanov@oracle.com |
26750
d0d6c64a2e2b
8058726: Update regtests using sun.awt.OSInfo, part 1
yan
parents:
20147
diff
changeset
|
29 |
* @library ../../../../lib/testlibrary |
d0d6c64a2e2b
8058726: Update regtests using sun.awt.OSInfo, part 1
yan
parents:
20147
diff
changeset
|
30 |
* @build jdk.testlibrary.OSInfo |
20147
78e51d8fcb92
7129133: [macosx] Accelerators are displayed as Meta instead of the Command symbol
leonidr
parents:
diff
changeset
|
31 |
* @run main bug7129133 |
78e51d8fcb92
7129133: [macosx] Accelerators are displayed as Meta instead of the Command symbol
leonidr
parents:
diff
changeset
|
32 |
*/ |
78e51d8fcb92
7129133: [macosx] Accelerators are displayed as Meta instead of the Command symbol
leonidr
parents:
diff
changeset
|
33 |
|
78e51d8fcb92
7129133: [macosx] Accelerators are displayed as Meta instead of the Command symbol
leonidr
parents:
diff
changeset
|
34 |
import java.awt.*; |
78e51d8fcb92
7129133: [macosx] Accelerators are displayed as Meta instead of the Command symbol
leonidr
parents:
diff
changeset
|
35 |
|
78e51d8fcb92
7129133: [macosx] Accelerators are displayed as Meta instead of the Command symbol
leonidr
parents:
diff
changeset
|
36 |
public class bug7129133 { |
78e51d8fcb92
7129133: [macosx] Accelerators are displayed as Meta instead of the Command symbol
leonidr
parents:
diff
changeset
|
37 |
public static void main(String[] args) throws Exception { |
26750
d0d6c64a2e2b
8058726: Update regtests using sun.awt.OSInfo, part 1
yan
parents:
20147
diff
changeset
|
38 |
if (jdk.testlibrary.OSInfo.getOSType() != jdk.testlibrary.OSInfo.OSType.MACOSX) { |
20147
78e51d8fcb92
7129133: [macosx] Accelerators are displayed as Meta instead of the Command symbol
leonidr
parents:
diff
changeset
|
39 |
System.out.println("This test is for MacOS only. Automatically passed on other platforms."); |
78e51d8fcb92
7129133: [macosx] Accelerators are displayed as Meta instead of the Command symbol
leonidr
parents:
diff
changeset
|
40 |
return; |
78e51d8fcb92
7129133: [macosx] Accelerators are displayed as Meta instead of the Command symbol
leonidr
parents:
diff
changeset
|
41 |
} |
78e51d8fcb92
7129133: [macosx] Accelerators are displayed as Meta instead of the Command symbol
leonidr
parents:
diff
changeset
|
42 |
|
78e51d8fcb92
7129133: [macosx] Accelerators are displayed as Meta instead of the Command symbol
leonidr
parents:
diff
changeset
|
43 |
Toolkit.getDefaultToolkit(); |
78e51d8fcb92
7129133: [macosx] Accelerators are displayed as Meta instead of the Command symbol
leonidr
parents:
diff
changeset
|
44 |
|
78e51d8fcb92
7129133: [macosx] Accelerators are displayed as Meta instead of the Command symbol
leonidr
parents:
diff
changeset
|
45 |
String cmdSymbol = "\u2318"; |
78e51d8fcb92
7129133: [macosx] Accelerators are displayed as Meta instead of the Command symbol
leonidr
parents:
diff
changeset
|
46 |
String val = Toolkit.getProperty("AWT.meta", "Meta"); |
78e51d8fcb92
7129133: [macosx] Accelerators are displayed as Meta instead of the Command symbol
leonidr
parents:
diff
changeset
|
47 |
|
78e51d8fcb92
7129133: [macosx] Accelerators are displayed as Meta instead of the Command symbol
leonidr
parents:
diff
changeset
|
48 |
if (!val.equals(cmdSymbol)) { |
78e51d8fcb92
7129133: [macosx] Accelerators are displayed as Meta instead of the Command symbol
leonidr
parents:
diff
changeset
|
49 |
throw new Exception("Wrong property value for AWT.meta. Expected: " + cmdSymbol + ", actual: " + val); |
78e51d8fcb92
7129133: [macosx] Accelerators are displayed as Meta instead of the Command symbol
leonidr
parents:
diff
changeset
|
50 |
} |
78e51d8fcb92
7129133: [macosx] Accelerators are displayed as Meta instead of the Command symbol
leonidr
parents:
diff
changeset
|
51 |
} |
78e51d8fcb92
7129133: [macosx] Accelerators are displayed as Meta instead of the Command symbol
leonidr
parents:
diff
changeset
|
52 |
} |