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

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: 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/public/test/browser_test_utils.cc » ('j') | ui/events/event_unittest.cc » ('J')
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 74a5c554da78277b9a98c8338fb488541935ae67..3054eae10299e96fa51d4a7f902697a2e7c04cbe 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/dom3/dom_code.h"
#include "ui/events/keycodes/dom4/keycode_converter.h"
Wez 2015/05/05 20:11:48 For a follow-up CL: |code| is now in DOM3 - perhap
kpschoedel 2015/05/05 20:48:49 OK.
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/public/test/browser_test_utils.cc » ('j') | ui/events/event_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698