From 3df4ef20bdb5e050aa71ee2f75fccd445d708d09 Mon Sep 17 00:00:00 2001 From: Steven Orvell Date: Mon, 30 Nov 2015 14:29:34 -0800 Subject: [PATCH] Fixes #3108. Moves `debounce` functionality from polymer-micro to polymer-mini. The functionality belongs at the mini tier and was never actually functional in micro. --- polymer-micro.html | 3 -- polymer-mini.html | 1 + src/{micro => mini}/debouncer.html | 3 ++ test/runner.html | 1 + test/unit/debounce.html | 83 ++++++++++++++++++++++++++++++ test/unit/utils.html | 41 --------------- 6 files changed, 88 insertions(+), 44 deletions(-) rename src/{micro => mini}/debouncer.html (94%) create mode 100644 test/unit/debounce.html diff --git a/polymer-micro.html b/polymer-micro.html index 3914a91e5b..209235a224 100644 --- a/polymer-micro.html +++ b/polymer-micro.html @@ -14,7 +14,6 @@ - + + + + + + + + diff --git a/test/unit/utils.html b/test/unit/utils.html index 4415ce90b3..bc14a3feed 100644 --- a/test/unit/utils.html +++ b/test/unit/utils.html @@ -57,47 +57,6 @@ }); - suite('debounce', function() { - - test('debounce (no-wait)', function(done) { - - var called = 0; - var cb = function() { - called++; - }; - - window.el1.debounce('foo', cb); - window.el1.debounce('foo', cb); - window.el1.debounce('foo', cb); - - setTimeout(function() { - assert.equal(called, 1, 'debounce should be called exactly once'); - done(); - }, 50); - - }); - - test('debounce (wait)', function(done) { - - var called = 0; - var now = Date.now(); - var cb = function() { - called++; - }; - - window.el1.debounce('foo', cb); - window.el1.debounce('foo', cb, 100); - window.el1.debounce('foo', cb, 100); - - setTimeout(function() { - assert.equal(called, 1, 'debounce should be called exactly once'); - assert(Date.now() - now > 100, 'debounce should be called after at least 100ms'); - done(); - }, 200); - - }); - - });