Skip to content

Commit

Permalink
add missing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rbri committed Sep 24, 2023
1 parent b0daff1 commit 5bff268
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3743,4 +3743,34 @@ public void urlSearchParams() throws Exception {
public void namedNodeMap() throws Exception {
testString("", "element.attributes");
}

/**
* Test MutationObserver.
*
* @throws Exception if the test fails
*/
@Test
@Alerts(CHROME = "Symbol(Symbol.toStringTag) [MutationObserver]",
EDGE = "Symbol(Symbol.toStringTag) [MutationObserver]",
FF = "Symbol(Symbol.toStringTag) [MutationObserver]",
FF_ESR = "Symbol(Symbol.toStringTag) [MutationObserver]",
IE = "exception")
public void mutationObserver() throws Exception {
testString("", "new MutationObserver(function(m) {})");
}

/**
* Test WebKitMutationObserver.
*
* @throws Exception if the test fails
*/
@Test
@Alerts(CHROME = "Symbol(Symbol.toStringTag) [MutationObserver]",
EDGE = "Symbol(Symbol.toStringTag) [MutationObserver]",
FF = "exception",
FF_ESR = "exception",
IE = "exception")
public void webKitMutationObserver() throws Exception {
testString("", "new WebKitMutationObserver(function(m) {})");
}
}
30 changes: 30 additions & 0 deletions src/test/java/org/htmlunit/general/ElementPropertiesTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -9335,4 +9335,34 @@ public void urlSearchParams() throws Exception {
public void namedNodeMap() throws Exception {
testString("", "element.attributes");
}

/**
* Test MutationObserver.
*
* @throws Exception if the test fails
*/
@Test
@Alerts(CHROME = "disconnect(),observe(),takeRecords()",
EDGE = "disconnect(),observe(),takeRecords()",
FF = "disconnect(),observe(),takeRecords()",
FF_ESR = "disconnect(),observe(),takeRecords()",
IE = "disconnect(),observe(),takeRecords()")
public void mutationObserver() throws Exception {
testString("", "new MutationObserver(function(m) {})");
}

/**
* Test WebKitMutationObserver.
*
* @throws Exception if the test fails
*/
@Test
@Alerts(CHROME = "disconnect(),observe(),takeRecords()",
EDGE = "disconnect(),observe(),takeRecords()",
FF = "exception",
FF_ESR = "exception",
IE = "exception")
public void webKitMutationObserver() throws Exception {
testString("", "new WebKitMutationObserver(function(m) {})");
}
}

0 comments on commit 5bff268

Please sign in to comment.