protected void TestInnerTextBoxInComboBox (Atk.Object accessible) { Atk.Object entryChild = accessible.RefAccessibleChild (1); Assert.IsNotNull (entryChild, "ComboBox child#1 should not be null"); Assert.AreEqual (entryChild.Role, Atk.Role.Text, "Role of 2nd child"); Assert.IsNull (entryChild.Name, "textbox .Name should be null"); //TODO: send this object to TextBoxEntry () test }
IEnumerable<Atk.Object> GetAccessibleChildren(Atk.Object obj) { var count = obj.NAccessibleChildren; for (int i = 0; i < count; i++) { var child = obj.RefAccessibleChild (i); yield return child; foreach (var c in GetAccessibleChildren (child)) yield return c; } }
public void HSplitter (Atk.Object accessible) { BasicWidgetType type = BasicWidgetType.HSplitContainer; Atk.IComponent atkComponent = CastToAtkInterface <Atk.IComponent> (accessible); InterfaceComponent (type, atkComponent); PropertyRole (type, accessible); Parent (type, accessible); States (accessible, Atk.StateType.Enabled, Atk.StateType.Focusable, Atk.StateType.Horizontal, Atk.StateType.Sensitive, Atk.StateType.Showing, Atk.StateType.Visible); Assert.AreEqual (2, accessible.NAccessibleChildren, "HSplitter NAccessibleChildren"); Atk.Object child1 = accessible.RefAccessibleChild (0); Atk.Object child2 = accessible.RefAccessibleChild (1); Atk.IValue atkValue = CastToAtkInterface<Atk.IValue> (accessible); Atk.IComponent component1 = CastToAtkInterface<Atk.IComponent> (child1); Atk.IComponent component2 = CastToAtkInterface<Atk.IComponent> (child2); RunInGuiThread (delegate () { int x1, x2, y1, y2, w1, w2, h1, h2; component1.GetExtents (out x1, out y1, out w1, out h1, Atk.CoordType.Window); component2.GetExtents (out x2, out y2, out w2, out h2, Atk.CoordType.Window); Atk.IComponent rightComponent = (x2 > x1? component2: component1); double minVal = GetMinimumValue (atkValue); double maxVal = GetMaximumValue (atkValue); SetCurrentValue (atkValue, minVal); rightComponent.GetExtents (out x1, out y1, out w1, out h1, Atk.CoordType.Window); StartEventMonitor (); SetCurrentValue (atkValue, minVal + (maxVal - minVal) / 2); System.Threading.Thread.Sleep (1000); ExpectEvents (1, Atk.Role.SplitPane, "object:property-change:accessible-value"); double midVal = GetCurrentValue (atkValue); Assert.IsTrue (midVal > minVal && midVal < maxVal, "Mid value should be between min and max"); rightComponent.GetExtents (out x2, out y2, out w2, out h2, Atk.CoordType.Window); Assert.IsTrue (x2 > x1, "Right control moved"); Assert.AreEqual (y2, y1, "y should not change"); Assert.IsTrue (w2 < w1, "Right control width decreased"); Assert.AreEqual (h2, h1, "Height should not change"); }); }