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

Side by Side Diff: chrome/browser/site_per_process_interactive_browsertest.cc

Issue 1948343002: [reland] Browser Side Text Input State Tracking for OOPIF (Aura Only) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing shuchen@ and kenrb@ comments Created 4 years, 7 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
OLDNEW
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>
6
5 #include "base/command_line.h" 7 #include "base/command_line.h"
6 #include "chrome/browser/ui/browser.h" 8 #include "chrome/browser/ui/browser.h"
7 #include "chrome/browser/ui/tabs/tab_strip_model.h" 9 #include "chrome/browser/ui/tabs/tab_strip_model.h"
8 #include "chrome/test/base/in_process_browser_test.h" 10 #include "chrome/test/base/in_process_browser_test.h"
9 #include "chrome/test/base/ui_test_utils.h" 11 #include "chrome/test/base/ui_test_utils.h"
10 #include "content/public/browser/render_frame_host.h" 12 #include "content/public/browser/render_frame_host.h"
13 #include "content/public/browser/render_process_host.h"
11 #include "content/public/browser/web_contents.h" 14 #include "content/public/browser/web_contents.h"
12 #include "content/public/test/browser_test_utils.h" 15 #include "content/public/test/browser_test_utils.h"
13 #include "content/public/test/content_browser_test_utils.h" 16 #include "content/public/test/content_browser_test_utils.h"
14 #include "content/public/test/test_utils.h" 17 #include "content/public/test/test_utils.h"
18 #include "content/public/test/text_input_test_utils.h"
15 #include "net/dns/mock_host_resolver.h" 19 #include "net/dns/mock_host_resolver.h"
16 #include "net/test/embedded_test_server/embedded_test_server.h" 20 #include "net/test/embedded_test_server/embedded_test_server.h"
21 #include "ui/base/ime/text_input_client.h"
22 #include "ui/base/ime/text_input_mode.h"
23 #include "ui/base/ime/text_input_type.h"
24
17 #include "url/gurl.h" 25 #include "url/gurl.h"
18 26
19 class SitePerProcessInteractiveBrowserTest : public InProcessBrowserTest { 27 class SitePerProcessInteractiveBrowserTest : public InProcessBrowserTest {
20 public: 28 public:
21 SitePerProcessInteractiveBrowserTest() {} 29 SitePerProcessInteractiveBrowserTest() {}
22 ~SitePerProcessInteractiveBrowserTest() override {} 30 ~SitePerProcessInteractiveBrowserTest() override {}
23 31
24 void SetUpCommandLine(base::CommandLine* command_line) override { 32 void SetUpCommandLine(base::CommandLine* command_line) override {
25 content::IsolateAllSitesForTesting(command_line); 33 content::IsolateAllSitesForTesting(command_line);
26 } 34 }
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 EXPECT_EQ("\"child2-focused-input2\"", press_tab_and_wait_for_message(true)); 233 EXPECT_EQ("\"child2-focused-input2\"", press_tab_and_wait_for_message(true));
226 EXPECT_EQ(child2, web_contents->GetFocusedFrame()); 234 EXPECT_EQ(child2, web_contents->GetFocusedFrame());
227 EXPECT_EQ("\"child2-focused-input1\"", press_tab_and_wait_for_message(true)); 235 EXPECT_EQ("\"child2-focused-input1\"", press_tab_and_wait_for_message(true));
228 EXPECT_EQ("\"child1-focused-input2\"", press_tab_and_wait_for_message(true)); 236 EXPECT_EQ("\"child1-focused-input2\"", press_tab_and_wait_for_message(true));
229 EXPECT_EQ(child1, web_contents->GetFocusedFrame()); 237 EXPECT_EQ(child1, web_contents->GetFocusedFrame());
230 EXPECT_EQ("\"child1-focused-input1\"", press_tab_and_wait_for_message(true)); 238 EXPECT_EQ("\"child1-focused-input1\"", press_tab_and_wait_for_message(true));
231 EXPECT_EQ("\"root-focused-input1\"", press_tab_and_wait_for_message(true)); 239 EXPECT_EQ("\"root-focused-input1\"", press_tab_and_wait_for_message(true));
232 EXPECT_EQ(main_frame, web_contents->GetFocusedFrame()); 240 EXPECT_EQ(main_frame, web_contents->GetFocusedFrame());
233 } 241 }
234 242
243 // TODO(ekaramad): After fixing crbug.com/578168 for all platforms, the
244 // following tests should be activated for other platforms, e.g., Mac and
245 // Android (crbug.com/602723).
246 #ifdef USE_AURA
247 ///////////////////////////////////////////////////////////////////////////////
248 // TextInputManager and IME Tests
249 //
250 // The following tests verify the correctness of TextInputState tracking on the
251 // browser side. They also make sure the IME logic works correctly. The baseline
252 // for comparison is the default functionality in the non-OOPIF case (i.e., the
253 // legacy implementation in RWHV's other than RWHVCF.).
254
255 // TextInputManager Observers
256 // Observing the |TextInputState.value|.
257 class TextInputManagerObserverBase {
258 public:
259 explicit TextInputManagerObserverBase(content::WebContents* web_contents)
260 : success_(false) {
261 test_observer_ =
262 content::TestTextInputManagerObserver::Create(web_contents);
263 }
264
265 virtual ~TextInputManagerObserverBase() {}
266
267 void Wait() {
268 if (success_)
269 return;
270 message_loop_runner_ = new content::MessageLoopRunner();
271 message_loop_runner_->Run();
272 }
273
274 bool success() const { return success_; }
275
276 protected:
277 base::Closure on_success() {
278 return base::Bind(&TextInputManagerObserverBase::OnSuccess,
279 base::Unretained(this));
280 }
281
282 content::TestTextInputManagerObserver* observer() {
283 return test_observer_.get();
284 }
285
286 private:
287 void OnSuccess() {
288 success_ = true;
289 if (message_loop_runner_)
290 message_loop_runner_->Quit();
291 }
292
293 std::unique_ptr<content::TestTextInputManagerObserver> test_observer_;
294 bool success_;
295 scoped_refptr<content::MessageLoopRunner> message_loop_runner_;
296
297 DISALLOW_COPY_AND_ASSIGN(TextInputManagerObserverBase);
298 };
299
300 // This class observes the TextInputManager for updated |TextInputState.value|.
301 class TextInputManagerValueObserver : public TextInputManagerObserverBase {
302 public:
303 explicit TextInputManagerValueObserver(content::WebContents* web_contents,
304 const std::string& expected_value)
305 : TextInputManagerObserverBase(web_contents),
306 expected_value_(expected_value) {
307 observer()->SetUpdateCalledCallback(base::Bind(
308 &TextInputManagerValueObserver::VerifyValue, base::Unretained(this)));
309 }
310
311 private:
312 void VerifyValue(content::TestTextInputManagerObserver* observer) {
313 std::string value;
314 if (observer->GetTextInputValue(value) && expected_value_ == value)
315 on_success().Run();
316 }
317
318 std::string expected_value_;
319 };
320
321 // This class observes the TextInputManager for updated |TextInputState.type|.
322 class TextInputManagerTypeObserver : public TextInputManagerObserverBase {
323 public:
324 explicit TextInputManagerTypeObserver(content::WebContents* web_contents,
325 ui::TextInputType expected_type)
326 : TextInputManagerObserverBase(web_contents),
327 expected_type_(expected_type) {
328 observer()->SetUpdateCallback(base::Bind(
329 &TextInputManagerTypeObserver::VerifyType, base::Unretained(this)));
330 }
331
332 private:
333 void VerifyType(content::TestTextInputManagerObserver* observer) {
334 if (expected_type_ == observer->GetTextInputType())
335 on_success().Run();
336 }
337
338 ui::TextInputType expected_type_;
339 };
340
341 // An observer class which observes the TextInputManager until the first time
342 // the TextInputManager detects a change in TextInputState.
343 class TextInputManagerChangeObserver : public TextInputManagerObserverBase {
344 public:
345 explicit TextInputManagerChangeObserver(content::WebContents* web_contents)
346 : TextInputManagerObserverBase(web_contents) {
347 observer()->SetUpdateCallback(base::Bind(
348 &TextInputManagerChangeObserver::VerifyChange, base::Unretained(this)));
349 }
350
351 private:
352 void VerifyChange(content::TestTextInputManagerObserver* observer) {
353 if (observer->IsTextInputStateChanged())
354 on_success().Run();
355 }
356 };
357
358 // Main class for all TextInputState and IME related tests.
359 class TextInputInteractiveBrowserTest
360 : public SitePerProcessInteractiveBrowserTest {
361 protected:
362 content::WebContents* active_contents() {
363 return browser()->tab_strip_model()->GetActiveWebContents();
364 }
365
366 // static
367 // Adds an <input> field to a given frame by executing javascript code.
368 // The input can be added as the first element or the last element of
369 // |document.body|.
370 static void AddInputFieldToFrame(content::RenderFrameHost* rfh,
371 const std::string& type,
372 const std::string& value,
373 bool append_as_first_child) {
374 std::string script = base::StringPrintf(
375 "var input = document.createElement('input');"
376 "input.setAttribute('type', '%s');"
377 "input.setAttribute('value', '%s');"
378 "if (%s && !!document.body.firstChild) {"
379 " document.body.insertBefore(input, document.body.firstChild);"
380 "} else {"
381 " document.body.appendChild(input);"
382 "}",
383 type.c_str(), value.c_str(), append_as_first_child ? "true" : "false");
384 EXPECT_TRUE(ExecuteScript(rfh, script));
385 }
386
387 // Uses 'cross_site_iframe_factory.html'. The main frame's domain is
388 // 'a.com'.
389 void CreateIframePage(const std::string& structure) {
390 std::string path = base::StringPrintf("/cross_site_iframe_factory.html?%s",
391 structure.c_str());
392 GURL main_url(embedded_test_server()->GetURL("a.com", path));
393 ui_test_utils::NavigateToURL(browser(), main_url);
394 }
395
396 // Recrusively uses ChildFrameAt(frame, i) to get the i-th child frame
397 // inside frame. For example, for 'a(b(c, d(e)))', [0] returns b, and
398 // [0, 1, 0] returns e;
399 content::RenderFrameHost* GetFrame(const std::vector<size_t>& indices) {
400 content::RenderFrameHost* current = active_contents()->GetMainFrame();
401 for (size_t index : indices)
402 current = ChildFrameAt(current, index);
403 return current;
404 }
405 };
406
407 // The following test loads a page with multiple nested <iframe> elements which
408 // are in or out of process with the main frame. Then an <input> field is added
409 // to every single frame on the frame tree where the input's value is distinctly
410 // selected for each frame. The test then creates a sequence of tab presses and
411 // verifies that after eahc key press, the right TextInputState is observed.
412 IN_PROC_BROWSER_TEST_F(TextInputInteractiveBrowserTest,
413 TrackStateWhenSwitchingFocusedFrames) {
414 CreateIframePage("a(a,b,c(a,b,d(e, f)),g)");
415 std::vector<std::string> values{
416 "main", "node_a", "node_b", "node_c", "node_c_a",
417 "node_c_b", "node_c_d", "node_c_d_e", "node_c_d_f", "node_g"};
418
419 // TODO(ekaramad): This should not be needed and uniform initialization should
420 // work. However, in some bots, this is failing.
421 using vector = std::vector<size_t>;
422 std::vector<content::RenderFrameHost*> frames{
423 GetFrame(vector{}), GetFrame(vector{0}),
424 GetFrame(vector{1}), GetFrame(vector{2}),
425 GetFrame(vector{2, 0}), GetFrame(vector{2, 1}),
426 GetFrame(vector{2, 2}), GetFrame(vector{2, 2, 0}),
427 GetFrame(vector{2, 2, 1}), GetFrame(vector{3})};
428
429 for (size_t i = 0; i < frames.size(); ++i)
430 AddInputFieldToFrame(frames[i], "text", values[i], true);
431
432 for (size_t i = 0; i < frames.size(); ++i) {
433 TextInputManagerValueObserver observer(active_contents(), values[i]);
434 SimulateKeyPress(active_contents(), ui::VKEY_TAB, false, false, false,
435 false);
436 observer.Wait();
437 }
438 }
439
440 // The following test loads a page with two OOPIFs. An <input> is added to
441 // both frames and tab key is faked until the one in the second OOPIF is
442 // focused. Then, the renderer process for both frames are crashed. The test
443 // verifies that the TextInputManager stop tracking the RWHVs as well as
444 // properly resetting the TextInputState after the second (active) RWHV goes
445 // away.
446 IN_PROC_BROWSER_TEST_F(TextInputInteractiveBrowserTest,
447 StopTrackingCrashedChildFrame) {
448 CreateIframePage("a(b, c)");
449 std::vector<std::string> values{"node_b", "node_c"};
450 using vector = std::vector<size_t>;
451 std::vector<content::RenderFrameHost*> frames{GetFrame(vector{0}),
452 GetFrame(vector{1})};
453
454 for (size_t i = 0; i < frames.size(); ++i)
455 AddInputFieldToFrame(frames[i], "text", values[i], true);
456
457 for (size_t i = 0; i < frames.size(); ++i) {
458 TextInputManagerValueObserver observer(active_contents(), values[i]);
459 SimulateKeyPress(active_contents(), ui::VKEY_TAB, false, false, false,
460 false);
461 observer.Wait();
462 }
463
464 // Verify that we are tracking the TextInputState from the first frame.
465 content::RenderWidgetHostView* first_view = frames[0]->GetView();
466 std::unordered_map<const content::RenderWidgetHostView*, ui::TextInputType>
467 type_map = content::TestTextInputManagerObserver::GetTextInputTypeMap(
468 active_contents());
469 EXPECT_EQ(1UL, type_map.count(first_view));
470 EXPECT_EQ(ui::TEXT_INPUT_TYPE_NONE, type_map[first_view]);
471
472 // Now that the second frame's <input> is focused, we crash the first frame
473 // and observe that text input state is updated for the view.
474 std::unique_ptr<content::RenderWidgetHostViewDestructionObserver>
475 destruction_observer =
476 content::RenderWidgetHostViewDestructionObserver::Create(first_view);
477 frames[0]->GetProcess()->Shutdown(0, false);
478 destruction_observer->Wait();
479
480 // Verifying that the TextInputManager has smaller cleaned the memory
481 // allocated to the view.
482 type_map = content::TestTextInputManagerObserver::GetTextInputTypeMap(
483 active_contents());
484 EXPECT_EQ(0UL, type_map.count(first_view));
485
486 // Now crash the second <iframe> which has an active view.
487 content::RenderWidgetHostView* second_view = frames[1]->GetView();
488 TextInputManagerChangeObserver change_observer(active_contents());
489 frames[1]->GetProcess()->Shutdown(0, false);
490 change_observer.Wait();
491 EXPECT_EQ(ui::TEXT_INPUT_TYPE_NONE,
492 content::GetTextInputTypeFromWebContents(active_contents()));
493 EXPECT_FALSE(!!content::GetActiveViewFromWebContents(active_contents()));
494 type_map = content::TestTextInputManagerObserver::GetTextInputTypeMap(
495 active_contents());
496 EXPECT_EQ(0UL, type_map.count(second_view));
497 }
498
499 // The following test loads a page with two child frames; one in process and one
500 // out of process with main frame. The test inserts an <input> inside each frame
501 // and focuses the first frame and observes the TextInputManager setting the
502 // state to ui::TEXT_INPUT_TYPE_TEXT. Then, the frame is detached and the test
503 // observes that the state type is reset to ui::TEXT_INPUT_TYPE_NONE. The same
504 // sequence of actions is then performed on the out of process frame.
505 IN_PROC_BROWSER_TEST_F(TextInputInteractiveBrowserTest,
506 ResetStateAfterFrameDetached) {
507 CreateIframePage("a(a, b)");
508 using vector = std::vector<size_t>;
509 std::vector<content::RenderFrameHost*> frames{GetFrame(vector{0}),
510 GetFrame(vector{1})};
511
512 for (size_t i = 0; i < frames.size(); ++i)
513 AddInputFieldToFrame(frames[i], "text", "", true);
514
515 // Press tab key to focus the <input> in the first frame.
516 TextInputManagerTypeObserver type_observer_text_a(active_contents(),
517 ui::TEXT_INPUT_TYPE_TEXT);
518 SimulateKeyPress(active_contents(), ui::VKEY_TAB, false, false, false, false);
519 type_observer_text_a.Wait();
520
521 // Detach first frame and observe |TextInputState.type| resetting to
522 // ui::TEXT_INPUT_TYPE_NONE.
523 TextInputManagerTypeObserver type_observer_none_a(active_contents(),
524 ui::TEXT_INPUT_TYPE_NONE);
525 EXPECT_TRUE(ExecuteScript(
526 frames[0], "document.body.removeChild(document.body.firstChild);"));
527 type_observer_none_a.Wait();
528
529 // Press tab to focus the <input> in the second frame.
530 TextInputManagerTypeObserver type_observer_text_b(active_contents(),
531 ui::TEXT_INPUT_TYPE_TEXT);
532 SimulateKeyPress(active_contents(), ui::VKEY_TAB, false, false, false, false);
533 type_observer_text_b.Wait();
534
535 // Detach first frame and observe |TextInputState.type| resetting to
536 // ui::TEXT_INPUT_TYPE_NONE.
537 TextInputManagerTypeObserver type_observer_none_b(active_contents(),
538 ui::TEXT_INPUT_TYPE_NONE);
539 EXPECT_TRUE(ExecuteScript(
540 frames[1], "document.body.removeChild(document.body.firstChild);"));
541 type_observer_none_b.Wait();
542 }
543
544 // This test creates a page with one OOPIF and adds an <input> to it. Then, the
545 // <input> is focused and the test verfies that the |TextInputState.type| is set
546 // to ui::TEXT_INPUT_TYPE_TEXT. Next, the child frame is navigated away and the
547 // test verifies that |TextInputState.type| resets to ui::TEXT_INPUT_TYPE_NONE.
548 IN_PROC_BROWSER_TEST_F(TextInputInteractiveBrowserTest,
549 ResetStateAfterChildNavigation) {
550 CreateIframePage("a(b)");
551 using vector = std::vector<size_t>;
552 content::RenderFrameHost* main_frame = GetFrame(vector{});
553 content::RenderFrameHost* child_frame = GetFrame(vector{0});
554
555 AddInputFieldToFrame(child_frame, "text", "child", false);
556
557 // Focus <input> in child frame and verify the |TextInputState.value|.
558 TextInputManagerValueObserver child_set_state_observer(active_contents(),
559 "child");
560 SimulateKeyPress(active_contents(), ui::VKEY_TAB, false, false, false, false);
561 child_set_state_observer.Wait();
562
563 // Navigate the child frame to about:blank and verify that TextInputManager
564 // correctly sets its |TextInputState.type| to ui::TEXT_INPUT_TYPE_NONE.
565 TextInputManagerTypeObserver child_reset_state_observer(
566 active_contents(), ui::TEXT_INPUT_TYPE_NONE);
567 EXPECT_TRUE(ExecuteScript(
568 main_frame, "document.querySelector('iframe').src = 'about:blank'"));
569 child_reset_state_observer.Wait();
570 }
571
572 // This test creates a blank page and adds an <input> to it. Then, the <input>
573 // is focused and the test verfies that the |TextInputState.type| is set to
574 // ui::TEXT_INPUT_TYPE_TEXT. Next, the browser is navigated away and the test
575 // verifies that |TextInputState.type| resets to ui::TEXT_INPUT_TYPE_NONE.
576 IN_PROC_BROWSER_TEST_F(TextInputInteractiveBrowserTest,
577 ResetStateAfterBrowserNavigation) {
578 CreateIframePage("a()");
579 content::RenderFrameHost* main_frame = GetFrame(std::vector<size_t>{});
580 AddInputFieldToFrame(main_frame, "text", "", false);
581
582 TextInputManagerTypeObserver set_state_observer(active_contents(),
583 ui::TEXT_INPUT_TYPE_TEXT);
584 SimulateKeyPress(active_contents(), ui::VKEY_TAB, false, false, false, false);
585 set_state_observer.Wait();
586
587 TextInputManagerTypeObserver reset_state_observer(active_contents(),
588 ui::TEXT_INPUT_TYPE_NONE);
589 ui_test_utils::NavigateToURL(browser(), GURL("about:blank"));
590 reset_state_observer.Wait();
591 }
592 #endif // USE_AURA
593
594 // TODO(ekaramad): The following tests are specifically written for Aura and are
595 // based on InputMethodObserver. Write similar tests for Mac/Android/Mus
596 // (crbug.com/602723).
597 #ifdef USE_AURA
598 // Observes current input method for state changes.
599 class InputMethodObserverBase {
600 public:
601 explicit InputMethodObserverBase(content::WebContents* web_contents)
602 : success_(false),
603 test_observer_(content::TestInputMethodObserver::Create(web_contents)) {
604 }
605
606 void Wait() {
607 if (success_)
608 return;
609 message_loop_runner_ = new content::MessageLoopRunner();
610 message_loop_runner_->Run();
611 }
612
613 bool success() const { return success_; }
614
615 protected:
616 content::TestInputMethodObserver* test_observer() {
617 return test_observer_.get();
618 }
619
620 const base::Closure success_closure() {
621 return base::Bind(&InputMethodObserverBase::OnSuccess,
622 base::Unretained(this));
623 }
624
625 private:
626 void OnSuccess() {
627 success_ = true;
628 if (message_loop_runner_)
629 message_loop_runner_->Quit();
630 }
631
632 bool success_;
633 std::unique_ptr<content::TestInputMethodObserver> test_observer_;
634 scoped_refptr<content::MessageLoopRunner> message_loop_runner_;
635
636 DISALLOW_COPY_AND_ASSIGN(InputMethodObserverBase);
637 };
638
639 class InputMethodObserverForShowIme : public InputMethodObserverBase {
640 public:
641 explicit InputMethodObserverForShowIme(content::WebContents* web_contents)
642 : InputMethodObserverBase(web_contents) {
643 test_observer()->SetOnShowImeIfNeededCallback(success_closure());
644 }
645 };
646
647 // This test verifies that the IME for Aura is shown if and only if the current
648 // client's |TextInputState.type| is not ui::TEXT_INPUT_TYPE_NONE and the flag
649 // |TextInputState.show_ime_if_needed| is true. This should happen even.
650 // TODO(ekaramad): This test is actually a unit test and should be moved to some
651 // place more appropriate.
652 IN_PROC_BROWSER_TEST_F(TextInputInteractiveBrowserTest,
653 CorrectlyShowImeIfNeeded) {
654 // We only need the <iframe> page to create RWHV.
655 CreateIframePage("a()");
656 content::RenderFrameHost* main_frame = GetFrame(std::vector<size_t>{});
657 content::RenderWidgetHostView* view = main_frame->GetView();
658 content::WebContents* web_contents = active_contents();
659
660 content::TextInputStateSender sender(view);
661
662 auto send_and_check_show_ime = [&sender, &web_contents]() {
663 InputMethodObserverForShowIme observer(web_contents);
664 sender.Send();
665 return observer.success();
666 };
667
668 // Sending an empty state should not trigger ime.
669 EXPECT_FALSE(send_and_check_show_ime());
670
671 // Set |TextInputState.type| to text. Expect no IME.
672 sender.SetType(ui::TEXT_INPUT_TYPE_TEXT);
673 EXPECT_FALSE(send_and_check_show_ime());
674
675 // Set |TextInputState.show_ime_if_needed| to true. Expect IME.
676 sender.SetShowImeIfNeeded(true);
677 EXPECT_TRUE(send_and_check_show_ime());
678
679 // Send the same message. Expect IME (no change).
680 EXPECT_TRUE(send_and_check_show_ime());
681
682 // Reset |TextInputState.show_ime_if_needed|. Expect no IME.
683 sender.SetShowImeIfNeeded(false);
684 EXPECT_FALSE(send_and_check_show_ime());
685
686 // Setting an irrelevant field. Expect no IME.
687 sender.SetMode(ui::TEXT_INPUT_MODE_LATIN);
688 EXPECT_FALSE(send_and_check_show_ime());
689
690 // Set |TextInputState.show_ime_if_needed|. Expect IME.
691 sender.SetShowImeIfNeeded(true);
692 EXPECT_TRUE(send_and_check_show_ime());
693
694 // Set |TextInputState.type| to ui::TEXT_INPUT_TYPE_NONE. Expect no IME.
695 sender.SetType(ui::TEXT_INPUT_TYPE_NONE);
696 EXPECT_FALSE(send_and_check_show_ime());
697 }
698 #endif // USE_AURA
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698