aboutsummaryrefslogtreecommitdiffstats
path: root/gwtquery-core/src/test
diff options
context:
space:
mode:
authorJulien Dramaix <julien.dramaix@gmail.com>2011-04-10 08:17:32 +0000
committerJulien Dramaix <julien.dramaix@gmail.com>2011-04-10 08:17:32 +0000
commit460ef6ed3197429b5f66081c43a8d748a2d2feb7 (patch)
tree5baa9de16e4dcbfe0b0248768c73d31c8787d076 /gwtquery-core/src/test
parent4e04e209edc63690d942d79bada0725eea2d37b2 (diff)
downloadgwtquery-460ef6ed3197429b5f66081c43a8d748a2d2feb7.tar.gz
gwtquery-460ef6ed3197429b5f66081c43a8d748a2d2feb7.zip
oopps testLiveWithMultipleEvent() should not be committed
Diffstat (limited to 'gwtquery-core/src/test')
-rw-r--r--gwtquery-core/src/test/java/com/google/gwt/query/client/GQueryEventsTest.java48
1 files changed, 25 insertions, 23 deletions
diff --git a/gwtquery-core/src/test/java/com/google/gwt/query/client/GQueryEventsTest.java b/gwtquery-core/src/test/java/com/google/gwt/query/client/GQueryEventsTest.java
index af3f2465..876ee78d 100644
--- a/gwtquery-core/src/test/java/com/google/gwt/query/client/GQueryEventsTest.java
+++ b/gwtquery-core/src/test/java/com/google/gwt/query/client/GQueryEventsTest.java
@@ -388,28 +388,7 @@ public void testLiveWithMultipleFunction() {
}
-public void testLiveWithMultipleEvent() {
-
- $(e).html("<div id='div1'><div id='div2'>Content 1<span id='span1'> blop</span></div></div>");
-
- $(".clickable", e).live(Event.ONCLICK | Event.ONMOUSEMOVE, new Function(){
- public void f(Element e) {
- $(e).css(CSS.COLOR.with(RGBColor.RED));
- }
- });
-
- $("#div1", e).addClass("clickable");
-
- $("#span1", e).click();
-
- assertEquals("red", $("#div1", e).css(CSS.COLOR));
-
- //reset
- $("#div1", e).css(CSS.COLOR.with(RGBColor.BLACK));
-
-
-
-}
+
public void testNamedBinding() {
@@ -523,7 +502,30 @@ public void testLiveWithMultipleEvent() {
assertEquals($("#test").attr("tabIndex"), "2");
}
-
+ public void testUnbindMultipleEvents() {
+ String content = "<p>content</p>";
+ $(e).html(content);
+ $(document).bind(Event.ONMOUSEMOVE, null, new Function() {
+ public void f(Element e){
+ $("p").css(CSS.COLOR.with(RGBColor.RED));
+ }
+ });
+ $(document).bind(Event.ONMOUSEUP, null, new Function(){
+ public void f(Element e){
+ $("p").css(CSS.COLOR.with(RGBColor.YELLOW));
+ }
+ });
+ $(document).trigger(Event.ONMOUSEMOVE);
+ assertEquals("red", $("p").css("color"));
+ $(document).trigger(Event.ONMOUSEUP);
+ assertEquals("yellow", $("p").css("color"));
+ $("p").css(CSS.COLOR.with(RGBColor.BLACK));
+ $(document).unbind(Event.ONMOUSEUP|Event.ONMOUSEMOVE);
+ $(document).trigger(Event.ONMOUSEMOVE);
+ assertEquals("black", $("p").css("color"));
+ $(document).trigger(Event.ONMOUSEUP);
+ assertEquals("black", $("p").css("color"));
+ }
public void testWidgetEvents() {
final Button b = new Button("click-me");