jdk/test/java/awt/Dialog/NestedDialogs/Modal/NestedModalDialogTest.java
author ihse
Tue, 09 May 2017 12:57:30 +0200
changeset 45028 b0ea3c0bfb81
parent 39868 79bc8722ebb0
child 46151 5fa789776f7d
permissions -rw-r--r--
8179889: Fix typographic errors in copyright headers Reviewed-by: erikj, dholmes
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
/*
45028
b0ea3c0bfb81 8179889: Fix typographic errors in copyright headers
ihse
parents: 39868
diff changeset
     2
 * Copyright (c) 2011, 2016, 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
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
    24
 /*
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
    25
 @test 8155740
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
    26
 @summary See <rdar://problem/3429130>: Events: actionPerformed() method not
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
    27
          called when it is button is clicked (system load related)
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
    28
 @summary com.apple.junit.java.awt.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
    29
 @library ../../../regtesthelpers
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
    30
 @build 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
    31
 @build 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
    32
 @build 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
    33
 @run main 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
    34
 */
79bc8722ebb0 8160266: [macosx] NestedModalDialogTest.java and NestedModelessDialogTest.java tests does not run with current JDK codebase after taking the files from MACOSX_PORT
mhalder
parents:
diff changeset
    35
//////////////////////////////////////////////////////////////////////////////
79bc8722ebb0 8160266: [macosx] 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
//  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
    37
// 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
    38
// 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
    39
// 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
    40
// 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
    41
//////////////////////////////////////////////////////////////////////////////
79bc8722ebb0 8160266: [macosx] 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
// 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
    43
79bc8722ebb0 8160266: [macosx] 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
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
    45
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
    46
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
    47
79bc8722ebb0 8160266: [macosx] 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 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
    49
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
    50
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
    51
79bc8722ebb0 8160266: [macosx] 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
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
    53
79bc8722ebb0 8160266: [macosx] 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
    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
    55
    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
    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
    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
    58
    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
    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
    // 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
    61
    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
    62
    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
    63
    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
    64
79bc8722ebb0 8160266: [macosx] 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
    /*
79bc8722ebb0 8160266: [macosx] 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
     * @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
    67
     * @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
    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
    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
    70
        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
    71
        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
    72
        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
    73
79bc8722ebb0 8160266: [macosx] 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
        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
    75
        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
    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
        // 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
    78
        // 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
    79
        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
    80
        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
    81
        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
    82
79bc8722ebb0 8160266: [macosx] 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
        // 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
    84
        //   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
    85
        //   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
    86
        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
    87
                + "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
    88
        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
    89
        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
    90
79bc8722ebb0 8160266: [macosx] 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
        // 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
    92
        //   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
    93
        //   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
    94
        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
    95
                + "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
    96
        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
    97
        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
    98
79bc8722ebb0 8160266: [macosx] 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
        // 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
   100
        // 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
   101
        // 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
   102
        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
   103
            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
   104
                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
   105
                }
79bc8722ebb0 8160266: [macosx] 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
            });
79bc8722ebb0 8160266: [macosx] 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
        } 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
   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
        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
   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
        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
   113
        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
   114
        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
   115
79bc8722ebb0 8160266: [macosx] 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.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
   117
79bc8722ebb0 8160266: [macosx] 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
        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
   119
        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
   120
        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
   121
79bc8722ebb0 8160266: [macosx] 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.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
   123
        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
   124
        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
   125
79bc8722ebb0 8160266: [macosx] 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.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
   127
        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
   128
        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
   129
79bc8722ebb0 8160266: [macosx] 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.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
   131
        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
   132
        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
   133
79bc8722ebb0 8160266: [macosx] 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
        //
79bc8722ebb0 8160266: [macosx] 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
        // 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
   136
        // 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
   137
        // 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
   138
        //
79bc8722ebb0 8160266: [macosx] 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
        // 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
   140
        // 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
   141
        // 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
   142
        // 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
   143
        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
   144
            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
   145
                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
   146
                }
79bc8722ebb0 8160266: [macosx] 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
            });
79bc8722ebb0 8160266: [macosx] 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
        } 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
   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
        // 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
   152
        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
   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
        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
   155
        // 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
   156
        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
   157
79bc8722ebb0 8160266: [macosx] 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
        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
   159
        // 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
   160
        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
   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
   162
        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
   163
        // 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
   164
        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
   165
79bc8722ebb0 8160266: [macosx] 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
        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
   167
    }
79bc8722ebb0 8160266: [macosx] 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
    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
   170
        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
   171
            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
   172
                _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
   173
            } 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
   174
                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
   175
            }
79bc8722ebb0 8160266: [macosx] 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
        }
79bc8722ebb0 8160266: [macosx] 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
        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
   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
    //////////////////// 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
   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
     * 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
   183
     */
79bc8722ebb0 8160266: [macosx] 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
    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
   185
79bc8722ebb0 8160266: [macosx] 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
         * 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
   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
        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
   190
            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
   191
            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
   192
            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
   193
            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
   194
            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
   195
            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
   196
                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
   197
                    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
   198
                    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
   199
                    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
   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
   201
                    // 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
   202
                    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
   203
                    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
   204
                    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
   205
                    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
   206
                }
79bc8722ebb0 8160266: [macosx] 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
            });
79bc8722ebb0 8160266: [macosx] 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
            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
   209
            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
   210
            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
   211
            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
   212
            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
   213
                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
   214
                    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
   215
                    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
   216
                }
79bc8722ebb0 8160266: [macosx] 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
            });
79bc8722ebb0 8160266: [macosx] 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
        }
79bc8722ebb0 8160266: [macosx] 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
    ///////////////////////////// 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
   222
    /* 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
   223
    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
   224
79bc8722ebb0 8160266: [macosx] 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
        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
   226
79bc8722ebb0 8160266: [macosx] 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
        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
   228
            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
   229
            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
   230
            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
   231
            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
   232
                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
   233
                    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
   234
                    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
   235
                    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
   236
                    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
   237
                    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
   238
                }
79bc8722ebb0 8160266: [macosx] 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
            });
79bc8722ebb0 8160266: [macosx] 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
            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
   241
            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
   242
            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
   243
            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
   244
            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
   245
                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
   246
                    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
   247
                    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
   248
                }
79bc8722ebb0 8160266: [macosx] 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
            });
79bc8722ebb0 8160266: [macosx] 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
79bc8722ebb0 8160266: [macosx] 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
            // 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
   252
            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
   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
    }
79bc8722ebb0 8160266: [macosx] 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
79bc8722ebb0 8160266: [macosx] 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
    /* 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
   257
    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
   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
        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
   260
            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
   261
            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
   262
            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
   263
            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
   264
            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
   265
            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
   266
            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
   267
                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
   268
                    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
   269
                    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
   270
                }
79bc8722ebb0 8160266: [macosx] 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
            });
79bc8722ebb0 8160266: [macosx] 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
79bc8722ebb0 8160266: [macosx] 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
            // 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
   274
            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
   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
    }
79bc8722ebb0 8160266: [macosx] 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
79bc8722ebb0 8160266: [macosx] 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
    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
   279
        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
   280
            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
   281
        } 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
   282
            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
   283
                    + "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
   284
        }
79bc8722ebb0 8160266: [macosx] 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
    }
79bc8722ebb0 8160266: [macosx] 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
}