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

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: Small Fixes. Created 4 years, 10 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/site_isolation_policy.h" 23 #include "content/common/site_isolation_policy.h"
24 #include "content/common/ssl_status_serialization.h" 24 #include "content/common/ssl_status_serialization.h"
25 #include "content/common/text_input_state.h"
25 #include "content/common/view_messages.h" 26 #include "content/common/view_messages.h"
26 #include "content/public/browser/browser_context.h" 27 #include "content/public/browser/browser_context.h"
27 #include "content/public/browser/native_web_keyboard_event.h" 28 #include "content/public/browser/native_web_keyboard_event.h"
28 #include "content/public/browser/web_ui_controller_factory.h" 29 #include "content/public/browser/web_ui_controller_factory.h"
29 #include "content/public/common/bindings_policy.h" 30 #include "content/public/common/bindings_policy.h"
30 #include "content/public/common/browser_side_navigation_policy.h" 31 #include "content/public/common/browser_side_navigation_policy.h"
31 #include "content/public/common/content_switches.h" 32 #include "content/public/common/content_switches.h"
32 #include "content/public/common/page_zoom.h" 33 #include "content/public/common/page_zoom.h"
33 #include "content/public/common/url_constants.h" 34 #include "content/public/common/url_constants.h"
34 #include "content/public/common/url_utils.h" 35 #include "content/public/common/url_utils.h"
(...skipping 1124 matching lines...) Expand 10 before | Expand all | Expand 10 after
1159 render_thread_->sink().ClearMessages(); 1160 render_thread_->sink().ClearMessages();
1160 1161
1161 // Update the IME status and verify if our IME backend sends an IPC message 1162 // Update the IME status and verify if our IME backend sends an IPC message
1162 // to activate IMEs. 1163 // to activate IMEs.
1163 view()->UpdateTextInputState(ShowIme::HIDE_IME, ChangeSource::FROM_NON_IME); 1164 view()->UpdateTextInputState(ShowIme::HIDE_IME, ChangeSource::FROM_NON_IME);
1164 const IPC::Message* msg = render_thread_->sink().GetMessageAt(0); 1165 const IPC::Message* msg = render_thread_->sink().GetMessageAt(0);
1165 EXPECT_TRUE(msg != NULL); 1166 EXPECT_TRUE(msg != NULL);
1166 EXPECT_EQ(ViewHostMsg_TextInputStateChanged::ID, msg->type()); 1167 EXPECT_EQ(ViewHostMsg_TextInputStateChanged::ID, msg->type());
1167 ViewHostMsg_TextInputStateChanged::Param params; 1168 ViewHostMsg_TextInputStateChanged::Param params;
1168 ViewHostMsg_TextInputStateChanged::Read(msg, &params); 1169 ViewHostMsg_TextInputStateChanged::Read(msg, &params);
1169 ViewHostMsg_TextInputState_Params p = base::get<0>(params); 1170 TextInputState p = base::get<0>(params);
1170 ui::TextInputType type = p.type; 1171 ui::TextInputType type = p.type;
1171 ui::TextInputMode input_mode = p.mode; 1172 ui::TextInputMode input_mode = p.mode;
1172 bool can_compose_inline = p.can_compose_inline; 1173 bool can_compose_inline = p.can_compose_inline;
1173 EXPECT_EQ(ui::TEXT_INPUT_TYPE_TEXT, type); 1174 EXPECT_EQ(ui::TEXT_INPUT_TYPE_TEXT, type);
1174 EXPECT_EQ(true, can_compose_inline); 1175 EXPECT_EQ(true, can_compose_inline);
1175 1176
1176 // Move the input focus to the second <input> element, where we should 1177 // Move the input focus to the second <input> element, where we should
1177 // de-activate IMEs. 1178 // de-activate IMEs.
1178 ExecuteJavaScriptForTests("document.getElementById('test2').focus();"); 1179 ExecuteJavaScriptForTests("document.getElementById('test2').focus();");
1179 ProcessPendingMessages(); 1180 ProcessPendingMessages();
(...skipping 1574 matching lines...) Expand 10 before | Expand all | Expand 10 after
2754 FROM_HERE, 2755 FROM_HERE,
2755 base::Bind(&DevToolsAgentTest::CloseWhilePaused, base::Unretained(this))); 2756 base::Bind(&DevToolsAgentTest::CloseWhilePaused, base::Unretained(this)));
2756 ExecuteJavaScriptForTests("debugger;"); 2757 ExecuteJavaScriptForTests("debugger;");
2757 2758
2758 // CloseWhilePaused should resume execution and continue here. 2759 // CloseWhilePaused should resume execution and continue here.
2759 EXPECT_FALSE(IsPaused()); 2760 EXPECT_FALSE(IsPaused());
2760 Detach(); 2761 Detach();
2761 } 2762 }
2762 2763
2763 } // namespace content 2764 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698