Index: third_party/WebKit/Source/core/html/HTMLInputElementTest.cpp |
diff --git a/third_party/WebKit/Source/core/html/HTMLInputElementTest.cpp b/third_party/WebKit/Source/core/html/HTMLInputElementTest.cpp |
index bb5c6671da72427e954a1a2ba70c8bc294bc2805..9dabccd19e5d16e0c23f2838cbe3ca697ad1377d 100644 |
--- a/third_party/WebKit/Source/core/html/HTMLInputElementTest.cpp |
+++ b/third_party/WebKit/Source/core/html/HTMLInputElementTest.cpp |
@@ -5,9 +5,13 @@ |
#include "core/html/HTMLInputElement.h" |
#include "core/dom/Document.h" |
+#include "core/frame/FrameHost.h" |
+#include "core/frame/FrameView.h" |
+#include "core/frame/VisualViewport.h" |
#include "core/html/HTMLBodyElement.h" |
#include "core/html/HTMLFormElement.h" |
#include "core/html/HTMLHtmlElement.h" |
+#include "core/html/forms/DateTimeChooser.h" |
#include "core/testing/DummyPageHolder.h" |
#include "testing/gtest/include/gtest/gtest.h" |
#include <memory> |
@@ -84,4 +88,20 @@ TEST(HTMLInputElementTest, ImageTypeCrash) |
input->setAttribute(HTMLNames::valueAttr, "aaa"); |
} |
+TEST(HTMLInputElementTest, DateTimeChooserSizeParamRespectsScale) |
+{ |
+ std::unique_ptr<DummyPageHolder> pageHolder = DummyPageHolder::create(); |
+ Document* document = &(pageHolder->document()); |
+ document->view()->frame().host()->visualViewport().setScale(2.f); |
+ document->body()->setInnerHTML("<input type='date' style='width:200px;height:50px' />", ASSERT_NO_EXCEPTION); |
+ document->view()->updateAllLifecyclePhases(); |
+ HTMLInputElement* input = toHTMLInputElement(document->body()->firstChild()); |
+ |
+ DateTimeChooserParameters params; |
+ bool success = input->setupDateTimeChooserParameters(params); |
+ EXPECT_TRUE(success); |
+ EXPECT_EQ("date", params.type); |
+ EXPECT_EQ(IntRect(16, 16, 400, 100), params.anchorRectInScreen); |
+} |
+ |
} // namespace blink |