public void DomContentChanged_ChangeContentOfTextInputWithKeyPressAndMoveToSecondInput_DomContentChangedShouldFire() { string html = "<input id=\"one\" type=\"text\" value=\"hello\" /><input id=\"two\" type=\"text\" value=\"world\" />"; LoadHtml(html); // Place browser on a form and show it. This is need to make the gecko accept the key press. Form f = new Form(); f.Controls.Add(browser); browser.Visible = true; f.Show(); // Focus first input box browser.Document.GetElementById("one").Focus(); GeckoRange range = browser.Document.CreateRange(); range.SelectNode(browser.Document.GetElementById("one")); browser.Window.Selection.AddRange(range); // record if DomContentChanged event happened. bool contentChangedEventReceived = false; browser.DomContentChanged += (sender, e) => contentChangedEventReceived = true; // Modify first input by sending a keypress. // TODO: create wrapper for nsIDOMWindowUtils nsIDOMWindowUtils utils = Xpcom.QueryInterface <nsIDOMWindowUtils>(browser.Window.DomWindow); using (nsAString type = new nsAString("keypress")) { utils.SendKeyEvent(type, 0, 102, 0, false); } // DomContentChanged Event should fire when we move we move to next element. browser.Document.GetElementById("two").Focus(); range.SelectNode(browser.Document.GetElementById("two")); browser.Window.Selection.RemoveAllRanges(); browser.Window.Selection.AddRange(range); Assert.IsTrue(contentChangedEventReceived); }
internal WindowUtils(nsIDOMWindowUtils windowUtils) { _windowUtils = windowUtils; }
internal WindowUtils(nsIDOMWindowUtils windowUtils) { _windowUtils = windowUtils; }
internal WindowUtils(nsIDOMWindowUtils windowUtils) { _windowUtils = new ComPtr <nsIDOMWindowUtils>(windowUtils); }
public static WindowUtils Create(nsIDOMWindowUtils windowUtils) { return(new WindowUtils(windowUtils)); }
internal WindowUtils(nsIDOMWindowUtils windowUtils) { _windowUtils = new ComPtr<nsIDOMWindowUtils>(windowUtils); }
public static WindowUtils Create(nsIDOMWindowUtils windowUtils) { return new WindowUtils(windowUtils); }
internal WindowUtils(nsIDOMWindowUtils windowUtils) { _windowUtils = new InstanceWrapper <nsIDOMWindowUtils>(windowUtils); }
public static WindowUtils Create(mozIDOMWindowProxy window, nsIDOMWindowUtils windowUtils) { return(new WindowUtils(window, windowUtils)); }
internal WindowUtils(mozIDOMWindowProxy window, nsIDOMWindowUtils windowUtils) { _window = window; _windowUtils = new ComPtr <nsIDOMWindowUtils>(windowUtils); }