Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 <vector> | 5 #include <vector> |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "chrome/browser/ui/browser.h" | 8 #include "chrome/browser/ui/browser.h" |
| 9 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 9 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 10 #include "chrome/test/base/in_process_browser_test.h" | 10 #include "chrome/test/base/in_process_browser_test.h" |
| (...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 508 ViewSelectionBoundsChangedObserver bounds_observer(web_contents, view); | 508 ViewSelectionBoundsChangedObserver bounds_observer(web_contents, view); |
| 509 SimulateKeyPress(web_contents, ui::DomKey::FromCharacter('E'), | 509 SimulateKeyPress(web_contents, ui::DomKey::FromCharacter('E'), |
| 510 ui::DomCode::US_E, ui::VKEY_E, false, false, false, false); | 510 ui::DomCode::US_E, ui::VKEY_E, false, false, false, false); |
| 511 bounds_observer.Wait(); | 511 bounds_observer.Wait(); |
| 512 }; | 512 }; |
| 513 | 513 |
| 514 for (auto view : views) | 514 for (auto view : views) |
| 515 send_tab_insert_text_wait_for_bounds_change(view); | 515 send_tab_insert_text_wait_for_bounds_change(view); |
| 516 } | 516 } |
| 517 | 517 |
| 518 // TODO(ekaramad): Add a test here to show that the composition range is being | |
| 519 // tracked for all of the child frames.Composition range update could occur in | |
|
Charlie Reis
2016/07/08 18:55:24
nit: Missing space between sentences.
EhsanK
2016/07/11 18:07:21
Acknowledged.
| |
| 520 // response to WebWidget::setComposition. Write a test when that method is | |
| 521 // implemented for WebFrameWidgetImpl (crbug.com/602723). | |
|
Charlie Reis
2016/07/08 18:55:24
This comment would be clearer if you started with
EhsanK
2016/07/11 18:07:21
Fair enough. After giving it some more thought, I
Charlie Reis
2016/07/11 23:56:19
Acknowledged.
| |
| 522 | |
| 518 // TODO(ekaramad): The following tests are specifically written for Aura and are | 523 // TODO(ekaramad): The following tests are specifically written for Aura and are |
| 519 // based on InputMethodObserver. Write similar tests for Mac/Android/Mus | 524 // based on InputMethodObserver. Write similar tests for Mac/Android/Mus |
| 520 // (crbug.com/602723). | 525 // (crbug.com/602723). |
| 521 | 526 |
| 522 // Observes current input method for state changes. | 527 // Observes current input method for state changes. |
| 523 class InputMethodObserverBase { | 528 class InputMethodObserverBase { |
| 524 public: | 529 public: |
| 525 explicit InputMethodObserverBase(content::WebContents* web_contents) | 530 explicit InputMethodObserverBase(content::WebContents* web_contents) |
| 526 : success_(false), | 531 : success_(false), |
| 527 test_observer_(content::TestInputMethodObserver::Create(web_contents)) { | 532 test_observer_(content::TestInputMethodObserver::Create(web_contents)) { |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 617 EXPECT_FALSE(send_and_check_show_ime()); | 622 EXPECT_FALSE(send_and_check_show_ime()); |
| 618 | 623 |
| 619 // Set |TextInputState.show_ime_if_needed|. Expect IME. | 624 // Set |TextInputState.show_ime_if_needed|. Expect IME. |
| 620 sender.SetShowImeIfNeeded(true); | 625 sender.SetShowImeIfNeeded(true); |
| 621 EXPECT_TRUE(send_and_check_show_ime()); | 626 EXPECT_TRUE(send_and_check_show_ime()); |
| 622 | 627 |
| 623 // Set |TextInputState.type| to ui::TEXT_INPUT_TYPE_NONE. Expect no IME. | 628 // Set |TextInputState.type| to ui::TEXT_INPUT_TYPE_NONE. Expect no IME. |
| 624 sender.SetType(ui::TEXT_INPUT_TYPE_NONE); | 629 sender.SetType(ui::TEXT_INPUT_TYPE_NONE); |
| 625 EXPECT_FALSE(send_and_check_show_ime()); | 630 EXPECT_FALSE(send_and_check_show_ime()); |
| 626 } | 631 } |
| OLD | NEW |