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

Side by Side Diff: content/renderer/render_view_browsertest.cc

Issue 1652483002: Browser Side Text Input State Tracking for OOPIF. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Using the Old Logic for Determining the State Change Created 4 years, 9 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 (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 <stddef.h> 5 #include <stddef.h>
6 #include <stdint.h> 6 #include <stdint.h>
7 7
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
11 #include "base/location.h" 11 #include "base/location.h"
12 #include "base/macros.h" 12 #include "base/macros.h"
13 #include "base/single_thread_task_runner.h" 13 #include "base/single_thread_task_runner.h"
14 #include "base/strings/string_util.h" 14 #include "base/strings/string_util.h"
15 #include "base/strings/utf_string_conversions.h" 15 #include "base/strings/utf_string_conversions.h"
16 #include "base/thread_task_runner_handle.h" 16 #include "base/thread_task_runner_handle.h"
17 #include "base/time/time.h" 17 #include "base/time/time.h"
18 #include "base/win/windows_version.h" 18 #include "base/win/windows_version.h"
19 #include "build/build_config.h" 19 #include "build/build_config.h"
20 #include "content/child/request_extra_data.h" 20 #include "content/child/request_extra_data.h"
21 #include "content/child/service_worker/service_worker_network_provider.h" 21 #include "content/child/service_worker/service_worker_network_provider.h"
22 #include "content/common/frame_messages.h" 22 #include "content/common/frame_messages.h"
23 #include "content/common/frame_replication_state.h" 23 #include "content/common/frame_replication_state.h"
24 #include "content/common/site_isolation_policy.h" 24 #include "content/common/site_isolation_policy.h"
25 #include "content/common/ssl_status_serialization.h" 25 #include "content/common/ssl_status_serialization.h"
26 #include "content/common/text_input_state.h"
26 #include "content/common/view_messages.h" 27 #include "content/common/view_messages.h"
27 #include "content/public/browser/browser_context.h" 28 #include "content/public/browser/browser_context.h"
28 #include "content/public/browser/native_web_keyboard_event.h" 29 #include "content/public/browser/native_web_keyboard_event.h"
29 #include "content/public/browser/web_ui_controller_factory.h" 30 #include "content/public/browser/web_ui_controller_factory.h"
30 #include "content/public/common/bindings_policy.h" 31 #include "content/public/common/bindings_policy.h"
31 #include "content/public/common/browser_side_navigation_policy.h" 32 #include "content/public/common/browser_side_navigation_policy.h"
32 #include "content/public/common/content_switches.h" 33 #include "content/public/common/content_switches.h"
33 #include "content/public/common/page_zoom.h" 34 #include "content/public/common/page_zoom.h"
34 #include "content/public/common/url_constants.h" 35 #include "content/public/common/url_constants.h"
35 #include "content/public/common/url_utils.h" 36 #include "content/public/common/url_utils.h"
(...skipping 1162 matching lines...) Expand 10 before | Expand all | Expand 10 after
1198 render_thread_->sink().ClearMessages(); 1199 render_thread_->sink().ClearMessages();
1199 1200
1200 // Update the IME status and verify if our IME backend sends an IPC message 1201 // Update the IME status and verify if our IME backend sends an IPC message
1201 // to activate IMEs. 1202 // to activate IMEs.
1202 view()->UpdateTextInputState(ShowIme::HIDE_IME, ChangeSource::FROM_NON_IME); 1203 view()->UpdateTextInputState(ShowIme::HIDE_IME, ChangeSource::FROM_NON_IME);
1203 const IPC::Message* msg = render_thread_->sink().GetMessageAt(0); 1204 const IPC::Message* msg = render_thread_->sink().GetMessageAt(0);
1204 EXPECT_TRUE(msg != NULL); 1205 EXPECT_TRUE(msg != NULL);
1205 EXPECT_EQ(ViewHostMsg_TextInputStateChanged::ID, msg->type()); 1206 EXPECT_EQ(ViewHostMsg_TextInputStateChanged::ID, msg->type());
1206 ViewHostMsg_TextInputStateChanged::Param params; 1207 ViewHostMsg_TextInputStateChanged::Param params;
1207 ViewHostMsg_TextInputStateChanged::Read(msg, &params); 1208 ViewHostMsg_TextInputStateChanged::Read(msg, &params);
1208 ViewHostMsg_TextInputState_Params p = base::get<0>(params); 1209 TextInputState p = base::get<0>(params);
1209 ui::TextInputType type = p.type; 1210 ui::TextInputType type = p.type;
1210 ui::TextInputMode input_mode = p.mode; 1211 ui::TextInputMode input_mode = p.mode;
1211 bool can_compose_inline = p.can_compose_inline; 1212 bool can_compose_inline = p.can_compose_inline;
1212 EXPECT_EQ(ui::TEXT_INPUT_TYPE_TEXT, type); 1213 EXPECT_EQ(ui::TEXT_INPUT_TYPE_TEXT, type);
1213 EXPECT_EQ(true, can_compose_inline); 1214 EXPECT_EQ(true, can_compose_inline);
1214 1215
1215 // Move the input focus to the second <input> element, where we should 1216 // Move the input focus to the second <input> element, where we should
1216 // de-activate IMEs. 1217 // de-activate IMEs.
1217 ExecuteJavaScriptForTests("document.getElementById('test2').focus();"); 1218 ExecuteJavaScriptForTests("document.getElementById('test2').focus();");
1218 ProcessPendingMessages(); 1219 ProcessPendingMessages();
(...skipping 1581 matching lines...) Expand 10 before | Expand all | Expand 10 after
2800 FROM_HERE, 2801 FROM_HERE,
2801 base::Bind(&DevToolsAgentTest::CloseWhilePaused, base::Unretained(this))); 2802 base::Bind(&DevToolsAgentTest::CloseWhilePaused, base::Unretained(this)));
2802 ExecuteJavaScriptForTests("debugger;"); 2803 ExecuteJavaScriptForTests("debugger;");
2803 2804
2804 // CloseWhilePaused should resume execution and continue here. 2805 // CloseWhilePaused should resume execution and continue here.
2805 EXPECT_FALSE(IsPaused()); 2806 EXPECT_FALSE(IsPaused());
2806 Detach(); 2807 Detach();
2807 } 2808 }
2808 2809
2809 } // namespace content 2810 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698