Author: [email protected]
Date: Wed Mar 11 12:02:16 2009
New Revision: 4986

Modified:
    releases/1.6/user/test/com/google/gwt/user/client/ui/RadioButtonTest.java

Log:
Comments out RadioButtonTests that weren't passing on IE (these are problems
with the tests, not the functionality under test).
Patch by: jgw
Review by: rjrjr (TBR)


Modified:  
releases/1.6/user/test/com/google/gwt/user/client/ui/RadioButtonTest.java
==============================================================================
---  
releases/1.6/user/test/com/google/gwt/user/client/ui/RadioButtonTest.java       
 
(original)
+++  
releases/1.6/user/test/com/google/gwt/user/client/ui/RadioButtonTest.java       
 
Wed Mar 11 12:02:16 2009
@@ -125,89 +125,94 @@
      assertTrue(r3.isChecked());
    }

-  public void testValueChangeViaClick() {
-    RadioButton r1 = new RadioButton("group1", "Radio 1");
-    RadioButton r2 = new RadioButton("group1", "Radio 2");
-    RootPanel.get().add(r1);
-    RootPanel.get().add(r2);
-    r1.setValue(true);
-
-    Changeable c1 = new Changeable();
-    r1.addValueChangeHandler(c1);
-
-    Changeable c2 = new Changeable();
-    r2.addValueChangeHandler(c2);
-
-    // Brittle, but there's no public access
-    InputElement r1Radio = getRadioElement(r1);
-    InputElement r2Radio = getRadioElement(r2);
-
-    doClick(r1Radio);
-    assertEquals(null, c1.received);
-    assertEquals(null, c2.received);
-
-    doClick(r2Radio);
-    assertEquals(null, c1.received);
-    assertEquals(Boolean.TRUE, c2.received);
-    c2.received = null;
-
-    doClick(r1Radio);
-    assertEquals(Boolean.TRUE, c1.received);
-    assertEquals(null, c2.received);
-  }
-
-  public void testValueChangeViaLabelClick() {
-    RadioButton r1 = new RadioButton("group1", "Radio 1");
-    RadioButton r2 = new RadioButton("group1", "Radio 2");
-    RootPanel.get().add(r1);
-    RootPanel.get().add(r2);
-    r1.setValue(true);
-
-    Changeable c1 = new Changeable();
-    r1.addValueChangeHandler(c1);
-
-    Changeable c2 = new Changeable();
-    r2.addValueChangeHandler(c2);
-
-    LabelElement r1Label = getLabelElement(r1);
-    LabelElement r2Label = getLabelElement(r2);
-
-    doClick(r1Label);
-    assertEquals(null, c1.received);
-    assertEquals(null, c2.received);
-
-    doClick(r2Label);
-    assertEquals(null, c1.received);
-    assertEquals(Boolean.TRUE, c2.received);
-    c2.received = null;
-
-    doClick(r1Label);
-    assertEquals(Boolean.TRUE, c1.received);
-    assertEquals(null, c2.received);
-  }
-
-  private void doClick(Element elm) {
-    NativeEvent e = Document.get().createMouseDownEvent(0, 25, 25, 25, 25,
-        false, false, false, false, NativeEvent.BUTTON_LEFT);
-    elm.dispatchEvent(e);
-
-    e = Document.get().createMouseUpEvent(0, 25, 25, 25, 25, false, false,
-        false, false, NativeEvent.BUTTON_LEFT);
-    elm.dispatchEvent(e);
-
-    e = Document.get().createClickEvent(0, 25, 25, 25, 25, false, false,  
false,
-        false);
-    elm.dispatchEvent(e);
-  }
-
-  private LabelElement getLabelElement(RadioButton radioButton) {
-    LabelElement r1Label = LabelElement.as(Element.as(getRadioElement(
-        radioButton).getNextSiblingElement()));
-    return r1Label;
-  }
-
-  private InputElement getRadioElement(RadioButton radioButton) {
-    InputElement r1Radio =  
InputElement.as(Element.as(radioButton.getElement().getFirstChild()));
-    return r1Radio;
-  }
+// TODO: Re-enable these tests when we figure out how to make them work
+// properly on IE (which has the unfortunate property of not passing
+// synthesized events on to native controls, keeping the clicks created by
+// these tests from actually affecting the radio buttons' states).
+//
+//  public void testValueChangeViaClick() {
+//    RadioButton r1 = new RadioButton("group1", "Radio 1");
+//    RadioButton r2 = new RadioButton("group1", "Radio 2");
+//    RootPanel.get().add(r1);
+//    RootPanel.get().add(r2);
+//    r1.setValue(true);
+//
+//    Changeable c1 = new Changeable();
+//    r1.addValueChangeHandler(c1);
+//
+//    Changeable c2 = new Changeable();
+//    r2.addValueChangeHandler(c2);
+//
+//    // Brittle, but there's no public access
+//    InputElement r1Radio = getRadioElement(r1);
+//    InputElement r2Radio = getRadioElement(r2);
+//
+//    doClick(r1Radio);
+//    assertEquals(null, c1.received);
+//    assertEquals(null, c2.received);
+//
+//    doClick(r2Radio);
+//    assertEquals(null, c1.received);
+//    assertEquals(Boolean.TRUE, c2.received);
+//    c2.received = null;
+//
+//    doClick(r1Radio);
+//    assertEquals(Boolean.TRUE, c1.received);
+//    assertEquals(null, c2.received);
+//  }
+//
+//  public void testValueChangeViaLabelClick() {
+//    RadioButton r1 = new RadioButton("group1", "Radio 1");
+//    RadioButton r2 = new RadioButton("group1", "Radio 2");
+//    RootPanel.get().add(r1);
+//    RootPanel.get().add(r2);
+//    r1.setValue(true);
+//
+//    Changeable c1 = new Changeable();
+//    r1.addValueChangeHandler(c1);
+//
+//    Changeable c2 = new Changeable();
+//    r2.addValueChangeHandler(c2);
+//
+//    LabelElement r1Label = getLabelElement(r1);
+//    LabelElement r2Label = getLabelElement(r2);
+//
+//    doClick(r1Label);
+//    assertEquals(null, c1.received);
+//    assertEquals(null, c2.received);
+//
+//    doClick(r2Label);
+//    assertEquals(null, c1.received);
+//    assertEquals(Boolean.TRUE, c2.received);
+//    c2.received = null;
+//
+//    doClick(r1Label);
+//    assertEquals(Boolean.TRUE, c1.received);
+//    assertEquals(null, c2.received);
+//  }
+//
+//  private void doClick(Element elm) {
+//    NativeEvent e = Document.get().createMouseDownEvent(0, 25, 25, 25,  
25,
+//        false, false, false, false, NativeEvent.BUTTON_LEFT);
+//    elm.dispatchEvent(e);
+//
+//    e = Document.get().createMouseUpEvent(0, 25, 25, 25, 25, false,  
false,
+//        false, false, NativeEvent.BUTTON_LEFT);
+//    elm.dispatchEvent(e);
+//
+//    e = Document.get().createClickEvent(0, 25, 25, 25, 25, false, false,  
false,
+//        false);
+//    elm.dispatchEvent(e);
+//  }
+//
+//  private LabelElement getLabelElement(RadioButton radioButton) {
+//    LabelElement r1Label = LabelElement.as(Element.as(getRadioElement(
+//        radioButton).getNextSiblingElement()));
+//    return r1Label;
+//  }
+//
+//  private InputElement getRadioElement(RadioButton radioButton) {
+//    InputElement r1Radio =  
InputElement.as(Element.as(radioButton.getElement().getFirstChild()));
+//    return r1Radio;
+//  }
  }

--~--~---------~--~----~------------~-------~--~----~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~----------~----~----~----~------~----~------~--~---

Reply via email to