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

Unified Diff: chrome/browser/ui/blocked_content/popup_blocker_browsertest.cc

Issue 1124963003: Remove ui::KeycodeConverter::CodeToNativeKeycode(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@x444048-3a-codes
Patch Set: rebase Created 5 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
« no previous file with comments | « no previous file | content/content_renderer.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/blocked_content/popup_blocker_browsertest.cc
diff --git a/chrome/browser/ui/blocked_content/popup_blocker_browsertest.cc b/chrome/browser/ui/blocked_content/popup_blocker_browsertest.cc
index 963aa2a14ccfd1130273b43a890fa9d5af0c5f93..e4264d4f6c6d6614468d2360e7a436aa29568a03 100644
--- a/chrome/browser/ui/blocked_content/popup_blocker_browsertest.cc
+++ b/chrome/browser/ui/blocked_content/popup_blocker_browsertest.cc
@@ -45,6 +45,7 @@
#include "net/dns/mock_host_resolver.h"
#include "net/test/embedded_test_server/embedded_test_server.h"
#include "testing/gtest/include/gtest/gtest.h"
+#include "ui/events/keycodes/dom/dom_code.h"
#include "ui/events/keycodes/dom/keycode_converter.h"
using content::WebContents;
@@ -637,35 +638,38 @@ IN_PROC_BROWSER_TEST_F(PopupBlockerBrowserTest, CtrlEnterKey) {
#if defined(OS_MACOSX)
int modifiers = blink::WebInputEvent::MetaKey;
- InjectRawKeyEvent(tab, blink::WebInputEvent::RawKeyDown, ui::VKEY_COMMAND,
- ui::KeycodeConverter::CodeToNativeKeycode("OSLeft"),
- modifiers);
+ InjectRawKeyEvent(
+ tab, blink::WebInputEvent::RawKeyDown, ui::VKEY_COMMAND,
+ ui::KeycodeConverter::DomCodeToNativeKeycode(ui::DomCode::OS_LEFT),
+ modifiers);
#else
int modifiers = blink::WebInputEvent::ControlKey;
- InjectRawKeyEvent(tab, blink::WebInputEvent::RawKeyDown, ui::VKEY_CONTROL,
- ui::KeycodeConverter::CodeToNativeKeycode("ControlLeft"),
- modifiers);
+ InjectRawKeyEvent(
+ tab, blink::WebInputEvent::RawKeyDown, ui::VKEY_CONTROL,
+ ui::KeycodeConverter::DomCodeToNativeKeycode(ui::DomCode::CONTROL_LEFT),
+ modifiers);
#endif
InjectRawKeyEvent(tab, blink::WebInputEvent::RawKeyDown, ui::VKEY_RETURN,
- ui::KeycodeConverter::CodeToNativeKeycode(NULL), modifiers);
+ ui::KeycodeConverter::InvalidNativeKeycode(), modifiers);
InjectRawKeyEvent(tab, blink::WebInputEvent::Char, ui::VKEY_RETURN,
- ui::KeycodeConverter::CodeToNativeKeycode(NULL), modifiers);
+ ui::KeycodeConverter::InvalidNativeKeycode(), modifiers);
InjectRawKeyEvent(tab, blink::WebInputEvent::KeyUp, ui::VKEY_RETURN,
- ui::KeycodeConverter::CodeToNativeKeycode(NULL), modifiers);
+ ui::KeycodeConverter::InvalidNativeKeycode(), modifiers);
#if defined(OS_MACOSX)
- InjectRawKeyEvent(tab, blink::WebInputEvent::KeyUp, ui::VKEY_COMMAND,
- ui::KeycodeConverter::CodeToNativeKeycode("OSLeft"),
- modifiers);
+ InjectRawKeyEvent(
+ tab, blink::WebInputEvent::KeyUp, ui::VKEY_COMMAND,
+ ui::KeycodeConverter::DomCodeToNativeKeycode(ui::DomCode::OS_LEFT),
+ modifiers);
#else
- InjectRawKeyEvent(tab, blink::WebInputEvent::KeyUp, ui::VKEY_CONTROL,
- ui::KeycodeConverter::CodeToNativeKeycode("ControlLeft"),
- modifiers);
+ InjectRawKeyEvent(
+ tab, blink::WebInputEvent::KeyUp, ui::VKEY_CONTROL,
+ ui::KeycodeConverter::DomCodeToNativeKeycode(ui::DomCode::CONTROL_LEFT),
+ modifiers);
#endif
-
wait_for_new_tab.Wait();
ASSERT_EQ(1u, chrome::GetBrowserCount(browser()->profile(),
« no previous file with comments | « no previous file | content/content_renderer.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698