Index: LayoutTests/fast/dom/document-set-title-mutations.html |
diff --git a/LayoutTests/fast/dom/document-set-title-mutations.html b/LayoutTests/fast/dom/document-set-title-mutations.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..c8f1be28ee6efe2f235ab0f6d63d86fb8d5320ff |
--- /dev/null |
+++ b/LayoutTests/fast/dom/document-set-title-mutations.html |
@@ -0,0 +1,28 @@ |
+<!doctype html> |
+<title>old</title> |
+<script src="../../resources/js-test.js"></script> |
+<script> |
+ window.jsTestIsAsync = true; |
+ description("Test for mutations to childList when setting document.title."); |
+ var mutations; |
+ function finish() { |
+ shouldBe('mutations.length', '1'); |
+ shouldBe('mutations[0].type', '"childList"'); |
+ shouldBe('mutations[0].addedNodes.length', '1'); |
+ shouldBe('mutations[0].removedNodes.length', '1'); |
+ finishJSTest(); |
+ } |
+ |
+ var titleElement = document.querySelector('title'); |
+ var i = 0; |
+ |
+ var observer = new MutationObserver(function(mutations) { |
+ window.mutations = mutations; |
+ }); |
+ observer.observe(titleElement, { childList: true }); |
+ document.title = "new"; |
+ |
+ setTimeout(finish, 0); |
+</script> |
+<body> |
+</body> |