aboutsummaryrefslogtreecommitdiffstats
path: root/devtest
diff options
context:
space:
mode:
authorManolo Carrasco <manolo@apache.org>2011-04-05 09:40:21 +0000
committerManolo Carrasco <manolo@apache.org>2011-04-05 09:40:21 +0000
commit9e589375d695e492c45004a5868163b97c741631 (patch)
treec9aec036bb14dc19ad4f0efff18a05f90555781e /devtest
parent0b419887ee438eb524c6873f63b1d961f8a0c612 (diff)
downloadgwtquery-9e589375d695e492c45004a5868163b97c741631.tar.gz
gwtquery-9e589375d695e492c45004a5868163b97c741631.zip
update lazy widgets api
Diffstat (limited to 'devtest')
-rw-r--r--devtest/pom.xml22
-rw-r--r--devtest/src/main/java/com/google/gwt/query/client/DevTestRunner.java36
-rw-r--r--devtest/src/main/java/com/google/gwt/query/public/test.html2
3 files changed, 55 insertions, 5 deletions
diff --git a/devtest/pom.xml b/devtest/pom.xml
index 2c69b0c4..add223c3 100644
--- a/devtest/pom.xml
+++ b/devtest/pom.xml
@@ -52,8 +52,7 @@
</testResources>
<plugins>
-
- <plugin>
+ <plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<version>${gwtmaven}</version>
@@ -67,8 +66,23 @@
<hostedWebapp>target/www</hostedWebapp>
<soyc>true</soyc>
</configuration>
- </plugin>
-
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-eclipse-plugin</artifactId>
+ <configuration>
+ <downloadSources>true</downloadSources>
+ <downloadJavadocs>false</downloadJavadocs>
+ <additionalBuildcommands>
+ <buildCommand>
+ <name>com.google.gwt.eclipse.core.gwtProjectValidator</name>
+ </buildCommand>
+ </additionalBuildcommands>
+ <additionalProjectnatures>
+ <projectnature>com.google.gwt.eclipse.core.gwtNature</projectnature>
+ </additionalProjectnatures>
+ </configuration>
+ </plugin>
</plugins>
</build>
</project>
diff --git a/devtest/src/main/java/com/google/gwt/query/client/DevTestRunner.java b/devtest/src/main/java/com/google/gwt/query/client/DevTestRunner.java
index f8f56215..912e16d8 100644
--- a/devtest/src/main/java/com/google/gwt/query/client/DevTestRunner.java
+++ b/devtest/src/main/java/com/google/gwt/query/client/DevTestRunner.java
@@ -18,12 +18,15 @@ package com.google.gwt.query.client;
import static com.google.gwt.query.client.GQuery.$;
import com.google.gwt.core.client.EntryPoint;
+import com.google.gwt.dom.client.Element;
import com.google.gwt.event.dom.client.FocusHandler;
import com.google.gwt.event.shared.GwtEvent;
import com.google.gwt.event.shared.HandlerRegistration;
import com.google.gwt.query.client.js.JsUtils;
+import com.google.gwt.query.client.plugins.Events;
import com.google.gwt.query.client.plugins.effects.PropertiesAnimation;
import com.google.gwt.query.client.plugins.effects.PropertiesAnimation.Easing;
+import com.google.gwt.user.client.Event;
import com.google.gwt.user.client.Timer;
/**
@@ -46,13 +49,44 @@ public class DevTestRunner extends MyTestCase implements EntryPoint {
public void onModuleLoad() {
try {
gwtSetUp();
- testPropertiesAnimationComputeEffects();
+ testLive();
+// testPropertiesAnimationComputeEffects();
} catch (Exception ex) {
ex.printStackTrace();
$(e).html("").after("<div>ERROR: " + ex.getMessage() + "</div>");
}
}
+ public void testAttrSelectors() {
+ System.out.println($("script:not([src])"));
+// System.out.println($("iframe:not([language])"));
+
+ }
+
+ public void testLive() {
+ $(e).html("<div id=d1 class='clickMe'>Content 1</div>");
+ GQuery q = $(".clickMe").live(Event.ONCLICK, new Function(){
+ public void f(Element e) {
+ $(e).css("color", "red");
+ }
+ });
+ $(e).append("<div id=d2 class='clickMe'>Content 2</div>");
+ assertEquals("", $("#d1").css("color"));
+
+ $(".clickMe", e).click();
+ assertEquals("red", $("#d1").css("color"));
+ assertEquals("red", $("#d2").css("color"));
+
+ $(".clickMe", e).css("color", "yellow");
+ $(".clickMe").die(Event.ONCLICK);
+ $(e).append("<div id=d3 class='clickMe'>Content 3</div>");
+ $(".clickMe", e).click();
+ assertEquals("yellow", $("#d1").css("color"));
+ assertEquals("yellow", $("#d2").css("color"));
+ assertEquals("", $("#d3").css("color"));
+ }
+
+
public void testPropertiesAnimationComputeEffects() {
$(e)
.html(
diff --git a/devtest/src/main/java/com/google/gwt/query/public/test.html b/devtest/src/main/java/com/google/gwt/query/public/test.html
index aa38d9c8..fded2886 100644
--- a/devtest/src/main/java/com/google/gwt/query/public/test.html
+++ b/devtest/src/main/java/com/google/gwt/query/public/test.html
@@ -4,6 +4,8 @@
</head>
<body>
<script language="javascript" src="test.nocache.js"></script>
+ <script src="atest.nocache.js"></script>
+
</body>
</html>