This checkin just adds a little more robustness to the

MouseListenerTest.  Next step will be to solve the problem where you
can't type in text fields in forms, then to implement the key listener
functionality.

M webclient/test/automated/src/classes/org/mozilla/webclient/MouseListenerTest.java

- at least make sure that all the events do occcur
This commit is contained in:
edburns%acm.org 2004-10-28 13:57:59 +00:00
Родитель 97f0a0e5ed
Коммит f81b674fc7
1 изменённых файлов: 15 добавлений и 1 удалений

Просмотреть файл

@ -1,5 +1,5 @@
/* /*
* $Id: MouseListenerTest.java,v 1.1 2004-10-27 01:33:57 edburns%acm.org Exp $ * $Id: MouseListenerTest.java,v 1.2 2004-10-28 13:57:59 edburns%acm.org Exp $
*/ */
/* /*
@ -32,6 +32,7 @@ import junit.framework.Test;
import java.util.Enumeration; import java.util.Enumeration;
import java.util.Map; import java.util.Map;
import java.util.BitSet;
import java.awt.Frame; import java.awt.Frame;
import java.awt.Robot; import java.awt.Robot;
@ -124,6 +125,8 @@ public class MouseListenerTest extends WebclientTestCase {
MouseListenerTest.keepWaiting = false; MouseListenerTest.keepWaiting = false;
} }
}); });
final BitSet bitSet = new BitSet();
// PENDING(edburns): flesh this out with more content // PENDING(edburns): flesh this out with more content
MouseListener mouseListener = new MouseListener() { MouseListener mouseListener = new MouseListener() {
public void mouseEntered(MouseEvent e) { public void mouseEntered(MouseEvent e) {
@ -139,22 +142,27 @@ public class MouseListenerTest extends WebclientTestCase {
String href = (String) eventMap.get("href"); String href = (String) eventMap.get("href");
assertNotNull(href); assertNotNull(href);
assertEquals(href, "HistoryTest1.html"); assertEquals(href, "HistoryTest1.html");
bitSet.set(0);
} }
public void mouseExited(MouseEvent e) { public void mouseExited(MouseEvent e) {
System.out.println("debug: edburns: exited: " + System.out.println("debug: edburns: exited: " +
e.getX() + ", " + e.getY()); e.getX() + ", " + e.getY());
bitSet.set(1);
} }
public void mouseClicked(MouseEvent e) { public void mouseClicked(MouseEvent e) {
System.out.println("debug: edburns: clicked: " + System.out.println("debug: edburns: clicked: " +
e.getX() + ", " + e.getY()); e.getX() + ", " + e.getY());
bitSet.set(2);
} }
public void mousePressed(MouseEvent e) { public void mousePressed(MouseEvent e) {
System.out.println("debug: edburns: pressed: " + System.out.println("debug: edburns: pressed: " +
e.getX() + ", " + e.getY()); e.getX() + ", " + e.getY());
bitSet.set(3);
} }
public void mouseReleased(MouseEvent e) { public void mouseReleased(MouseEvent e) {
System.out.println("debug: edburns: released: " + System.out.println("debug: edburns: released: " +
e.getX() + ", " + e.getY()); e.getX() + ", " + e.getY());
bitSet.set(4);
} }
}; };
@ -192,6 +200,12 @@ public class MouseListenerTest extends WebclientTestCase {
Thread.currentThread().sleep(1000); Thread.currentThread().sleep(1000);
} }
robot.mouseMove(OUT_X, OUT_Y);
Thread.currentThread().sleep(3000);
bitSet.flip(0, bitSet.size());
assertTrue(!bitSet.isEmpty());
frame.setVisible(false); frame.setVisible(false);
BrowserControlFactory.deleteBrowserControl(firstBrowserControl); BrowserControlFactory.deleteBrowserControl(firstBrowserControl);