mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
38 lines
997 B
HTML
38 lines
997 B
HTML
<html>
|
|
<link rel="import" href="../resources/chai.html" />
|
|
<link rel="import" href="inspector/backend/dom-agent.html" as="DOMAgent" />
|
|
<div><div></div></div>
|
|
<script>
|
|
// setTimeout to flush pending DOM modifications and measure
|
|
// only the changes we want to.
|
|
var expectedMessages = [
|
|
'DOM.childNodeRemoved',
|
|
'DOM.childNodeInserted',
|
|
];
|
|
var actualMessages = [];
|
|
|
|
setTimeout(function() {
|
|
var delegate = {
|
|
sendMessage: function(message, params) {
|
|
actualMessages.push(message);
|
|
}
|
|
};
|
|
|
|
var domAgent = new DOMAgent(delegate);
|
|
domAgent.enable();
|
|
|
|
var adding = document.createElement('adding');
|
|
var container = document.querySelector('div');
|
|
container.firstChild.remove();
|
|
container.appendChild(document.createElement('adding'));
|
|
|
|
setTimeout(function() {
|
|
assert.equal(JSON.stringify(expectedMessages),
|
|
JSON.stringify(actualMessages));
|
|
internals.notifyTestComplete("Done!");
|
|
});
|
|
});
|
|
</script>
|
|
|
|
</html>
|