Browse Source

Fix input text frame test under xvfb

Fixes issue 3650

Change-Id: I52888b28bb2429f7a192cf49f00dd2abc8399886
Reviewed-on: http://gerrit.dmdirc.com/675
Automatic-Compile: DMDirc Local Commits <dmdirc@googlemail.com>
Reviewed-by: Shane Mc Cormack <shane@dmdirc.com>
tags/0.6.3
Chris Smith 14 years ago
parent
commit
27dc3e21ae

+ 9
- 11
test/com/dmdirc/addons/ui_swing/components/frames/InputTextFrameTest.java View File

@@ -70,6 +70,10 @@ public class InputTextFrameTest {
70 70
         controller.onLoad();
71 71
 
72 72
         Main.ensureExists(PluginManager.getPluginManager(), "tabcompletion");
73
+
74
+        UIUtilities.initUISettings();
75
+
76
+        mainframe = new FrameFixture(controller.getMainWindow());
73 77
     }
74 78
 
75 79
     @Before
@@ -77,16 +81,15 @@ public class InputTextFrameTest {
77 81
         cmmap = new TestConfigManagerMap();
78 82
         cmmap.settings.put("ui.pasteProtectionLimit", "1");
79 83
 
80
-        if (window == null) {
81
-            owner = new TestWritableFrameContainer(512, cmmap);
82
-
83
-            setupWindow(cmmap);
84
-        }
84
+        owner = new TestWritableFrameContainer(512, cmmap);
85
+        setupWindow(cmmap);
85 86
     }
86 87
 
87 88
     @After
88 89
     public void tearDown() {
89
-        // ??
90
+        window.close();
91
+        owner.window.close();
92
+        WindowManager.removeWindow(owner.window);
90 93
     }
91 94
 
92 95
     @Test
@@ -146,10 +149,6 @@ public class InputTextFrameTest {
146 149
     }
147 150
 
148 151
     protected void setupWindow(final ConfigManager configManager) {
149
-        UIUtilities.initUISettings();
150
-
151
-        mainframe = new FrameFixture(controller.getMainWindow());
152
-
153 152
         final CustomInputFrame titf = new CustomInputFrame(owner,
154 153
                 GlobalCommandParser.getGlobalCommandParser(), controller);
155 154
 
@@ -162,7 +161,6 @@ public class InputTextFrameTest {
162 161
         titf.open();
163 162
 
164 163
         window = new JInternalFrameFixture(mainframe.robot, titf);
165
-        window.robot.settings().eventPostingDelay(250);
166 164
     }
167 165
 
168 166
 }

Loading…
Cancel
Save