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

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLInputElementTest.cpp

Issue 2730573003: Moved FrameHost::m_visualViewport to Page (Closed)
Patch Set: Fixed some compile errors on mac and android Created 3 years, 9 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/html/HTMLInputElement.h" 5 #include "core/html/HTMLInputElement.h"
6 6
7 #include "core/dom/Document.h" 7 #include "core/dom/Document.h"
8 #include "core/frame/FrameHost.h" 8 #include "core/frame/FrameHost.h"
9 #include "core/frame/FrameView.h" 9 #include "core/frame/FrameView.h"
10 #include "core/frame/VisualViewport.h" 10 #include "core/frame/VisualViewport.h"
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 HTMLInputElement* input = HTMLInputElement::create(document(), false); 142 HTMLInputElement* input = HTMLInputElement::create(document(), false);
143 input->setAttribute(HTMLNames::typeAttr, "image"); 143 input->setAttribute(HTMLNames::typeAttr, "image");
144 input->ensureFallbackContent(); 144 input->ensureFallbackContent();
145 // Make sure ensurePrimaryContent() recreates UA shadow tree, and updating 145 // Make sure ensurePrimaryContent() recreates UA shadow tree, and updating
146 // |value| doesn't crash. 146 // |value| doesn't crash.
147 input->ensurePrimaryContent(); 147 input->ensurePrimaryContent();
148 input->setAttribute(HTMLNames::valueAttr, "aaa"); 148 input->setAttribute(HTMLNames::valueAttr, "aaa");
149 } 149 }
150 150
151 TEST_F(HTMLInputElementTest, DateTimeChooserSizeParamRespectsScale) { 151 TEST_F(HTMLInputElementTest, DateTimeChooserSizeParamRespectsScale) {
152 document().view()->frame().host()->visualViewport().setScale(2.f); 152 document().view()->frame().page()->visualViewport().setScale(2.f);
153 document().body()->setInnerHTML( 153 document().body()->setInnerHTML(
154 "<input type='date' style='width:200px;height:50px' />"); 154 "<input type='date' style='width:200px;height:50px' />");
155 document().view()->updateAllLifecyclePhases(); 155 document().view()->updateAllLifecyclePhases();
156 HTMLInputElement* input = toHTMLInputElement(document().body()->firstChild()); 156 HTMLInputElement* input = toHTMLInputElement(document().body()->firstChild());
157 157
158 DateTimeChooserParameters params; 158 DateTimeChooserParameters params;
159 bool success = input->setupDateTimeChooserParameters(params); 159 bool success = input->setupDateTimeChooserParameters(params);
160 EXPECT_TRUE(success); 160 EXPECT_TRUE(success);
161 EXPECT_EQ("date", params.type); 161 EXPECT_EQ("date", params.type);
162 EXPECT_EQ(IntRect(16, 16, 400, 100), params.anchorRectInScreen); 162 EXPECT_EQ(IntRect(16, 16, 400, 100), params.anchorRectInScreen);
163 } 163 }
164 164
165 } // namespace blink 165 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/frame/LocalFrameTest.cpp ('k') | third_party/WebKit/Source/core/html/ImageDocument.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698