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

Unified Diff: third_party/WebKit/Source/core/html/HTMLInputElementTest.cpp

Issue 2095113002: Fix date picker datalist suggestion dropdown size with use-zoom-for-dsf. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: forgot to rebaseline linux Created 4 years, 6 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/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
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLInputElement.cpp ('k') | third_party/WebKit/Source/core/html/forms/DateTimeChooser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698