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

Side by Side Diff: chrome/browser/apps/web_view_interactive_browsertest.cc

Issue 376033002: Adding MimeHandlerView. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@pending-zork-patch2
Patch Set: add switch to control feature, remove a DCHECK from extension_message_filter Created 6 years, 3 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "base/strings/stringprintf.h" 5 #include "base/strings/stringprintf.h"
6 #include "base/strings/utf_string_conversions.h" 6 #include "base/strings/utf_string_conversions.h"
7 #include "chrome/app/chrome_command_ids.h" 7 #include "chrome/app/chrome_command_ids.h"
8 #include "chrome/browser/apps/app_browsertest_util.h" 8 #include "chrome/browser/apps/app_browsertest_util.h"
9 #include "chrome/browser/chrome_content_browser_client.h" 9 #include "chrome/browser/chrome_content_browser_client.h"
10 #include "chrome/browser/extensions/extension_test_message_listener.h" 10 #include "chrome/browser/extensions/extension_test_message_listener.h"
(...skipping 992 matching lines...) Expand 10 before | Expand all | Expand 10 after
1003 embedder_web_contents->GetRenderViewHost()->GetView() 1003 embedder_web_contents->GetRenderViewHost()->GetView()
1004 ->GetTextInputClient(); 1004 ->GetTextInputClient();
1005 ASSERT_TRUE(text_input_client); 1005 ASSERT_TRUE(text_input_client);
1006 ASSERT_TRUE(text_input_client->GetTextInputType() != 1006 ASSERT_TRUE(text_input_client->GetTextInputType() !=
1007 ui::TEXT_INPUT_TYPE_NONE); 1007 ui::TEXT_INPUT_TYPE_NONE);
1008 #endif 1008 #endif
1009 } 1009 }
1010 1010
1011 // ui::TextInputClient is NULL for mac and android. 1011 // ui::TextInputClient is NULL for mac and android.
1012 #if !defined(OS_MACOSX) && !defined(OS_ANDROID) 1012 #if !defined(OS_MACOSX) && !defined(OS_ANDROID)
1013 IN_PROC_BROWSER_TEST_F(WebViewInteractiveTest, DISABLED_Focus_InputMethod) { 1013 IN_PROC_BROWSER_TEST_F(WebViewInteractiveTest, Focus_InputMethod) {
1014 content::WebContents* embedder_web_contents = NULL; 1014 content::WebContents* embedder_web_contents = NULL;
1015 scoped_ptr<ExtensionTestMessageListener> done_listener( 1015 scoped_ptr<ExtensionTestMessageListener> done_listener(
1016 RunAppHelper("testInputMethod", "web_view/focus", NO_TEST_SERVER, 1016 RunAppHelper("testInputMethod", "web_view/focus", NO_TEST_SERVER,
1017 &embedder_web_contents)); 1017 &embedder_web_contents));
1018 ASSERT_TRUE(done_listener->WaitUntilSatisfied()); 1018 ASSERT_TRUE(done_listener->WaitUntilSatisfied());
1019 1019
1020 ui::TextInputClient* text_input_client = 1020 ui::TextInputClient* text_input_client =
1021 embedder_web_contents->GetRenderViewHost()->GetView() 1021 embedder_web_contents->GetRenderViewHost()->GetView()
1022 ->GetTextInputClient(); 1022 ->GetTextInputClient();
1023 ASSERT_TRUE(text_input_client); 1023 ASSERT_TRUE(text_input_client);
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
1055 EXPECT_TRUE(next_step_listener.WaitUntilSatisfied()); 1055 EXPECT_TRUE(next_step_listener.WaitUntilSatisfied());
1056 } 1056 }
1057 1057
1058 // Moving focus causes IME cancel, and the composition will be committed 1058 // Moving focus causes IME cancel, and the composition will be committed
1059 // in first <input> in the <webview>, not in the second <input>. 1059 // in first <input> in the <webview>, not in the second <input>.
1060 { 1060 {
1061 next_step_listener.Reset(); 1061 next_step_listener.Reset();
1062 ui::CompositionText composition; 1062 ui::CompositionText composition;
1063 composition.text = base::UTF8ToUTF16("InputTest789"); 1063 composition.text = base::UTF8ToUTF16("InputTest789");
1064 text_input_client->SetCompositionText(composition); 1064 text_input_client->SetCompositionText(composition);
1065 // Do a roundtrip to the renderer so that in-flight IPC from
1066 // SetCompositionText() above gets routed before the next step.
1067 // The test becomes flaky otherwise.
1068 EXPECT_TRUE(content::ExecuteScript(embedder_web_contents, std::string()));
1065 EXPECT_TRUE(content::ExecuteScript( 1069 EXPECT_TRUE(content::ExecuteScript(
1066 embedder_web_contents, 1070 embedder_web_contents,
1067 "window.runCommand('testInputMethodRunNextStep', 3);")); 1071 "window.runCommand('testInputMethodRunNextStep', 3);"));
1068 1072
1069 // Wait for the next step to complete. 1073 // Wait for the next step to complete.
1070 EXPECT_TRUE(next_step_listener.WaitUntilSatisfied()); 1074 EXPECT_TRUE(next_step_listener.WaitUntilSatisfied());
1071 } 1075 }
1072 1076
1073 // Tests ExtendSelectionAndDelete message works in <webview>. 1077 // Tests ExtendSelectionAndDelete message works in <webview>.
1074 { 1078 {
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
1106 1110
1107 // Now verify that the selection text propagates properly to RWHV. 1111 // Now verify that the selection text propagates properly to RWHV.
1108 content::RenderWidgetHostView* guest_rwhv = 1112 content::RenderWidgetHostView* guest_rwhv =
1109 guest_web_contents()->GetRenderWidgetHostView(); 1113 guest_web_contents()->GetRenderWidgetHostView();
1110 ASSERT_TRUE(guest_rwhv); 1114 ASSERT_TRUE(guest_rwhv);
1111 std::string selected_text = base::UTF16ToUTF8(guest_rwhv->GetSelectedText()); 1115 std::string selected_text = base::UTF16ToUTF8(guest_rwhv->GetSelectedText());
1112 ASSERT_TRUE(selected_text.size() >= 10u); 1116 ASSERT_TRUE(selected_text.size() >= 10u);
1113 ASSERT_EQ("AAAAAAAAAA", selected_text.substr(0, 10)); 1117 ASSERT_EQ("AAAAAAAAAA", selected_text.substr(0, 10));
1114 } 1118 }
1115 #endif 1119 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698