Index: third_party/WebKit/LayoutTests/svg/dom/svg-document-set-title-mutations.html |
diff --git a/third_party/WebKit/LayoutTests/svg/dom/svg-document-set-title-mutations.html b/third_party/WebKit/LayoutTests/svg/dom/svg-document-set-title-mutations.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..6323c96ecb88dcc7d19b5e907c58c1ade87d35ed |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/svg/dom/svg-document-set-title-mutations.html |
@@ -0,0 +1,21 @@ |
+<!DOCTYPE html> |
+<script src="../../resources/testharness.js"></script> |
+<script src="../../resources/testharnessreport.js"></script> |
+<script> |
+test(function() { |
+ var doc = document.implementation.createDocument("http://www.w3.org/2000/svg", "svg", null); |
+ doc.title = 'old'; |
+ var titleElement = doc.querySelector('title'); |
+ var observer = new MutationObserver(function(mutations) { |
+ assert_equals(mutations.length, 1); |
+ assert_equals(mutations[0].type, 'childList'); |
+ assert_equals(mutations[0].addedNodes[0].data, 'new'); |
+ assert_equals(mutations[0].addedNodes.length, 1); |
+ assert_equals(mutations[0].removedNodes[0].data, 'old'); |
+ assert_equals(mutations[0].removedNodes.length, 1); |
+ }); |
+ |
+ observer.observe(titleElement, { childList: true }); |
+ doc.title = 'new'; |
+}, "Test for mutations to childList when setting title of svg document."); |
+</script> |