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

Side by Side Diff: third_party/WebKit/Source/web/tests/WebViewTest.cpp

Issue 1860273002: Fix scrollIntoViewIfNeeded when scroll box has no height or width. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed broken composition test Created 4 years, 8 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
« no previous file with comments | « third_party/WebKit/Source/platform/LayoutUnit.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 955 matching lines...) Expand 10 before | Expand all | Expand 10 after
966 EXPECT_EQ(8, info.selectionStart); 966 EXPECT_EQ(8, info.selectionStart);
967 EXPECT_EQ(8, info.selectionEnd); 967 EXPECT_EQ(8, info.selectionEnd);
968 EXPECT_EQ(-1, info.compositionStart); 968 EXPECT_EQ(-1, info.compositionStart);
969 EXPECT_EQ(-1, info.compositionEnd); 969 EXPECT_EQ(-1, info.compositionEnd);
970 } 970 }
971 971
972 TEST_F(WebViewTest, FinishCompositionDoesNotRevealSelection) 972 TEST_F(WebViewTest, FinishCompositionDoesNotRevealSelection)
973 { 973 {
974 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c _str()), WebString::fromUTF8("form_with_input.html")); 974 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c _str()), WebString::fromUTF8("form_with_input.html"));
975 WebViewImpl* webView = m_webViewHelper.initializeAndLoad(m_baseURL + "form_w ith_input.html"); 975 WebViewImpl* webView = m_webViewHelper.initializeAndLoad(m_baseURL + "form_w ith_input.html");
976 webView->resize(WebSize(800, 600));
976 webView->setInitialFocus(false); 977 webView->setInitialFocus(false);
977 EXPECT_EQ(0, webView->mainFrame()->scrollOffset().width); 978 EXPECT_EQ(0, webView->mainFrame()->scrollOffset().width);
978 EXPECT_EQ(0, webView->mainFrame()->scrollOffset().height); 979 EXPECT_EQ(0, webView->mainFrame()->scrollOffset().height);
979 980
980 // Set up a composition from existing text that needs to be committed. 981 // Set up a composition from existing text that needs to be committed.
981 Vector<CompositionUnderline> emptyUnderlines; 982 Vector<CompositionUnderline> emptyUnderlines;
982 WebLocalFrameImpl* frame = toWebLocalFrameImpl(webView->mainFrame()); 983 WebLocalFrameImpl* frame = toWebLocalFrameImpl(webView->mainFrame());
983 frame->frame()->inputMethodController().setCompositionFromExistingText(empty Underlines, 3, 3); 984 frame->frame()->inputMethodController().setCompositionFromExistingText(empty Underlines, 3, 3);
984 985
985 // Scroll the input field out of the viewport. 986 // Scroll the input field out of the viewport.
(...skipping 2289 matching lines...) Expand 10 before | Expand all | Expand 10 after
3275 frame->setAutofillClient(&client); 3276 frame->setAutofillClient(&client);
3276 webView->setInitialFocus(false); 3277 webView->setInitialFocus(false);
3277 3278
3278 EXPECT_TRUE(webView->confirmComposition(WebString::fromUTF8(std::string("hel lo").c_str()))); 3279 EXPECT_TRUE(webView->confirmComposition(WebString::fromUTF8(std::string("hel lo").c_str())));
3279 EXPECT_EQ(1, client.textChangesFromUserGesture()); 3280 EXPECT_EQ(1, client.textChangesFromUserGesture());
3280 EXPECT_FALSE(UserGestureIndicator::processingUserGesture()); 3281 EXPECT_FALSE(UserGestureIndicator::processingUserGesture());
3281 frame->setAutofillClient(0); 3282 frame->setAutofillClient(0);
3282 } 3283 }
3283 3284
3284 } // namespace blink 3285 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/LayoutUnit.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698