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

Side by Side Diff: LayoutTests/fast/dom/Window/set-and-clear-Timeout-and-Interval.html

Issue 19494002: Distinguish actions registered with setTimeout() and setInterval(). (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix test, and add a new test. Created 7 years, 5 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 unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <title>Set-and-clear Timeout-and-Interval</title>
5 <script src="../../../resources/testharness.js"></script>
6 <script src="../../../resources/testharnessreport.js"></script>
7 <link rel="stylesheet" href="../../../resources/testharness.css">
8 </head>
9 <body>
10 <p>Actions registered with setTimeout should not be cleared with clearInterval ( and vice versa).</p>
11 <script>
12 var setTimeoutAndClearIntervalTest = async_test('Actions created with setTimeout should not be cleared by clearInterval.');
13
14 setTimeoutAndClearIntervalTest.step(function ()
15 {
16 function action()
17 {
18 setTimeoutAndClearIntervalTest.done();
19 }
20
21 var timeoutID = window.setTimeout(setTimeoutAndClearIntervalTest.step_func(a ction), 0);
22
23 window.clearInterval(timeoutID); // Should not clear the action.
24 });
25
26 var setIntervalAndClearTimeoutTest = async_test('Actions created with setInterva l should not be cleared by clearTimeout.');
27
28 setIntervalAndClearTimeoutTest.step(function ()
29 {
30 var timeoutID;
Ken Russell (switch to Gerrit) 2013/07/18 19:05:13 intervalID?
Yuta Kitamura 2013/07/19 05:14:08 Done.
31
32 function action()
33 {
34 window.clearInterval(timeoutID);
35 setIntervalAndClearTimeoutTest.done();
36 }
37
38 timeoutID = window.setInterval(setIntervalAndClearTimeoutTest.step_func(acti on), 0);
39
40 window.clearTimeout(timeoutID); // Should not clear the action.
41 });
42 </script>
43 </body>
44 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698