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

Unified Diff: chrome/browser/extensions/web_view_interactive_browsertest.cc

Issue 15149006: <webview>: Plumb edit commands (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed whitespace Created 7 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/web_view_interactive_browsertest.cc
diff --git a/chrome/browser/extensions/web_view_interactive_browsertest.cc b/chrome/browser/extensions/web_view_interactive_browsertest.cc
index af1953c21d449a01b0b8c819cc6a58e8ff67b594..b0f80607ddac9c1254fca4e24eb952d63af2b5ad 100644
--- a/chrome/browser/extensions/web_view_interactive_browsertest.cc
+++ b/chrome/browser/extensions/web_view_interactive_browsertest.cc
@@ -73,6 +73,11 @@ class WebViewInteractiveTest
#endif
}
+ void SendStartOfLineKeyPressToPlatformApp() {
+ ASSERT_TRUE(ui_test_utils::SendKeyPressToWindowSync(
+ GetPlatformAppWindow(), ui::VKEY_LEFT, false, false, false, true));
+ }
+
void SendMouseEvent(ui_controls::MouseButton button,
ui_controls::MouseButtonState state) {
if (first_click_) {
@@ -348,10 +353,29 @@ IN_PROC_BROWSER_TEST_F(WebViewInteractiveTest, EditCommands) {
ExtensionTestMessageListener copy_listener("copy", false);
SendCopyKeyPressToPlatformApp();
+
// Wait for the guest to receive a 'copy' edit command.
ASSERT_TRUE(copy_listener.WaitUntilSatisfied());
}
+// Tests that guests receive edit commands and respond appropriately.
+IN_PROC_BROWSER_TEST_F(WebViewInteractiveTest, EditCommandsNoMenu) {
+ SetupTest("web_view/edit_commands_no_menu",
+ "files/extensions/platform_apps/web_view/edit_commands_no_menu/"
+ "guest.html");
+
+ ASSERT_TRUE(ui_test_utils::ShowAndFocusNativeWindow(
+ GetPlatformAppWindow()));
+
+ // Flush any pending events to make sure we start with a clean slate.
+ content::RunAllPendingInMessageLoop();
+
+ ExtensionTestMessageListener start_of_line_listener("StartOfLine", false);
+ SendStartOfLineKeyPressToPlatformApp();
+ // Wait for the guest to receive a 'copy' edit command.
+ ASSERT_TRUE(start_of_line_listener.WaitUntilSatisfied());
+}
+
// Disabled due to timeouts/crashing on several platforms. crbug.com/241912
IN_PROC_BROWSER_TEST_F(WebViewInteractiveTest, DISABLED_NewWindow) {
ASSERT_TRUE(StartTestServer()); // For serving guest pages.

Powered by Google App Engine
This is Rietveld 408576698