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

Unified 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: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | LayoutTests/fast/dom/Window/set-and-clear-Timeout-and-Interval-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..915e4722dd9622ca4c178835072126c930b2be8d
--- /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;
+
+ function action()
+ {
+ window.clearTimeout(timeoutID);
haraken 2013/07/17 03:49:35 What is this for?
Yuta Kitamura 2013/07/17 04:02:34 Oops, I intended this to be clearInterval() to pre
+ setIntervalAndClearTimeoutTest.done();
+ }
+
+ timeoutID = window.setInterval(setIntervalAndClearTimeoutTest.step_func(action), 0);
+
+ window.clearTimeout(timeoutID); // Should not clear the action.
+});
+</script>
+</body>
+</html>
« no previous file with comments | « no previous file | LayoutTests/fast/dom/Window/set-and-clear-Timeout-and-Interval-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698