summaryrefslogtreecommitdiff
path: root/addons/website/static/lib/MutationObservers/test/mixed.js
diff options
context:
space:
mode:
authorChristophe Matthieu <chm@openerp.com>2013-09-06 10:35:00 +0200
committerChristophe Matthieu <chm@openerp.com>2013-09-06 10:35:00 +0200
commit8a3f1742e0e9c7acaae726e5c7106d2d7df7e970 (patch)
tree78ae5d981fcd25677caea5c8b3999b1e77bf4547 /addons/website/static/lib/MutationObservers/test/mixed.js
parent6f6c59ec1de1881a70e4bf728ea5d8b56bd609f9 (diff)
parentc80cf7d0646463b290137c26fbada568a6942b00 (diff)
[MERGE] from website-al
bzr revid: chm@openerp.com-20130906083500-4n5knaxiqt4cg2ht
Diffstat (limited to 'addons/website/static/lib/MutationObservers/test/mixed.js')
-rw-r--r--addons/website/static/lib/MutationObservers/test/mixed.js36
1 files changed, 36 insertions, 0 deletions
diff --git a/addons/website/static/lib/MutationObservers/test/mixed.js b/addons/website/static/lib/MutationObservers/test/mixed.js
new file mode 100644
index 00000000000..eae6a60604c
--- /dev/null
+++ b/addons/website/static/lib/MutationObservers/test/mixed.js
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2012 The Polymer Authors. All rights reserved.
+ * Use of this source code is governed by a BSD-style
+ * license that can be found in the LICENSE file.
+ */
+
+suite('JsMutationObserver mixed types', function() {
+
+ test('attr and characterData', function() {
+ var div = document.createElement('div');
+ var text = div.appendChild(document.createTextNode('text'));
+ var observer = new JsMutationObserver(function() {});
+ observer.observe(div, {
+ attributes: true,
+ characterData: true,
+ subtree: true
+ });
+ div.setAttribute('a', 'A');
+ div.firstChild.data = 'changed';
+
+ var records = observer.takeRecords();
+ assert.strictEqual(records.length, 2);
+
+ expectRecord(records[0], {
+ type: 'attributes',
+ target: div,
+ attributeName: 'a',
+ attributeNamespace: null
+ });
+ expectRecord(records[1], {
+ type: 'characterData',
+ target: div.firstChild
+ });
+ });
+
+}); \ No newline at end of file