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

Unified Diff: third_party/WebKit/LayoutTests/fast/forms/month/input-valueasdate.html

Issue 2265443002: Fix an overflow in valueAsDate setter of temporal input types. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: accept null Created 4 years, 4 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: third_party/WebKit/LayoutTests/fast/forms/month/input-valueasdate.html
diff --git a/third_party/WebKit/LayoutTests/fast/forms/month/input-valueasdate.html b/third_party/WebKit/LayoutTests/fast/forms/month/input-valueasdate.html
index 47779147eb989837d93de018473f26063e0655bc..ef4b26069019721b2719047fa583d002ba736236 100644
--- a/third_party/WebKit/LayoutTests/fast/forms/month/input-valueasdate.html
+++ b/third_party/WebKit/LayoutTests/fast/forms/month/input-valueasdate.html
@@ -10,6 +10,7 @@
description('Test HTMLInputElement::valueAsDate binding.');
var input = document.createElement('input');
+var date = new Date();
debug('Unsuppported type:');
input.type = 'text';
@@ -26,25 +27,18 @@ shouldBe('typeof valueAsDate', '"object"');
shouldBe('valueAsDate.constructor.name', '"Date"');
debug('Sets an Epoch Date:');
-var date = new Date();
date.setTime(0);
input.valueAsDate = date;
shouldBe('input.value', '"1970-01"');
shouldBe('input.valueAsDate.getTime()', '0');
debug('Sets a number 0:');
-input.valueAsDate = 0;
-shouldBe('input.value', '"1970-01"');
-shouldBe('input.valueAsDate.getTime()', '0');
+shouldThrow('input.valueAsDate = 0');
debug('Sets other types:');
input.value = '1970-01';
input.valueAsDate = null;
shouldBe('input.value', '""');
-input.value = '1970-01';
-input.valueAsDate = undefined;
-shouldBe('input.value', '""');
-input.value = '1970-01';
-input.valueAsDate = document;
-shouldBe('input.value', '""');
+shouldThrow('input.valueAsDate = undefined');
+shouldThrow('input.valueAsDate = document');
</script>
</body>
</html>

Powered by Google App Engine
This is Rietveld 408576698