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

Unified Diff: test/webkit/fast/js/date-preserve-milliseconds.js

Issue 20280003: Migrate more tests from blink repository. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
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
Index: test/webkit/fast/js/date-preserve-milliseconds.js
diff --git a/test/webkit/dfg-inline-arguments-out-of-bounds.js b/test/webkit/fast/js/date-preserve-milliseconds.js
similarity index 66%
copy from test/webkit/dfg-inline-arguments-out-of-bounds.js
copy to test/webkit/fast/js/date-preserve-milliseconds.js
index 23b9184cacacfb4aa3c1bd5fc1dda6fd5c4f7349..4608bfc3289f814ebc7079304e4d7f4880f96b00 100644
--- a/test/webkit/dfg-inline-arguments-out-of-bounds.js
+++ b/test/webkit/fast/js/date-preserve-milliseconds.js
@@ -22,32 +22,23 @@
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
description(
-"Tests accessing arguments with an out-of-bounds index in an inlined function when the arguments have not been created but might be."
+'The following test checks if an existing milliseconds value gets preserved if a call to setHours(), setMinutes() or setSeconds() does not specify the milliseconds. See <a href="https://bugs.webkit.org/show_bug.cgi?id=3759">https://bugs.webkit.org/show_bug.cgi?id=3759</a>'
);
-var p = false;
+var d = new Date(0);
+d.setMilliseconds(1);
-function foo() {
- if (p)
- return arguments;
- return arguments[0];
-}
-
-function bar() {
- return foo();
-}
-
-var expected = "\"undefined\"";
-for (var i = 0; i < 3000; ++i) {
- if (i == 1000) {
- p = true;
- expected = "\"[object Arguments]\"";
- }
- if (i == 2000) {
- p = false;
- expected = "\"undefined\"";
- }
- result = "" + bar();
- shouldBe("result", expected);
-}
+var oldValue = d.getMilliseconds();
+d.setHours(8);
+shouldBe("d.getMilliseconds()", oldValue.toString());
+d.setHours(8, 30);
+shouldBe("d.getMilliseconds()", oldValue.toString());
+d.setHours(8, 30, 40);
+shouldBe("d.getMilliseconds()", oldValue.toString());
+d.setMinutes(45);
+shouldBe("d.getMilliseconds()", oldValue.toString());
+d.setMinutes(45, 40);
+shouldBe("d.getMilliseconds()", oldValue.toString());
+d.setSeconds(50);
+shouldBe("d.getMilliseconds()", oldValue.toString());
« no previous file with comments | « test/webkit/fast/js/date-negative-setmonth-expected.txt ('k') | test/webkit/fast/js/date-preserve-milliseconds-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698