Cancel diff processing when the diff processor is detached

Bug: Issue 4730
Change-Id: I50cae3c2c59b447befdccde3fcb4bf4a7dadcae8
This commit is contained in:
Wyatt Allen
2016-10-07 16:56:43 -07:00
parent ac9bbe4817
commit b539c90d02
2 changed files with 8 additions and 0 deletions

View File

@@ -86,6 +86,7 @@
},
detached: function() {
this.cancel();
this.unlisten(window, 'scroll', '_handleWindowScroll');
},

View File

@@ -591,5 +591,12 @@ limitations under the License.
});
});
});
test('detaching cancels', function() {
element = fixture('basic');
sandbox.stub(element, 'cancel');
element.detached();
assert(element.cancel.called);
});
});
</script>