Chromium Code Reviews| Index: LayoutTests/fast/dom/Window/set-and-clear-Timeout-and-Interval.html |
| diff --git a/LayoutTests/fast/dom/Window/set-and-clear-Timeout-and-Interval.html b/LayoutTests/fast/dom/Window/set-and-clear-Timeout-and-Interval.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..87c328f74b493567d2672878fd94d1a4a97c60f8 |
| --- /dev/null |
| +++ b/LayoutTests/fast/dom/Window/set-and-clear-Timeout-and-Interval.html |
| @@ -0,0 +1,44 @@ |
| +<!DOCTYPE html> |
| +<html> |
| +<head> |
| +<title>Set-and-clear Timeout-and-Interval</title> |
| +<script src="../../../resources/testharness.js"></script> |
| +<script src="../../../resources/testharnessreport.js"></script> |
| +<link rel="stylesheet" href="../../../resources/testharness.css"> |
| +</head> |
| +<body> |
| +<p>Actions registered with setTimeout should not be cleared with clearInterval (and vice versa).</p> |
| +<script> |
| +var setTimeoutAndClearIntervalTest = async_test('Actions created with setTimeout should not be cleared by clearInterval.'); |
| + |
| +setTimeoutAndClearIntervalTest.step(function () |
| +{ |
| + function action() |
| + { |
| + setTimeoutAndClearIntervalTest.done(); |
| + } |
| + |
| + var timeoutID = window.setTimeout(setTimeoutAndClearIntervalTest.step_func(action), 0); |
| + |
| + window.clearInterval(timeoutID); // Should not clear the action. |
| +}); |
| + |
| +var setIntervalAndClearTimeoutTest = async_test('Actions created with setInterval should not be cleared by clearTimeout.'); |
| + |
| +setIntervalAndClearTimeoutTest.step(function () |
| +{ |
| + var timeoutID; |
|
Ken Russell (switch to Gerrit)
2013/07/18 19:05:13
intervalID?
Yuta Kitamura
2013/07/19 05:14:08
Done.
|
| + |
| + function action() |
| + { |
| + window.clearInterval(timeoutID); |
| + setIntervalAndClearTimeoutTest.done(); |
| + } |
| + |
| + timeoutID = window.setInterval(setIntervalAndClearTimeoutTest.step_func(action), 0); |
| + |
| + window.clearTimeout(timeoutID); // Should not clear the action. |
| +}); |
| +</script> |
| +</body> |
| +</html> |