test/jdk/java/awt/Dialog/NestedDialogs/Modal/NestedModalDialogTest.java
author amlu
Fri, 12 Jan 2018 14:09:50 +0800
changeset 48519 482ede6c4936
parent 47216 71c04702a3d5
permissions -rw-r--r--
8194959: Correct test tag to move bugid from @test to @bug Reviewed-by: sundar
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
39868
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
     1
/*
46151
5fa789776f7d 8185500: [TESTBUG] Add keywords headful/printer in java/awt and javax tests.
goetz
parents: 45028
diff changeset
     2
 * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
39868
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
     4
 *
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
     7
 * published by the Free Software Foundation.
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
     8
 *
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
    13
 * accompanied this code).
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
    14
 *
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
    18
 *
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
    21
 * questions.
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
    22
 */
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
    23
46151
5fa789776f7d 8185500: [TESTBUG] Add keywords headful/printer in java/awt and javax tests.
goetz
parents: 45028
diff changeset
    24
/**
48519
482ede6c4936 8194959: Correct test tag to move bugid from @test to @bug
amlu
parents: 47216
diff changeset
    25
 * @test
482ede6c4936 8194959: Correct test tag to move bugid from @test to @bug
amlu
parents: 47216
diff changeset
    26
 * @bug 8155740
46151
5fa789776f7d 8185500: [TESTBUG] Add keywords headful/printer in java/awt and javax tests.
goetz
parents: 45028
diff changeset
    27
 * @key headful
5fa789776f7d 8185500: [TESTBUG] Add keywords headful/printer in java/awt and javax tests.
goetz
parents: 45028
diff changeset
    28
 * @summary See <rdar://problem/3429130>: Events: actionPerformed() method not
5fa789776f7d 8185500: [TESTBUG] Add keywords headful/printer in java/awt and javax tests.
goetz
parents: 45028
diff changeset
    29
 *          called when it is button is clicked (system load related)
5fa789776f7d 8185500: [TESTBUG] Add keywords headful/printer in java/awt and javax tests.
goetz
parents: 45028
diff changeset
    30
 * @summary com.apple.junit.java.awt.Frame
5fa789776f7d 8185500: [TESTBUG] Add keywords headful/printer in java/awt and javax tests.
goetz
parents: 45028
diff changeset
    31
 * @library ../../../regtesthelpers
5fa789776f7d 8185500: [TESTBUG] Add keywords headful/printer in java/awt and javax tests.
goetz
parents: 45028
diff changeset
    32
 * @build VisibilityValidator
5fa789776f7d 8185500: [TESTBUG] Add keywords headful/printer in java/awt and javax tests.
goetz
parents: 45028
diff changeset
    33
 * @build Util
5fa789776f7d 8185500: [TESTBUG] Add keywords headful/printer in java/awt and javax tests.
goetz
parents: 45028
diff changeset
    34
 * @build Waypoint
5fa789776f7d 8185500: [TESTBUG] Add keywords headful/printer in java/awt and javax tests.
goetz
parents: 45028
diff changeset
    35
 * @run main NestedModalDialogTest
39868
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
    36
 */
46151
5fa789776f7d 8185500: [TESTBUG] Add keywords headful/printer in java/awt and javax tests.
goetz
parents: 45028
diff changeset
    37
39868
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
    38
//////////////////////////////////////////////////////////////////////////////
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
    39
//  NestedModalDialogTest.java
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
    40
// The test launches a parent frame. From this parent frame it launches a modal
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
    41
// dialog. From the modal dialog it launches a second modal dialog with a text
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
    42
// field in it and tries to write into the text field. The test succeeds if you
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
    43
// are successfully able to write into this second Nested Modal Dialog
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
    44
//////////////////////////////////////////////////////////////////////////////
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
    45
// classes necessary for this test
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
    46
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
    47
import java.awt.*;
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
    48
import java.awt.event.*;
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
    49
import java.util.Enumeration;
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
    50
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
    51
import test.java.awt.regtesthelpers.Waypoint;
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
    52
import test.java.awt.regtesthelpers.VisibilityValidator;
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
    53
import test.java.awt.regtesthelpers.Util;
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
    54
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
    55
