diff options
author | tsepez <tsepez@chromium.org> | 2016-08-04 12:07:28 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-08-04 12:07:29 -0700 |
commit | 0fa54b80d488571f10d8a94f6740006f0bf4957c (patch) | |
tree | 0e4e7359dedcd3821b7a827276e67502de5a3f31 /testing | |
parent | beecc34d2b4b295dcefe4a71772983fbccb50eff (diff) | |
download | pdfium-0fa54b80d488571f10d8a94f6740006f0bf4957c.tar.xz |
Beef up timer cancellation tests
Adds more questionable invocations of ClearTimeOut().
Also, checking that nothing happened is fragile. Log at least
one thing to show that the code ran.
Review-Url: https://codereview.chromium.org/2218473002
Diffstat (limited to 'testing')
-rw-r--r-- | testing/resources/bug_620428.in | 14 | ||||
-rw-r--r-- | testing/resources/bug_620428.pdf | 16 |
2 files changed, 29 insertions, 1 deletions
diff --git a/testing/resources/bug_620428.in b/testing/resources/bug_620428.in index 1942305173..050488b1ee 100644 --- a/testing/resources/bug_620428.in +++ b/testing/resources/bug_620428.in @@ -73,8 +73,22 @@ function fireInterval() { } var timer = app.setTimeOut("fireTimeOut()", 3000); var interval = app.setInterval("fireInterval()", 1000); +// Clear timers before they fire. app.clearTimeOut(timer); app.clearInterval(interval); +// Check that clearing a cleared timer is ok. +app.clearTimeOut(timer); +app.clearInterval(interval); +// Check that invoking the wrong clear method is ok +var timer = app.setTimeOut("fireTimeOut()", 3000); +var interval = app.setInterval("fireInterval()", 1000); +app.clearTimeOut(interval); +app.clearInterval(timer); +// Check that clearing a non-timer is ok. +app.clearTimeOut({"size": 42}); +app.clearInterval({"size": 42}); +// Be sure all of this code ran to completion. +app.alert("done"); endstream endobj {{xref}} diff --git a/testing/resources/bug_620428.pdf b/testing/resources/bug_620428.pdf index ff625b7a2e..e53ed50e24 100644 --- a/testing/resources/bug_620428.pdf +++ b/testing/resources/bug_620428.pdf @@ -74,8 +74,22 @@ function fireInterval() { } var timer = app.setTimeOut("fireTimeOut()", 3000); var interval = app.setInterval("fireInterval()", 1000); +// Clear timers before they fire. app.clearTimeOut(timer); app.clearInterval(interval); +// Check that clearing a cleared timer is ok. +app.clearTimeOut(timer); +app.clearInterval(interval); +// Check that invoking the wrong clear method is ok +var timer = app.setTimeOut("fireTimeOut()", 3000); +var interval = app.setInterval("fireInterval()", 1000); +app.clearTimeOut(interval); +app.clearInterval(timer); +// Check that clearing a non-timer is ok. +app.clearTimeOut({"size": 42}); +app.clearInterval({"size": 42}); +// Be sure all of this code ran to completion. +app.alert("done"); endstream endobj xref @@ -135,5 +149,5 @@ trailer << /Root 1 0 R >> startxref -1135 +1655 %%EOF |