Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/browser/renderer_host/render_widget_host_view_aura.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_aura.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <tuple> | 10 #include <tuple> |
| (...skipping 4732 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4743 views_[index]->SelectionChanged(expected_text, 0U, gfx::Range(0, 5)); | 4743 views_[index]->SelectionChanged(expected_text, 0U, gfx::Range(0, 5)); |
| 4744 | 4744 |
| 4745 // Retrieve the selected text from clipboard and verify it is as expected. | 4745 // Retrieve the selected text from clipboard and verify it is as expected. |
| 4746 base::string16 result_text; | 4746 base::string16 result_text; |
| 4747 clipboard->ReadText(ui::CLIPBOARD_TYPE_SELECTION, &result_text); | 4747 clipboard->ReadText(ui::CLIPBOARD_TYPE_SELECTION, &result_text); |
| 4748 EXPECT_EQ(expected_text, result_text); | 4748 EXPECT_EQ(expected_text, result_text); |
| 4749 } | 4749 } |
| 4750 } | 4750 } |
| 4751 #endif | 4751 #endif |
| 4752 | 4752 |
| 4753 // This test verifies that when any view on the page cancels an ongoing | |
| 4754 // composition, the RenderWidgetHostViewAura will receive the notification and | |
| 4755 // the current composition is canceled. | |
| 4756 TEST_F(InputMethodStateAuraTest, ImeCancelCompositionForAllViews) { | |
| 4757 for (auto* view : views_) { | |
| 4758 ActivateViewForTextInputManager(view, ui::TEXT_INPUT_TYPE_TEXT); | |
| 4759 // There is no composition in the beginning. | |
| 4760 EXPECT_FALSE(has_composition_text()); | |
| 4761 SetHasCompositionTextToTrue(); | |
| 4762 view->ImeCancelComposition(); | |
|
Charlie Reis
2017/01/17 22:31:38
nit: Put EXPECT_TRUE(has_composition_text()) befor
EhsanK
2017/01/17 22:45:47
It will definitely help with readability of the te
Charlie Reis
2017/01/17 22:49:20
Oh, I didn't see that before. It's ok as is then.
| |
| 4763 // The composition must have been canceled. | |
| 4764 EXPECT_FALSE(has_composition_text()); | |
| 4765 } | |
| 4766 } | |
| 4767 | |
| 4753 } // namespace content | 4768 } // namespace content |
| OLD | NEW |