| OLD | NEW |
| 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 901 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 912 ->getActiveWebInputMethodController(); | 912 ->getActiveWebInputMethodController(); |
| 913 | 913 |
| 914 // The test requires non-empty composition. | 914 // The test requires non-empty composition. |
| 915 std::string compositionText("hello"); | 915 std::string compositionText("hello"); |
| 916 WebVector<WebCompositionUnderline> emptyUnderlines; | 916 WebVector<WebCompositionUnderline> emptyUnderlines; |
| 917 activeInputMethodController->setComposition( | 917 activeInputMethodController->setComposition( |
| 918 WebString::fromUTF8(compositionText.c_str()), emptyUnderlines, 5, 5); | 918 WebString::fromUTF8(compositionText.c_str()), emptyUnderlines, 5, 5); |
| 919 | 919 |
| 920 // Do arbitrary change to make layout dirty. | 920 // Do arbitrary change to make layout dirty. |
| 921 Document& document = *webView->mainFrameImpl()->frame()->document(); | 921 Document& document = *webView->mainFrameImpl()->frame()->document(); |
| 922 Element* br = document.createElement("br", ASSERT_NO_EXCEPTION); | 922 Element* br = document.createElement("br"); |
| 923 document.body()->appendChild(br); | 923 document.body()->appendChild(br); |
| 924 | 924 |
| 925 // Should not hit assertion when calling | 925 // Should not hit assertion when calling |
| 926 // WebInputMethodController::finishComposingText with non-empty composition | 926 // WebInputMethodController::finishComposingText with non-empty composition |
| 927 // and dirty layout. | 927 // and dirty layout. |
| 928 activeInputMethodController->finishComposingText( | 928 activeInputMethodController->finishComposingText( |
| 929 WebInputMethodController::KeepSelection); | 929 WebInputMethodController::KeepSelection); |
| 930 } | 930 } |
| 931 | 931 |
| 932 TEST_P(WebViewTest, FinishComposingTextCursorPositionChange) { | 932 TEST_P(WebViewTest, FinishComposingTextCursorPositionChange) { |
| (...skipping 3416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4349 .translate(50, 55) | 4349 .translate(50, 55) |
| 4350 .scale(1. / 2.f); | 4350 .scale(1. / 2.f); |
| 4351 EXPECT_EQ(expectedMatrix, | 4351 EXPECT_EQ(expectedMatrix, |
| 4352 webViewImpl->getDeviceEmulationTransformForTesting()); | 4352 webViewImpl->getDeviceEmulationTransformForTesting()); |
| 4353 // visibleContentRect doesn't change. | 4353 // visibleContentRect doesn't change. |
| 4354 EXPECT_EQ(IntRect(50, 55, 50, 75), | 4354 EXPECT_EQ(IntRect(50, 55, 50, 75), |
| 4355 *devToolsEmulator->visibleContentRectForPainting()); | 4355 *devToolsEmulator->visibleContentRectForPainting()); |
| 4356 } | 4356 } |
| 4357 | 4357 |
| 4358 } // namespace blink | 4358 } // namespace blink |
| OLD | NEW |