M dist/mcp-test/src/test/java/cardemo/CarDemoTest.java

- Underpinnings for "clickElementWithId"

M dom/jni/Makefile.in

- depend on layout, for nsIBoxObject.  Thanks smaug.

M dom/jni/javaDOMGlobals.h

- copy over WC_ITOA macro

M dom/jni/org_mozilla_dom_ElementImpl.cpp

- add support for special attributes screenX, screenY, clientX, clientY

M webclient/build-tests.xml

- compile the CarDemoTest

M webclient/classes_spec/org/mozilla/mcp/MCP.java

- add getElementInCurrentPageById()

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

- exercise new features in dom ElementImpl.


git-svn-id: svn://10.0.0.236/trunk@221363 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
edburns%acm.org
2007-03-06 03:28:47 +00:00
parent 9f43a14fe9
commit 24cfaeb00e
7 changed files with 194 additions and 20 deletions

View File

@@ -1,5 +1,5 @@
/*
* $Id: DOMTest.java,v 1.2 2005-02-14 02:16:18 edburns%acm.org Exp $
* $Id: DOMTest.java,v 1.3 2007-03-06 03:28:47 edburns%acm.org Exp $
*/
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
@@ -39,6 +39,7 @@ import java.io.File;
import java.io.FileInputStream;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
// DOMTest.java
@@ -127,10 +128,30 @@ public class DOMTest extends WebclientTestCase {
Document dom = currentPage.getDOM();
assertNotNull(dom);
Node node = dom.getElementById("HistoryTest1.html");
assertNotNull(node);
assertEquals(1, node.getNodeType());
node = node.getFirstChild();
Element element = dom.getElementById("HistoryTest1.html");
assertNotNull(element);
assertEquals(1, element.getNodeType());
String strX = element.getAttribute("clientX");
String strY = element.getAttribute("clientY");
assertNotNull(strX);
assertNotNull(strY);
int x, y;
x = Integer.valueOf(strX).intValue();
assertEquals(8, x);
y = Integer.valueOf(strY).intValue();
assertEquals(103, y);
strX = element.getAttribute("screenX");
strY = element.getAttribute("screenY");
assertNotNull(strX);
assertNotNull(strY);
x = Integer.valueOf(strX).intValue();
assertEquals(8, x);
y = Integer.valueOf(strY).intValue();
assertEquals(102, y);
Node node = element.getFirstChild();
assertEquals("next", node.getNodeValue());
frame.setVisible(false);