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

Side by Side Diff: chrome/browser/renderer_host/site_per_process_text_input_browsertest.cc

Issue 2612423002: Track composition range information on the browser side (Android) (Closed)
Patch Set: Created 3 years, 11 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> 5 #include <vector>
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "chrome/browser/chrome_content_browser_client.h" 9 #include "chrome/browser/chrome_content_browser_client.h"
10 #include "chrome/browser/ui/browser.h" 10 #include "chrome/browser/ui/browser.h"
(...skipping 692 matching lines...) Expand 10 before | Expand all | Expand 10 after
703 for (size_t i = 0; i < record_count - 1U; ++i) { 703 for (size_t i = 0; i < record_count - 1U; ++i) {
704 const content::RenderWidgetHostView* current = 704 const content::RenderWidgetHostView* current =
705 recorder.active_views()->at(i); 705 recorder.active_views()->at(i);
706 const content::RenderWidgetHostView* next = 706 const content::RenderWidgetHostView* next =
707 recorder.active_views()->at(i + 1U); 707 recorder.active_views()->at(i + 1U);
708 EXPECT_TRUE((current != nullptr && next == nullptr) || 708 EXPECT_TRUE((current != nullptr && next == nullptr) ||
709 (current == nullptr && next != nullptr)); 709 (current == nullptr && next != nullptr));
710 } 710 }
711 } 711 }
712 712
713 // TODO(ekaramad): Some of the following tests should be active on Android as
714 // well. Enable them when the corresponding feature is implemented for Android
715 // (https://crbug.com/602723).
716 #if !defined(OS_ANDROID)
717 // This test creates a page with multiple child frames and adds an <input> to 713 // This test creates a page with multiple child frames and adds an <input> to
718 // each frame. Then, sequentially, each <input> is focused by sending a tab key. 714 // each frame. Then, sequentially, each <input> is focused by sending a tab key.
719 // Then, after |TextInputState.type| for a view is changed to text, the test 715 // Then, after |TextInputState.type| for a view is changed to text, the test
720 // sends a set composition IPC to the active widget and waits until the widget 716 // sends a set composition IPC to the active widget and waits until the widget
721 // updates its composition range. 717 // updates its composition range.
722 IN_PROC_BROWSER_TEST_F(SitePerProcessTextInputManagerTest, 718 IN_PROC_BROWSER_TEST_F(SitePerProcessTextInputManagerTest,
723 TrackCompositionRangeForAllFrames) { 719 TrackCompositionRangeForAllFrames) {
724 CreateIframePage("a(b,c(a,b),d)"); 720 CreateIframePage("a(b,c(a,b),d)");
725 std::vector<content::RenderFrameHost*> frames{ 721 std::vector<content::RenderFrameHost*> frames{
726 GetFrame(IndexVector{}), GetFrame(IndexVector{0}), 722 GetFrame(IndexVector{}), GetFrame(IndexVector{0}),
(...skipping 17 matching lines...) Expand all
744 740
745 ViewCompositionRangeChangedObserver range_observer(web_contents, view); 741 ViewCompositionRangeChangedObserver range_observer(web_contents, view);
746 EXPECT_TRUE(content::RequestCompositionInfoFromActiveWidget(web_contents)); 742 EXPECT_TRUE(content::RequestCompositionInfoFromActiveWidget(web_contents));
747 range_observer.Wait(); 743 range_observer.Wait();
748 }; 744 };
749 745
750 for (auto* view : views) 746 for (auto* view : views)
751 send_tab_set_composition_wait_for_bounds_change(view); 747 send_tab_set_composition_wait_for_bounds_change(view);
752 } 748 }
753 749
750 // TODO(ekaramad): Some of the following tests should be active on Android as
751 // well. Enable them when the corresponding feature is implemented for Android
752 // (https://crbug.com/602723).
753 #if !defined(OS_ANDROID)
754 // This test creates a page with multiple child frames and adds an <input> to 754 // This test creates a page with multiple child frames and adds an <input> to
755 // each frame. Then, sequentially, each <input> is focused by sending a tab key. 755 // each frame. Then, sequentially, each <input> is focused by sending a tab key.
756 // Then, after |TextInputState.type| for a view is changed to text, another key 756 // Then, after |TextInputState.type| for a view is changed to text, another key
757 // is pressed (a character) and then the test verifies that TextInputManager 757 // is pressed (a character) and then the test verifies that TextInputManager
758 // receives the corresponding update on the change in selection bounds on the 758 // receives the corresponding update on the change in selection bounds on the
759 // browser side. 759 // browser side.
760 IN_PROC_BROWSER_TEST_F(SitePerProcessTextInputManagerTest, 760 IN_PROC_BROWSER_TEST_F(SitePerProcessTextInputManagerTest,
761 TrackSelectionBoundsForAllFrames) { 761 TrackSelectionBoundsForAllFrames) {
762 CreateIframePage("a(b,c(a,b),d)"); 762 CreateIframePage("a(b,c(a,b),d)");
763 std::vector<content::RenderFrameHost*> frames{ 763 std::vector<content::RenderFrameHost*> frames{
(...skipping 583 matching lines...) Expand 10 before | Expand all | Expand 10 after
1347 1347
1348 // Closing this WebContents while we still hold on to our TestBrowserClient. 1348 // Closing this WebContents while we still hold on to our TestBrowserClient.
1349 EXPECT_TRUE(browser()->tab_strip_model()->CloseWebContentsAt( 1349 EXPECT_TRUE(browser()->tab_strip_model()->CloseWebContentsAt(
1350 1, TabStripModel::CLOSE_USER_GESTURE)); 1350 1, TabStripModel::CLOSE_USER_GESTURE));
1351 1351
1352 // For the cleanup of the original WebContents in tab index 0. 1352 // For the cleanup of the original WebContents in tab index 0.
1353 content::SetBrowserClientForTesting(old_browser_client); 1353 content::SetBrowserClientForTesting(old_browser_client);
1354 } 1354 }
1355 #endif // defined(MAC_OSX) 1355 #endif // defined(MAC_OSX)
1356 #endif // !defined(OS_ANDROID) 1356 #endif // !defined(OS_ANDROID)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698