OLD | NEW |
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/json/json_reader.h" | 11 #include "base/json/json_reader.h" |
12 #include "base/location.h" | 12 #include "base/location.h" |
13 #include "base/macros.h" | 13 #include "base/macros.h" |
14 #include "base/single_thread_task_runner.h" | 14 #include "base/single_thread_task_runner.h" |
15 #include "base/strings/string_util.h" | 15 #include "base/strings/string_util.h" |
16 #include "base/strings/utf_string_conversions.h" | 16 #include "base/strings/utf_string_conversions.h" |
17 #include "base/thread_task_runner_handle.h" | 17 #include "base/thread_task_runner_handle.h" |
18 #include "base/time/time.h" | 18 #include "base/time/time.h" |
19 #include "base/values.h" | 19 #include "base/values.h" |
20 #include "base/win/windows_version.h" | 20 #include "base/win/windows_version.h" |
21 #include "build/build_config.h" | 21 #include "build/build_config.h" |
22 #include "cc/trees/layer_tree_host.h" | 22 #include "cc/trees/layer_tree_host.h" |
23 #include "content/child/request_extra_data.h" | 23 #include "content/child/request_extra_data.h" |
24 #include "content/child/service_worker/service_worker_network_provider.h" | 24 #include "content/child/service_worker/service_worker_network_provider.h" |
25 #include "content/common/content_switches_internal.h" | 25 #include "content/common/content_switches_internal.h" |
26 #include "content/common/frame_messages.h" | 26 #include "content/common/frame_messages.h" |
27 #include "content/common/frame_replication_state.h" | 27 #include "content/common/frame_replication_state.h" |
28 #include "content/common/site_isolation_policy.h" | 28 #include "content/common/site_isolation_policy.h" |
29 #include "content/common/ssl_status_serialization.h" | 29 #include "content/common/ssl_status_serialization.h" |
30 #include "content/common/text_input_state.h" | |
31 #include "content/common/view_messages.h" | 30 #include "content/common/view_messages.h" |
32 #include "content/public/browser/browser_context.h" | 31 #include "content/public/browser/browser_context.h" |
33 #include "content/public/browser/native_web_keyboard_event.h" | 32 #include "content/public/browser/native_web_keyboard_event.h" |
34 #include "content/public/browser/web_ui_controller_factory.h" | 33 #include "content/public/browser/web_ui_controller_factory.h" |
35 #include "content/public/common/bindings_policy.h" | 34 #include "content/public/common/bindings_policy.h" |
36 #include "content/public/common/browser_side_navigation_policy.h" | 35 #include "content/public/common/browser_side_navigation_policy.h" |
37 #include "content/public/common/content_switches.h" | 36 #include "content/public/common/content_switches.h" |
38 #include "content/public/common/page_zoom.h" | 37 #include "content/public/common/page_zoom.h" |
39 #include "content/public/common/url_constants.h" | 38 #include "content/public/common/url_constants.h" |
40 #include "content/public/common/url_utils.h" | 39 #include "content/public/common/url_utils.h" |
(...skipping 1077 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1118 render_thread_->sink().ClearMessages(); | 1117 render_thread_->sink().ClearMessages(); |
1119 | 1118 |
1120 // Update the IME status and verify if our IME backend sends an IPC message | 1119 // Update the IME status and verify if our IME backend sends an IPC message |
1121 // to activate IMEs. | 1120 // to activate IMEs. |
1122 view()->UpdateTextInputState(ShowIme::HIDE_IME, ChangeSource::FROM_NON_IME); | 1121 view()->UpdateTextInputState(ShowIme::HIDE_IME, ChangeSource::FROM_NON_IME); |
1123 const IPC::Message* msg = render_thread_->sink().GetMessageAt(0); | 1122 const IPC::Message* msg = render_thread_->sink().GetMessageAt(0); |
1124 EXPECT_TRUE(msg != NULL); | 1123 EXPECT_TRUE(msg != NULL); |
1125 EXPECT_EQ(ViewHostMsg_TextInputStateChanged::ID, msg->type()); | 1124 EXPECT_EQ(ViewHostMsg_TextInputStateChanged::ID, msg->type()); |
1126 ViewHostMsg_TextInputStateChanged::Param params; | 1125 ViewHostMsg_TextInputStateChanged::Param params; |
1127 ViewHostMsg_TextInputStateChanged::Read(msg, ¶ms); | 1126 ViewHostMsg_TextInputStateChanged::Read(msg, ¶ms); |
1128 TextInputState p = base::get<0>(params); | 1127 ViewHostMsg_TextInputState_Params p = base::get<0>(params); |
1129 ui::TextInputType type = p.type; | 1128 ui::TextInputType type = p.type; |
1130 ui::TextInputMode input_mode = p.mode; | 1129 ui::TextInputMode input_mode = p.mode; |
1131 bool can_compose_inline = p.can_compose_inline; | 1130 bool can_compose_inline = p.can_compose_inline; |
1132 EXPECT_EQ(ui::TEXT_INPUT_TYPE_TEXT, type); | 1131 EXPECT_EQ(ui::TEXT_INPUT_TYPE_TEXT, type); |
1133 EXPECT_EQ(true, can_compose_inline); | 1132 EXPECT_EQ(true, can_compose_inline); |
1134 | 1133 |
1135 // Move the input focus to the second <input> element, where we should | 1134 // Move the input focus to the second <input> element, where we should |
1136 // de-activate IMEs. | 1135 // de-activate IMEs. |
1137 ExecuteJavaScriptForTests("document.getElementById('test2').focus();"); | 1136 ExecuteJavaScriptForTests("document.getElementById('test2').focus();"); |
1138 ProcessPendingMessages(); | 1137 ProcessPendingMessages(); |
(...skipping 1255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2394 | 2393 |
2395 TEST_F(DevToolsAgentTest, RuntimeEnableForcesContextsAfterNavigation) { | 2394 TEST_F(DevToolsAgentTest, RuntimeEnableForcesContextsAfterNavigation) { |
2396 Attach(); | 2395 Attach(); |
2397 DispatchDevToolsMessage("{\"id\":1,\"method\":\"Runtime.enable\"}"); | 2396 DispatchDevToolsMessage("{\"id\":1,\"method\":\"Runtime.enable\"}"); |
2398 EXPECT_EQ(0, CountNotifications("Runtime.executionContextCreated")); | 2397 EXPECT_EQ(0, CountNotifications("Runtime.executionContextCreated")); |
2399 LoadHTML("<body>page<iframe></iframe></body>"); | 2398 LoadHTML("<body>page<iframe></iframe></body>"); |
2400 EXPECT_EQ(2, CountNotifications("Runtime.executionContextCreated")); | 2399 EXPECT_EQ(2, CountNotifications("Runtime.executionContextCreated")); |
2401 } | 2400 } |
2402 | 2401 |
2403 } // namespace content | 2402 } // namespace content |
OLD | NEW |