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..389e844fadffb548738e4cbb9b4f426cddb5519a |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/svg/dom/svg-document-set-title-mutations.html |
@@ -0,0 +1,27 @@ |
+<!DOCTYPE html> |
+<script src="../../resources/testharness.js"></script> |
+<script src="../../resources/testharnessreport.js"></script> |
+<script> |
+var SVG_NAMESPACE = "http://www.w3.org/2000/svg"; |
+ |
+function newSVGDocument() { |
fs
2016/03/03 15:49:44
This is only used once, so just do this directly w
hyunjunekim2
2016/03/04 11:29:32
Done.
|
+ return document.implementation.createDocument(SVG_NAMESPACE, "svg", null); |
+} |
+ |
+test(function() { |
+ var doc = newSVGDocument(); |
+ 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> |