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

Unified Diff: chrome/browser/ui/omnibox/omnibox_view_browsertest.cc

Issue 2163153002: Don't test Cmd+Alt+v in the Omnibox on macOS Sierra (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/omnibox/omnibox_view_browsertest.cc
diff --git a/chrome/browser/ui/omnibox/omnibox_view_browsertest.cc b/chrome/browser/ui/omnibox/omnibox_view_browsertest.cc
index 60e5b315cb92a5bf39b57045a3ea64f700561713..262ddaba21b01031100bda3ed2cd7ed3c2a1f87f 100644
--- a/chrome/browser/ui/omnibox/omnibox_view_browsertest.cc
+++ b/chrome/browser/ui/omnibox/omnibox_view_browsertest.cc
@@ -54,6 +54,10 @@
#include "ui/events/keycodes/keyboard_codes.h"
#include "ui/gfx/geometry/point.h"
+#if defined(OS_MACOSX)
+#include "base/mac/mac_util.h"
+#endif
+
using base::ASCIIToUTF16;
using base::UTF16ToUTF8;
using base::Time;
@@ -1634,10 +1638,20 @@ IN_PROC_BROWSER_TEST_F(OmniboxViewTest, Paste) {
EXPECT_EQ(ASCIIToUTF16("ab123cd"), omnibox_view->GetText());
EXPECT_TRUE(popup_model->IsOpen());
- // Ctrl/Cmd+Alt+V should not paste.
- ASSERT_NO_FATAL_FAILURE(
- SendKey(ui::VKEY_V, kCtrlOrCmdMask | ui::EF_ALT_DOWN));
- EXPECT_EQ(ASCIIToUTF16("ab123cd"), omnibox_view->GetText());
+ bool run_alt_paste_test = true;
+#if defined(OS_MACOSX) && MAC_OS_X_VERSION_MIN_REQUIRED == MAC_OS_X_VERSION_10_7
+ // On macOS 10.12 Sierra Cmd+Alt+v actually does paste due to an OS bug. In
+ // addition, the synthetic test event causes a segfault inside AppKit. A real,
+ // keyboard-generated event does not crash (but incorrectly pastes). Revisit
+ // this when bumping the deployment target. See http://crbug.com/629595.
+ run_alt_paste_test = !base::mac::IsOSLaterThanElCapitan_DontCallThis();
+#endif
+ if (run_alt_paste_test) {
+ // Ctrl/Cmd+Alt+V should not paste.
+ ASSERT_NO_FATAL_FAILURE(
+ SendKey(ui::VKEY_V, kCtrlOrCmdMask | ui::EF_ALT_DOWN));
+ EXPECT_EQ(ASCIIToUTF16("ab123cd"), omnibox_view->GetText());
+ }
// TODO(msw): Test that AltGr+V does not paste.
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698