Add tests to make sure window events bubble up
This commit is contained in:
parent
931cb7126d
commit
d2f0dab01c
|
@ -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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue