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

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

Issue 2530843003: Introduce InsertIncrementalTextCommand to respect existing style for composition (Closed)
Patch Set: Created 4 years 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 /* 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 1261 matching lines...) Expand 10 before | Expand all | Expand 10 after
1272 WebViewImpl* webView = 1272 WebViewImpl* webView =
1273 m_webViewHelper.initializeAndLoad(m_baseURL + "form_with_input.html"); 1273 m_webViewHelper.initializeAndLoad(m_baseURL + "form_with_input.html");
1274 webView->resize(WebSize(800, 600)); 1274 webView->resize(WebSize(800, 600));
1275 webView->setInitialFocus(false); 1275 webView->setInitialFocus(false);
1276 EXPECT_EQ(0, webView->mainFrame()->scrollOffset().width); 1276 EXPECT_EQ(0, webView->mainFrame()->scrollOffset().width);
1277 EXPECT_EQ(0, webView->mainFrame()->scrollOffset().height); 1277 EXPECT_EQ(0, webView->mainFrame()->scrollOffset().height);
1278 1278
1279 // Set up a composition from existing text that needs to be committed. 1279 // Set up a composition from existing text that needs to be committed.
1280 Vector<CompositionUnderline> emptyUnderlines; 1280 Vector<CompositionUnderline> emptyUnderlines;
1281 WebLocalFrameImpl* frame = webView->mainFrameImpl(); 1281 WebLocalFrameImpl* frame = webView->mainFrameImpl();
1282 frame->frame()->inputMethodController().setCompositionFromExistingText( 1282 frame->frame()->inputMethodController().setCompositionFromExistingText(
yabinh 2016/11/25 04:36:27 Note that the parameter is the composition range.
1283 emptyUnderlines, 3, 3); 1283 emptyUnderlines, 0, 3);
1284 1284
1285 // Scroll the input field out of the viewport. 1285 // Scroll the input field out of the viewport.
1286 Element* element = static_cast<Element*>( 1286 Element* element = static_cast<Element*>(
1287 webView->mainFrame()->document().getElementById("btn")); 1287 webView->mainFrame()->document().getElementById("btn"));
1288 element->scrollIntoView(); 1288 element->scrollIntoView();
1289 float offsetHeight = webView->mainFrame()->scrollOffset().height; 1289 float offsetHeight = webView->mainFrame()->scrollOffset().height;
1290 EXPECT_EQ(0, webView->mainFrame()->scrollOffset().width); 1290 EXPECT_EQ(0, webView->mainFrame()->scrollOffset().width);
1291 EXPECT_LT(0, offsetHeight); 1291 EXPECT_LT(0, offsetHeight);
1292 1292
1293 WebTextInputInfo info = webView->textInputInfo(); 1293 WebTextInputInfo info = webView->textInputInfo();
(...skipping 3061 matching lines...) Expand 10 before | Expand all | Expand 10 after
4355 .translate(50, 55) 4355 .translate(50, 55)
4356 .scale(1. / 2.f); 4356 .scale(1. / 2.f);
4357 EXPECT_EQ(expectedMatrix, 4357 EXPECT_EQ(expectedMatrix,
4358 webViewImpl->getDeviceEmulationTransformForTesting()); 4358 webViewImpl->getDeviceEmulationTransformForTesting());
4359 // visibleContentRect doesn't change. 4359 // visibleContentRect doesn't change.
4360 EXPECT_EQ(IntRect(50, 55, 50, 75), 4360 EXPECT_EQ(IntRect(50, 55, 50, 75),
4361 *devToolsEmulator->visibleContentRectForPainting()); 4361 *devToolsEmulator->visibleContentRectForPainting());
4362 } 4362 }
4363 4363
4364 } // namespace blink 4364 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698