Pause() public static method

public static Pause ( ) : EventCollection
return EventCollection
Ejemplo n.º 1
0
        protected void ExpectEvents(int count, Atk.Role role, string evType)
        {
            if (events == null)
            {
                events = EventMonitor.Pause();
            }
            EventCollection evs         = events.FindByRole(role).FindByType(evType);
            string          eventsInXml = String.Format(" events in XML: {0}", Environment.NewLine + events.OriginalGrossXml);

            Assert.AreEqual(count, evs.Count, "bad number of " + evType + " events: " + eventsInXml);
        }
Ejemplo n.º 2
0
        protected void ExpectEvents(int min, int max, Atk.Role role, string evType)
        {
            GlibSync();
            if (events == null)
            {
                events = EventMonitor.Pause();
            }
            EventCollection evs         = events.FindByRole(role).FindByType(evType);
            string          eventsInXml = String.Format(" events in XML: {0}", Environment.NewLine + events.OriginalGrossXml);

            Assert.IsTrue(evs.Count >= min && evs.Count <= max, "Expected " + min + "-" + max + " " + evType + " events but got " + evs.Count + ": " + eventsInXml);
        }
Ejemplo n.º 3
0
        public void OpenFileDialog()
        {
            using (var runner = new DialogRunner(new SWF.OpenFileDialog())) {
                VerifyBasicProperties(runner.Dialog);

                UiaAtkBridge.Window dialogAdapter =
                    BridgeTester.GetAdapterForWidget(runner.Dialog) as UiaAtkBridge.Window;

                Atk.Object popupButtonPanelAdapter = dialogAdapter.RefAccessibleChild(10);
                Assert.AreEqual(5, popupButtonPanelAdapter.NAccessibleChildren, "PopupButtonPanel (toolbar) should have 5 children");

                Atk.Object popupButtonAdapter1 = popupButtonPanelAdapter.RefAccessibleChild(0).RefAccessibleChild(0);
                AtkTester.States(popupButtonAdapter1,
                                 Atk.StateType.Enabled,
                                 Atk.StateType.Selectable,
                                 Atk.StateType.Focusable,
                                 Atk.StateType.Sensitive,
                                 Atk.StateType.Showing,
                                 Atk.StateType.Visible);

                // TODO: Enable the below if we find a way
                // to get the MWFFileView to update
                //Atk.Object treeTable = dialogAdapter.RefAccessibleChild (3);
                //Assert.AreEqual (Atk.Role.TreeTable, treeTable.Role, "TreeTable Role");
                //Atk.Object tableCell = treeTable.RefAccessibleChild (1);;
                //Assert.IsNotNull (tableCell, "TableCell should not be null");
                //Assert.AreEqual (Atk.Role.TableCell, tableCell.Role, "TableCell role");
                //Atk.Action atkAction = Atk.ActionAdapter.GetObject (tableCell.Handle, false);
                //Assert.AreEqual (2, atkAction.NActions, "TableCell NActions");
                //Assert.AreEqual ("invoke", atkAction.GetName (1), "TableCell Action.GetName (1)");

                Atk.Object comboBox = dialogAdapter.RefAccessibleChild(8);
                Assert.AreEqual(Atk.Role.ComboBox, comboBox.Role, "ComboBox Role");
                Atk.Object list = comboBox.RefAccessibleChild(0);
                Assert.IsTrue(list.NAccessibleChildren > 0, "ComboBox child should have children");
                EventMonitor.Start();
                Atk.ISelection atkSelection = Atk.SelectionAdapter.GetObject(list.Handle, false);
                atkSelection.AddSelection(5);
                string          evType      = "object:state-changed:selected";
                EventCollection events      = EventMonitor.Pause();
                EventCollection evs         = events.FindByType(evType).FindWithDetail1("1");
                string          eventsInXml = String.Format(" events in XML: {0}", Environment.NewLine + events.OriginalGrossXml);
                Assert.IsTrue(evs.Count > 0, "bad number of " + evType + " events: " + eventsInXml);
            }
        }