diff --git a/src/test/java/org/htmlunit/general/ElementOwnPropertySymbolsTest.java b/src/test/java/org/htmlunit/general/ElementOwnPropertySymbolsTest.java
index 128b3c67657..05d20b1cda3 100644
--- a/src/test/java/org/htmlunit/general/ElementOwnPropertySymbolsTest.java
+++ b/src/test/java/org/htmlunit/general/ElementOwnPropertySymbolsTest.java
@@ -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) {})");
+ }
}
diff --git a/src/test/java/org/htmlunit/general/ElementPropertiesTest.java b/src/test/java/org/htmlunit/general/ElementPropertiesTest.java
index 6ba8b865642..3e12474f97a 100644
--- a/src/test/java/org/htmlunit/general/ElementPropertiesTest.java
+++ b/src/test/java/org/htmlunit/general/ElementPropertiesTest.java
@@ -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) {})");
+ }
}