Add tests to make sure window events bubble up

This commit is contained in:
Frank A. Krueger 2018-04-16 15:19:40 -07:00
parent 931cb7126d
commit d2f0dab01c
No known key found for this signature in database
GPG Key ID: 0471C67474FFE664
1 changed files with 26 additions and 0 deletions

View File

@ -89,5 +89,31 @@ namespace Tests
b.Document.Body.Call ("foo"); b.Document.Body.Call ("foo");
Assert.IsTrue (received); Assert.IsTrue (received);
} }
[TestMethod]
public void ParentElementGetsWindowMessages ()
{
var b = new Button ();
var d = new Div (b);
var received = false;
d.MessageSent += m => {
received = m.TargetId == "window";
};
b.Document.Window.Location = "http://google.com";
Assert.IsTrue (received);
}
[TestMethod]
public void ParentElementGetsBodyMessages ()
{
var b = new Button ();
var d = new Div (b);
var received = false;
d.MessageSent += m => {
received = m.TargetId == "document.body";
};
b.Document.Body.AppendChild (new Button ());
Assert.IsTrue (received);
}
} }
} }