[unseasoned-pdf] Check frame widget's initial text input type.
Following up on https://crrev.com/c/2881308, this CL initializes the frame widget's text input type while constructing the container wrapper, and checks the input type's initial state. Bug: 1199558 Change-Id: I0958173bbdf8bc2468d2940fb63039dbabbb411c Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2889311 Commit-Queue: Hui Yingst <nigi@chromium.org> Reviewed-by: K. Moon <kmoon@chromium.org> Cr-Commit-Position: refs/heads/master@{#881690}
This commit is contained in:

committed by
Chromium LUCI CQ

parent
82c12b2b5d
commit
4ed9c1b23e
@ -70,7 +70,10 @@ SkBitmap GenerateExpectedBitmapForPaint(float device_scale,
|
||||
class FakeContainerWrapper final : public PdfViewWebPlugin::ContainerWrapper {
|
||||
public:
|
||||
explicit FakeContainerWrapper(PdfViewWebPlugin* web_plugin)
|
||||
: web_plugin_(web_plugin) {}
|
||||
: web_plugin_(web_plugin) {
|
||||
UpdateTextInputState();
|
||||
}
|
||||
|
||||
FakeContainerWrapper(const FakeContainerWrapper&) = delete;
|
||||
FakeContainerWrapper& operator=(const FakeContainerWrapper&) = delete;
|
||||
~FakeContainerWrapper() override = default;
|
||||
@ -117,8 +120,7 @@ class FakeContainerWrapper final : public PdfViewWebPlugin::ContainerWrapper {
|
||||
float device_scale_ = 1.0f;
|
||||
|
||||
// Represents the frame widget's text input type.
|
||||
blink::WebTextInputType widget_text_input_type_ =
|
||||
blink::WebTextInputType::kWebTextInputTypeNone;
|
||||
blink::WebTextInputType widget_text_input_type_;
|
||||
|
||||
PdfViewWebPlugin* web_plugin_;
|
||||
};
|
||||
@ -281,6 +283,9 @@ TEST_F(PdfViewWebPluginTest, PaintSnapshots) {
|
||||
}
|
||||
|
||||
TEST_F(PdfViewWebPluginTest, FormTextFieldFocusChangeUpdatesTextInputType) {
|
||||
ASSERT_EQ(blink::WebTextInputType::kWebTextInputTypeNone,
|
||||
wrapper_ptr_->widget_text_input_type());
|
||||
|
||||
plugin_->FormTextFieldFocusChange(true);
|
||||
EXPECT_EQ(blink::WebTextInputType::kWebTextInputTypeText,
|
||||
wrapper_ptr_->widget_text_input_type());
|
||||
|
Reference in New Issue
Block a user