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

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

Issue 707723002: Refactor Autofill for OOPIF (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: more stuff Created 6 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 | « Source/web/WebViewImpl.cpp ('k') | public/web/WebLocalFrame.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/tests/WebViewTest.cpp
diff --git a/Source/web/tests/WebViewTest.cpp b/Source/web/tests/WebViewTest.cpp
index d49a5a094b375d7a76ab0cc5ee60723122a16dc5..1822eb83686a10669f4aee4764f18c813429f0ff 100644
--- a/Source/web/tests/WebViewTest.cpp
+++ b/Source/web/tests/WebViewTest.cpp
@@ -1352,12 +1352,12 @@ TEST_F(WebViewTest, LosingFocusDoesNotTriggerAutofillTextChange)
URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c_str()), WebString::fromUTF8("input_field_populated.html"));
MockAutofillClient client;
WebView* webView = m_webViewHelper.initializeAndLoad(m_baseURL + "input_field_populated.html");
- webView->setAutofillClient(&client);
+ WebLocalFrameImpl* frame = toWebLocalFrameImpl(webView->mainFrame());
+ frame->setAutofillClient(&client);
webView->setInitialFocus(false);
// Set up a composition that needs to be committed.
WebVector<WebCompositionUnderline> emptyUnderlines;
- WebLocalFrameImpl* frame = toWebLocalFrameImpl(webView->mainFrame());
frame->setEditableSelectionOffsets(4, 10);
frame->setCompositionFromExistingText(8, 12, emptyUnderlines);
WebTextInputInfo info = webView->textInputInfo();
@@ -1373,7 +1373,7 @@ TEST_F(WebViewTest, LosingFocusDoesNotTriggerAutofillTextChange)
EXPECT_EQ(1, client.textChangesWhileIgnored());
EXPECT_EQ(0, client.textChangesWhileNotIgnored());
- webView->setAutofillClient(0);
+ frame->setAutofillClient(0);
}
TEST_F(WebViewTest, ConfirmCompositionTriggersAutofillTextChange)
@@ -1381,7 +1381,8 @@ TEST_F(WebViewTest, ConfirmCompositionTriggersAutofillTextChange)
URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c_str()), WebString::fromUTF8("input_field_populated.html"));
MockAutofillClient client;
WebView* webView = m_webViewHelper.initializeAndLoad(m_baseURL + "input_field_populated.html");
- webView->setAutofillClient(&client);
+ WebLocalFrameImpl* frame = toWebLocalFrameImpl(webView->mainFrame());
+ frame->setAutofillClient(&client);
webView->setInitialFocus(false);
// Set up a composition that needs to be committed.
@@ -1401,7 +1402,7 @@ TEST_F(WebViewTest, ConfirmCompositionTriggersAutofillTextChange)
EXPECT_EQ(0, client.textChangesWhileIgnored());
EXPECT_EQ(1, client.textChangesWhileNotIgnored());
- webView->setAutofillClient(0);
+ frame->setAutofillClient(0);
}
TEST_F(WebViewTest, SetCompositionFromExistingTextTriggersAutofillTextChange)
@@ -1409,13 +1410,13 @@ TEST_F(WebViewTest, SetCompositionFromExistingTextTriggersAutofillTextChange)
URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c_str()), WebString::fromUTF8("input_field_populated.html"));
MockAutofillClient client;
WebView* webView = m_webViewHelper.initializeAndLoad(m_baseURL + "input_field_populated.html", true);
- webView->setAutofillClient(&client);
+ WebLocalFrameImpl* frame = toWebLocalFrameImpl(webView->mainFrame());
+ frame->setAutofillClient(&client);
webView->setInitialFocus(false);
WebVector<WebCompositionUnderline> emptyUnderlines;
client.clearChangeCounts();
- WebLocalFrameImpl* frame = toWebLocalFrameImpl(webView->mainFrame());
frame->setCompositionFromExistingText(8, 12, emptyUnderlines);
WebTextInputInfo info = webView->textInputInfo();
@@ -1429,7 +1430,7 @@ TEST_F(WebViewTest, SetCompositionFromExistingTextTriggersAutofillTextChange)
WebDocument document = webView->mainFrame()->document();
EXPECT_EQ(WebString::fromUTF8("none"), document.getElementById("inputEvent").firstChild().nodeValue());
- webView->setAutofillClient(0);
+ frame->setAutofillClient(0);
}
TEST_F(WebViewTest, ShadowRoot)
@@ -2144,7 +2145,8 @@ TEST_F(WebViewTest, FirstUserGestureObservedKeyEvent)
URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c_str()), WebString::fromUTF8("form.html"));
MockAutofillClient client;
WebView* webView = m_webViewHelper.initializeAndLoad(m_baseURL + "form.html", true);
- webView->setAutofillClient(&client);
+ WebLocalFrameImpl* frame = toWebLocalFrameImpl(webView->mainFrame());
+ frame->setAutofillClient(&client);
webView->setInitialFocus(false);
EXPECT_EQ(0, client.getUserGestureNotificationsCount());
@@ -2158,7 +2160,7 @@ TEST_F(WebViewTest, FirstUserGestureObservedKeyEvent)
webView->handleInputEvent(keyEvent);
EXPECT_EQ(1, client.getUserGestureNotificationsCount());
- webView->setAutofillClient(0);
+ frame->setAutofillClient(0);
}
TEST_F(WebViewTest, FirstUserGestureObservedMouseEvent)
@@ -2166,7 +2168,8 @@ TEST_F(WebViewTest, FirstUserGestureObservedMouseEvent)
URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c_str()), WebString::fromUTF8("form.html"));
MockAutofillClient client;
WebView* webView = m_webViewHelper.initializeAndLoad(m_baseURL + "form.html", true);
- webView->setAutofillClient(&client);
+ WebLocalFrameImpl* frame = toWebLocalFrameImpl(webView->mainFrame());
+ frame->setAutofillClient(&client);
webView->setInitialFocus(false);
EXPECT_EQ(0, client.getUserGestureNotificationsCount());
@@ -2182,7 +2185,7 @@ TEST_F(WebViewTest, FirstUserGestureObservedMouseEvent)
webView->handleInputEvent(mouseEvent);
EXPECT_EQ(1, client.getUserGestureNotificationsCount());
- webView->setAutofillClient(0);
+ frame->setAutofillClient(0);
}
TEST_F(WebViewTest, FirstUserGestureObservedGestureTap)
@@ -2190,7 +2193,8 @@ TEST_F(WebViewTest, FirstUserGestureObservedGestureTap)
URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c_str()), WebString::fromUTF8("longpress_selection.html"));
MockAutofillClient client;
WebView* webView = m_webViewHelper.initializeAndLoad(m_baseURL + "longpress_selection.html", true);
- webView->setAutofillClient(&client);
+ WebLocalFrameImpl* frame = toWebLocalFrameImpl(webView->mainFrame());
+ frame->setAutofillClient(&client);
webView->setInitialFocus(false);
EXPECT_EQ(0, client.getUserGestureNotificationsCount());
@@ -2198,7 +2202,7 @@ TEST_F(WebViewTest, FirstUserGestureObservedGestureTap)
EXPECT_TRUE(tapElementById(webView, WebInputEvent::GestureTap, WebString::fromUTF8("target")));
EXPECT_EQ(1, client.getUserGestureNotificationsCount());
- webView->setAutofillClient(0);
+ frame->setAutofillClient(0);
}
TEST_F(WebViewTest, CompareSelectAllToContentAsText)
« no previous file with comments | « Source/web/WebViewImpl.cpp ('k') | public/web/WebLocalFrame.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698