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

Unified Diff: sky/tests/mutation-observer/takeRecords.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/shadow-dom.sky ('k') | sky/tests/mutation-observer/takeRecords.sky » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/tests/mutation-observer/takeRecords.html
diff --git a/sky/tests/mutation-observer/takeRecords.html b/sky/tests/mutation-observer/takeRecords.html
deleted file mode 100644
index cbceb205f7d16b0c4d00bd0685b17bfe0d06eecb..0000000000000000000000000000000000000000
--- a/sky/tests/mutation-observer/takeRecords.html
+++ /dev/null
@@ -1,53 +0,0 @@
-<html>
-<link rel="import" href="../resources/chai.html" />
-<link rel="import" href="../resources/mocha.html" />
-<script>
-describe('MutationObserver.takeRecords', function() {
- it('should allow taking records synchronously or getting a notification', function(done) {
- var mutations;
- var div;
- var subDiv;
- var observer;
-
- // Testing takeRecords.
- mutations = null;
- div = document.createElement('div');
- subDiv = div.appendChild(document.createElement('div'));
- subDiv.textContent = 'hello, world';
- observer = new MutationObserver(function(records) {
- mutations = records;
- });
-
- observer.observe(div, {attributes: true, characterData: true, subtree: true});
- subDiv.setAttribute('foo', 'bar');
- subDiv.firstChild.textContent = 'goodbye!';
- div.removeChild(subDiv);
-
- mutations = observer.takeRecords();
-
- // ...records are taken synchronously.
-
- assert.equal(mutations.length, 2);
- assert.equal(mutations[0].type, "attributes");
- assert.equal(mutations[0].target, subDiv);
- assert.equal(mutations[0].attributeName, "foo");
- assert.equal(mutations[1].type, "characterData");
- assert.equal(mutations[1].target, subDiv.firstChild);
-
- subDiv.setAttribute('foo', 'baz');
-
- setTimeout(function() {
- // ...takeRecord took records, but did not clear transient observers.
-
- assert.equal(mutations.length, 1);
- assert.equal(mutations[0].type, "attributes");
- assert.equal(mutations[0].target, subDiv);
- assert.equal(mutations[0].attributeName, "foo");
- observer.disconnect();
-
- done();
- }, 0);
- });
-});
-</script>
-</html>
« no previous file with comments | « sky/tests/mutation-observer/shadow-dom.sky ('k') | sky/tests/mutation-observer/takeRecords.sky » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698