public class NestedModalDialogTest {
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
    56
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
    57
    Waypoint[] event_checkpoint = new Waypoint[3];
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
    58
    VisibilityValidator[] win_checkpoint = new VisibilityValidator[2];
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
    59
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
    60
    IntermediateDialog interDiag;
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
    61
    TextDialog txtDiag;
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
    62
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
    63
    // Global variables so the robot thread can locate things.
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
    64
    Button[] robot_button = new Button[2];
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
    65
    TextField robot_text = null;
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
    66
    static Robot _robot = null;
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
    67
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
    68
    /*
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
    69
     * @throws InterruptedException
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
    70
     * @throws WaypointException
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
    71
     */
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
    72
    public void testModalDialogs() throws Exception {
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
    73
        Frame frame = null;
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
    74
        String result = "";
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
    75
        Robot robot = getRobot();
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
    76
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
    77
        event_checkpoint[0] = new Waypoint(); // "-Launch 1-"
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
    78
        event_checkpoint[1] = new Waypoint(); // "-Launch 2-"
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
    79
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
    80
        // Thread.currentThread().setName("NestedModalDialogTest Thread");
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
    81
        // launch first frame with firstButton
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
    82
        frame = new StartFrame();
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
    83
        VisibilityValidator.setVisibleAndConfirm(frame);
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
    84
        Util.clickOnComp(robot_button[0], robot);
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
    85
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
    86
        // Dialog must be created and onscreen before we proceed.
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
    87
        //   The event_checkpoint waits for the Dialog to be created.
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
    88
        //   The win_checkpoint waits for the Dialog to be visible.
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
    89
        event_checkpoint[0].requireClear("TestFrame actionPerformed() never "
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
    90
                + "called, see <rdar://problem/3429130>");
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
    91
        win_checkpoint[0].requireVisible();
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
    92
        Util.clickOnComp(robot_button[1], robot);
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
    93
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
    94
        // Again, the Dialog must be created and onscreen before we proceed.
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
    95
        //   The event_checkpoint waits for the Dialog to be created.
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
    96
        //   The win_checkpoint waits for the Dialog to be visible.
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
    97
        event_checkpoint[1].requireClear("IntermediateDialog actionPerformed() "
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
    98
                + "never called, see <rdar://problem/3429130>");
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
    99
        win_checkpoint[1].requireVisible();
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   100
        Util.clickOnComp(robot_text, robot);
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   101
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   102
        // I'm really not sure whether the click is needed for focus
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   103
        // but since it's asynchronous, as is the actually gaining of focus
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   104
        // we might as well do our best
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   105
        try {
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   106
            EventQueue.invokeAndWait(new Runnable() {
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   107
                public void run() {
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   108
                }
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   109
            });
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   110
        } catch (Exception e) {
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   111
        }
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   112
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   113
        robot.keyPress(KeyEvent.VK_SHIFT);
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   114
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   115
        robot.keyPress(KeyEvent.VK_H);
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   116
        robot.waitForIdle();
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   117
        robot.keyRelease(KeyEvent.VK_H);
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   118
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   119
        robot.keyRelease(KeyEvent.VK_SHIFT);
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   120
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   121
        robot.keyPress(KeyEvent.VK_E);
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   122
        robot.waitForIdle();
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   123
        robot.keyRelease(KeyEvent.VK_E);
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   124
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   125
        robot.keyPress(KeyEvent.VK_L);
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   126
        robot.waitForIdle();
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   127
        robot.keyRelease(KeyEvent.VK_L);
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   128
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   129
        robot.keyPress(KeyEvent.VK_L);
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   130
        robot.waitForIdle();
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   131
        robot.keyRelease(KeyEvent.VK_L);
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   132
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   133
        robot.keyPress(KeyEvent.VK_O);
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   134
        robot.waitForIdle();
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   135
        robot.keyRelease(KeyEvent.VK_O);
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   136
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   137
        //
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   138
        // NOTE THAT WE MAY HAVE MORE SYNCHRONIZATION WORK TO DO HERE.
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   139
        // CURRENTLY THERE IS NO GUARANTEE THAT THE KEYEVENT THAT THAT
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   140
        // TYPES THE 'O' HAS BEEN PROCESSED BEFORE WE GET THE RESULT
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   141
        //
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   142
        // This is a (lame) attempt at waiting for the last typeKey events to
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   143
        // propagate. It's not quite right because robot uses
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   144
        // CGRemoteOperations, which are asynchronous. But that's why I put in
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   145
        // the pause
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   146
        try {
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   147
            EventQueue.invokeAndWait(new Runnable() {
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   148
                public void run() {
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   149
                }
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   150
            });
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   151
        } catch (Exception e) {
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   152
        }
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   153
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   154
        // Need to call this before the dialog that robot_text is in is disposed
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   155
        result = robot_text.getText();
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   156
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   157
        Thread.sleep(50); // shouldn't need this, but pause adds stability
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   158
        // Click Close box of modal dialog with textField
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   159
        Util.clickOnComp(txtDiag, robot);
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   160
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   161
        Thread.sleep(50); // shouldn't need this, but pause adds stability
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   162
        // Click Close box of intermediate modal dialog
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   163
        Util.clickOnComp(interDiag, robot);
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   164
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   165
        Thread.sleep(50); // shouldn't need this, but pause adds stability
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   166
        // Click Close box of intermediate modal dialog
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   167
        Util.clickOnComp(frame, robot);
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   168
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   169
        String expected = "Hello";
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   170
    }
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   171
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   172
    private static Robot getRobot() {
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   173
        if (_robot == null) {
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   174
            try {
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   175
                _robot = new Robot();
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   176
            } catch (AWTException e) {
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   177
                throw new RuntimeException("Robot creation failed");
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   178
            }
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   179
        }
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   180
        return _robot;
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   181
    }
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   182
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   183
    //////////////////// Start Frame ///////////////////
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   184
    /**
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   185
     * Launches the first frame with a button in it
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   186
     */
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   187
    class StartFrame extends Frame {
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   188
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   189
        /**
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   190
         * Constructs a new instance.
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   191
         */
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   192
        public StartFrame() {
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   193
            super("First Frame");
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   194
            setLayout(new GridBagLayout());
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   195
            setLocation(375, 200);
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   196
            setSize(271, 161);
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   197
            Button but = new Button("Make Intermediate");
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   198
            but.addActionListener(new java.awt.event.ActionListener() {
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   199
                public void actionPerformed(ActionEvent e) {
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   200
                    interDiag = new IntermediateDialog(StartFrame.this);
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   201
                    win_checkpoint[0] = new VisibilityValidator(interDiag);
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   202
                    interDiag.setSize(300, 200);
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   203
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   204
                    // may need listener to watch this move.
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   205
                    interDiag.setLocation(getLocationOnScreen());
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   206
                    interDiag.pack();
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   207
                    event_checkpoint[0].clear();
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   208
                    interDiag.setVisible(true);
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   209
                }
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   210
            });
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   211
            Panel pan = new Panel();
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   212
            pan.add(but);
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   213
            add(pan);
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   214
            robot_button[0] = but;
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   215
            addWindowListener(new WindowAdapter() {
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   216
                public void windowClosing(WindowEvent e) {
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   217
                    setVisible(false);
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   218
                    dispose();
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   219
                }
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   220
            });
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   221
        }
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   222
    }
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   223
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   224
    ///////////////////////////// MODAL DIALOGS /////////////////////////////
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   225
    /* A Dialog that launches a sub-dialog */
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   226
    class IntermediateDialog extends Dialog {
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   227
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   228
        Dialog m_parent;
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   229
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   230
        public IntermediateDialog(Frame parent) {
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   231
            super(parent, "Intermediate Modal", true /*Modal*/);
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   232
            m_parent = this;
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   233
            Button but = new Button("Make Text");
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   234
            but.addActionListener(new java.awt.event.ActionListener() {
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   235
                public void actionPerformed(ActionEvent e) {
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   236
                    txtDiag = new TextDialog(m_parent);
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   237
                    win_checkpoint[1] = new VisibilityValidator(txtDiag);
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   238
                    txtDiag.setSize(300, 100);
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   239
                    event_checkpoint[1].clear();
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   240
                    txtDiag.setVisible(true);
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   241
                }
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   242
            });
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   243
            Panel pan = new Panel();
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   244
            pan.add(but);
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   245
            add(pan);
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   246
            pack();
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   247
            addWindowListener(new WindowAdapter() {
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   248
                public void windowClosing(WindowEvent e) {
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   249
                    setVisible(false);
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   250
                    dispose();
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   251
                }
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   252
            });
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   253
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   254
            // The robot needs to know about us, so set global
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   255
            robot_button[1] = but;
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   256
        }
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   257
    }
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   258
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   259
    /* A Dialog that just holds a text field */
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   260
    class TextDialog extends Dialog {
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   261
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   262
        public TextDialog(Dialog parent) {
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   263
            super(parent, "Modal Dialog", true /*Modal*/);
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   264
            TextField txt = new TextField("", 10);
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   265
            Panel pan = new Panel();
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   266
            pan.add(txt);
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   267
            add(pan);
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   268
            pack();
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   269
            addWindowListener(new WindowAdapter() {
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   270
                public void windowClosing(WindowEvent e) {
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   271
                    setVisible(false);
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   272
                    dispose();
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   273
                }
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   274
            });
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   275
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   276
            // The robot needs to know about us, so set global
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   277
            robot_text = txt;
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   278
        }
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   279
    }
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   280
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   281
    public static void main(String[] args) throws RuntimeException, Exception {
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   282
        try {
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   283
            new NestedModalDialogTest().testModalDialogs();
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   284
        } catch (Exception e) {
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   285
            throw new RuntimeException("NestedModalDialogTest object creation "
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   286
                    + "failed");
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   287
        }
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   288
    }
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
   289
}