mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-10-30 15:41:48 +00:00
Add tests for Event
Signed-off-by: Francis Bouvier <francis@lightpanda.io>
This commit is contained in:
@@ -60,6 +60,8 @@ pub fn testExecFn(
|
||||
var common = [_]Case{
|
||||
.{ .src = "let content = document.getElementById('content')", .ex = "undefined" },
|
||||
.{ .src = "let para = document.getElementById('para')", .ex = "undefined" },
|
||||
// NOTE: as some event properties will change during the event dispatching phases
|
||||
// we need to copy thoses values in order to check them afterwards
|
||||
.{ .src =
|
||||
\\var nb = 0; var evt; var phase; var cur;
|
||||
\\function cbk(event) {
|
||||
@@ -121,6 +123,7 @@ pub fn testExecFn(
|
||||
.{ .src = "nb", .ex = "1" },
|
||||
.{ .src = "evt instanceof Event", .ex = "true" },
|
||||
.{ .src = "evt.type", .ex = "bubbles" },
|
||||
.{ .src = "evt.bubbles", .ex = "true" },
|
||||
.{ .src = "phase", .ex = "2" },
|
||||
.{ .src = "cur.getAttribute('id')", .ex = "content" },
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user