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

Unified Diff: Source/web/tests/WebInputEventConversionTest.cpp

Issue 545123002: Cleanup namespace usage in Source/web/. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/web/tests/WebHelperPluginTest.cpp ('k') | Source/web/tests/WebPageNewSerializerTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/tests/WebInputEventConversionTest.cpp
diff --git a/Source/web/tests/WebInputEventConversionTest.cpp b/Source/web/tests/WebInputEventConversionTest.cpp
index faf798f110140cd0d4333253d4bf3e9a9cf488a2..0b5b606da4867be874e61399b8ec5e28e0cf18c0 100644
--- a/Source/web/tests/WebInputEventConversionTest.cpp
+++ b/Source/web/tests/WebInputEventConversionTest.cpp
@@ -54,40 +54,40 @@ using namespace blink;
namespace {
-PassRefPtrWillBeRawPtr<blink::KeyboardEvent> createKeyboardEventWithLocation(blink::KeyboardEvent::KeyLocationCode location)
+PassRefPtrWillBeRawPtr<KeyboardEvent> createKeyboardEventWithLocation(KeyboardEvent::KeyLocationCode location)
{
- return blink::KeyboardEvent::create("keydown", true, true, 0, "", location, false, false, false, false);
+ return KeyboardEvent::create("keydown", true, true, 0, "", location, false, false, false, false);
}
-int getModifiersForKeyLocationCode(blink::KeyboardEvent::KeyLocationCode location)
+int getModifiersForKeyLocationCode(KeyboardEvent::KeyLocationCode location)
{
- RefPtrWillBeRawPtr<blink::KeyboardEvent> event = createKeyboardEventWithLocation(location);
- blink::WebKeyboardEventBuilder convertedEvent(*event);
+ RefPtrWillBeRawPtr<KeyboardEvent> event = createKeyboardEventWithLocation(location);
+ WebKeyboardEventBuilder convertedEvent(*event);
return convertedEvent.modifiers;
}
TEST(WebInputEventConversionTest, WebKeyboardEventBuilder)
{
// Test key location conversion.
- int modifiers = getModifiersForKeyLocationCode(blink::KeyboardEvent::DOM_KEY_LOCATION_STANDARD);
+ int modifiers = getModifiersForKeyLocationCode(KeyboardEvent::DOM_KEY_LOCATION_STANDARD);
EXPECT_FALSE(modifiers & WebInputEvent::IsKeyPad || modifiers & WebInputEvent::IsLeft || modifiers & WebInputEvent::IsRight);
- modifiers = getModifiersForKeyLocationCode(blink::KeyboardEvent::DOM_KEY_LOCATION_LEFT);
+ modifiers = getModifiersForKeyLocationCode(KeyboardEvent::DOM_KEY_LOCATION_LEFT);
EXPECT_TRUE(modifiers & WebInputEvent::IsLeft);
EXPECT_FALSE(modifiers & WebInputEvent::IsKeyPad || modifiers & WebInputEvent::IsRight);
- modifiers = getModifiersForKeyLocationCode(blink::KeyboardEvent::DOM_KEY_LOCATION_RIGHT);
+ modifiers = getModifiersForKeyLocationCode(KeyboardEvent::DOM_KEY_LOCATION_RIGHT);
EXPECT_TRUE(modifiers & WebInputEvent::IsRight);
EXPECT_FALSE(modifiers & WebInputEvent::IsKeyPad || modifiers & WebInputEvent::IsLeft);
- modifiers = getModifiersForKeyLocationCode(blink::KeyboardEvent::DOM_KEY_LOCATION_NUMPAD);
+ modifiers = getModifiersForKeyLocationCode(KeyboardEvent::DOM_KEY_LOCATION_NUMPAD);
EXPECT_TRUE(modifiers & WebInputEvent::IsKeyPad);
EXPECT_FALSE(modifiers & WebInputEvent::IsLeft || modifiers & WebInputEvent::IsRight);
}
TEST(WebInputEventConversionTest, WebTouchEventBuilder)
{
- RefPtrWillBeRawPtr<blink::TouchEvent> event = blink::TouchEvent::create();
+ RefPtrWillBeRawPtr<TouchEvent> event = TouchEvent::create();
WebMouseEventBuilder mouse(0, 0, *event);
EXPECT_EQ(WebInputEvent::Undefined, mouse.type);
}
@@ -251,7 +251,7 @@ TEST(WebInputEventConversionTest, InputEventsScaling)
// which expect CSS pixel coordinates.
{
PlatformMouseEvent platformMouseEvent(IntPoint(10, 10), IntPoint(10, 10), LeftButton, PlatformEvent::MouseMoved, 1, false, false, false, false, PlatformMouseEvent::RealOrIndistinguishable, 0);
- RefPtrWillBeRawPtr<MouseEvent> mouseEvent = MouseEvent::create(blink::EventTypeNames::mousemove, domWindow, platformMouseEvent, 0, document);
+ RefPtrWillBeRawPtr<MouseEvent> mouseEvent = MouseEvent::create(EventTypeNames::mousemove, domWindow, platformMouseEvent, 0, document);
WebMouseEventBuilder webMouseBuilder(view, documentRenderView, *mouseEvent);
EXPECT_EQ(10, webMouseBuilder.x);
@@ -264,7 +264,7 @@ TEST(WebInputEventConversionTest, InputEventsScaling)
{
PlatformMouseEvent platformMouseEvent(IntPoint(10, 10), IntPoint(10, 10), NoButton, PlatformEvent::MouseMoved, 1, false, false, false, false, PlatformMouseEvent::RealOrIndistinguishable, 0);
- RefPtrWillBeRawPtr<MouseEvent> mouseEvent = MouseEvent::create(blink::EventTypeNames::mousemove, domWindow, platformMouseEvent, 0, document);
+ RefPtrWillBeRawPtr<MouseEvent> mouseEvent = MouseEvent::create(EventTypeNames::mousemove, domWindow, platformMouseEvent, 0, document);
WebMouseEventBuilder webMouseBuilder(view, documentRenderView, *mouseEvent);
EXPECT_EQ(WebMouseEvent::ButtonNone, webMouseBuilder.button);
}
@@ -286,7 +286,7 @@ TEST(WebInputEventConversionTest, InputEventsScaling)
RefPtrWillBeRawPtr<Touch> touch = Touch::create(toLocalFrame(webViewImpl->page()->mainFrame()), document.get(), 0, FloatPoint(10, 9.5), FloatPoint(3.5, 2), FloatSize(4, 4.5), 0, 0);
RefPtrWillBeRawPtr<TouchList> touchList = TouchList::create();
touchList->append(touch);
- RefPtrWillBeRawPtr<TouchEvent> touchEvent = TouchEvent::create(touchList.get(), touchList.get(), touchList.get(), blink::EventTypeNames::touchmove, domWindow, false, false, false, false, false);
+ RefPtrWillBeRawPtr<TouchEvent> touchEvent = TouchEvent::create(touchList.get(), touchList.get(), touchList.get(), EventTypeNames::touchmove, domWindow, false, false, false, false, false);
WebTouchEventBuilder webTouchBuilder(view, documentRenderView, *touchEvent);
ASSERT_EQ(1u, webTouchBuilder.touchesLength);
@@ -483,7 +483,7 @@ TEST(WebInputEventConversionTest, InputEventsConversions)
EXPECT_EQ(10.f, platformGestureBuilder.globalPosition().y());
EXPECT_EQ(1, platformGestureBuilder.tapCount());
- RefPtrWillBeRawPtr<blink::GestureEvent> coreGestureEvent = blink::GestureEvent::create(domWindow, platformGestureBuilder);
+ RefPtrWillBeRawPtr<GestureEvent> coreGestureEvent = GestureEvent::create(domWindow, platformGestureBuilder);
WebGestureEventBuilder recreatedWebGestureEvent(view, documentRenderView, *coreGestureEvent);
EXPECT_EQ(webGestureEvent.type, recreatedWebGestureEvent.type);
EXPECT_EQ(webGestureEvent.x, recreatedWebGestureEvent.x);
« no previous file with comments | « Source/web/tests/WebHelperPluginTest.cpp ('k') | Source/web/tests/WebPageNewSerializerTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698