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

Unified Diff: third_party/WebKit/Source/web/tests/WebViewTest.cpp

Issue 1433103002: Use FocusParams in FocusController::setFocusedElement and Document::setFocusedElement arguments. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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
« no previous file with comments | « third_party/WebKit/Source/web/WebViewImpl.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/web/tests/WebViewTest.cpp
diff --git a/third_party/WebKit/Source/web/tests/WebViewTest.cpp b/third_party/WebKit/Source/web/tests/WebViewTest.cpp
index 74fae3836778390c1771d619274b15f211bdd11d..0d1b5953d2512b952b07c4f6cf8f47ab4b8483b0 100644
--- a/third_party/WebKit/Source/web/tests/WebViewTest.cpp
+++ b/third_party/WebKit/Source/web/tests/WebViewTest.cpp
@@ -2438,7 +2438,7 @@ TEST_F(WebViewTest, TextInputFlags)
// (A.1) Verifies autocorrect/autocomplete/spellcheck flags are Off and
// autocapitalize is set to none.
HTMLInputElement* inputElement = toHTMLInputElement(document->getElementById("input"));
- document->setFocusedElement(inputElement);
+ document->setFocusedElement(inputElement, FocusParams(SelectionBehaviorOnFocus::None, WebFocusTypeNone, nullptr));
webViewImpl->setFocus(true);
WebTextInputInfo info = webViewImpl->textInputInfo();
EXPECT_EQ(
@@ -2448,7 +2448,7 @@ TEST_F(WebViewTest, TextInputFlags)
// (A.2) Verifies autocorrect/autocomplete/spellcheck flags are On and
// autocapitalize is set to sentences.
inputElement = toHTMLInputElement(document->getElementById("input2"));
- document->setFocusedElement(inputElement);
+ document->setFocusedElement(inputElement, FocusParams(SelectionBehaviorOnFocus::None, WebFocusTypeNone, nullptr));
webViewImpl->setFocus(true);
info = webViewImpl->textInputInfo();
EXPECT_EQ(
@@ -2458,7 +2458,7 @@ TEST_F(WebViewTest, TextInputFlags)
// (B) <textarea> Verifies the default text input flags are
// WebTextInputFlagAutocapitalizeSentences.
HTMLTextAreaElement* textAreaElement = toHTMLTextAreaElement(document->getElementById("textarea"));
- document->setFocusedElement(textAreaElement);
+ document->setFocusedElement(textAreaElement, FocusParams(SelectionBehaviorOnFocus::None, WebFocusTypeNone, nullptr));
webViewImpl->setFocus(true);
info = webViewImpl->textInputInfo();
EXPECT_EQ(WebTextInputFlagAutocapitalizeSentences, info.flags);
@@ -2486,7 +2486,7 @@ TEST_F(WebViewTest, NonUserInputTextUpdate)
EXPECT_FALSE(client.textIsUpdated());
HTMLInputElement* inputElement = toHTMLInputElement(document->getElementById("input"));
- document->setFocusedElement(inputElement);
+ document->setFocusedElement(inputElement, FocusParams(SelectionBehaviorOnFocus::None, WebFocusTypeNone, nullptr));
webViewImpl->setFocus(true);
EXPECT_EQ(document->focusedElement(), static_cast<Element*>(inputElement));
@@ -2510,7 +2510,7 @@ TEST_F(WebViewTest, NonUserInputTextUpdate)
// (A.3) Unfocused and value is changed by script.
client.reset();
EXPECT_FALSE(client.textIsUpdated());
- document->setFocusedElement(nullptr);
+ document->clearFocusedElement();
webViewImpl->setFocus(false);
EXPECT_NE(document->focusedElement(), static_cast<Element*>(inputElement));
inputElement->setValue("testA3");
@@ -2521,7 +2521,7 @@ TEST_F(WebViewTest, NonUserInputTextUpdate)
client.reset();
EXPECT_FALSE(client.textIsUpdated());
HTMLTextAreaElement* textAreaElement = toHTMLTextAreaElement(document->getElementById("textarea"));
- document->setFocusedElement(textAreaElement);
+ document->setFocusedElement(textAreaElement, FocusParams(SelectionBehaviorOnFocus::None, WebFocusTypeNone, nullptr));
webViewImpl->setFocus(true);
EXPECT_EQ(document->focusedElement(), static_cast<Element*>(textAreaElement));
textAreaElement->setValue("testB");
@@ -2540,7 +2540,7 @@ TEST_F(WebViewTest, NonUserInputTextUpdate)
// (B.3) Unfocused and value is changed by script.
client.reset();
EXPECT_FALSE(client.textIsUpdated());
- document->setFocusedElement(nullptr);
+ document->clearFocusedElement();
webViewImpl->setFocus(false);
EXPECT_NE(document->focusedElement(), static_cast<Element*>(textAreaElement));
inputElement->setValue("testB3");
« no previous file with comments | « third_party/WebKit/Source/web/WebViewImpl.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698