Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(34)

Unified Diff: sky/tests/mutation-observer/shadow-dom.html

Issue 685623002: Move the tests from .html to .sky (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sky/tests/mutation-observer/script-append.sky ('k') | sky/tests/mutation-observer/shadow-dom.sky » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/tests/mutation-observer/shadow-dom.html
diff --git a/sky/tests/mutation-observer/shadow-dom.html b/sky/tests/mutation-observer/shadow-dom.html
deleted file mode 100644
index e4f4751872aa55e1bf44cc4e310f529afccaad92..0000000000000000000000000000000000000000
--- a/sky/tests/mutation-observer/shadow-dom.html
+++ /dev/null
@@ -1,40 +0,0 @@
-<html>
-<link rel="import" href="../resources/chai.html" />
-<link rel="import" href="../resources/mocha.html" />
-<div id="range"></div>
-<script>
-describe('MutationObservers', function() {
- it('should handle shadow dom', function() {
- function mutate(element) {
- element.setAttribute('data-foo', 'bar');
- element.insertBefore(document.createTextNode('hello'), element.firstChild);
- element.firstChild.textContent = 'goodbye';
- element.removeChild(element.firstChild);
- }
-
- var range = document.getElementById('range');
- var shadowRoot = range.createShadowRoot();
- shadowRoot.appendChild(document.createElement('div'));
- var observer = new MutationObserver(function() { });
-
- observer.observe(shadowRoot.firstChild, {attributes: true, childList: true, characterData: true, subtree: true});
- mutate(shadowRoot.firstChild);
-
- var mutations = observer.takeRecords();
- // Mutations in shadow DOM should have been observed:
- assert.equal(mutations.length, 4);
- assert.equal(mutations[0].type, "attributes");
- assert.equal(mutations[1].type, "childList");
- assert.equal(mutations[2].type, "characterData");
- assert.equal(mutations[3].type, "childList");
- observer.disconnect();
-
- mutations = observer.takeRecords();
- observer.observe(document, {attributes: true, childList: true, characterData: true, subtree: true});
- mutate(shadowRoot.firstChild);
- // Observing from outside shadow DOM should not see mutations in the shadow:
- assert.equal(mutations.length, 0);
- });
-});
-</script>
-</html>
« no previous file with comments | « sky/tests/mutation-observer/script-append.sky ('k') | sky/tests/mutation-observer/shadow-dom.sky » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698