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

Side by Side Diff: Source/web/tests/WebInputEventConversionTest.cpp

Issue 663523002: Adding support for DOM3 KeyboardEvents Code in KeyboardEvents (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Updated to use domCode instead of native domCode Created 5 years, 11 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 #include "web/WebViewImpl.h" 50 #include "web/WebViewImpl.h"
51 #include "web/tests/FrameTestHelpers.h" 51 #include "web/tests/FrameTestHelpers.h"
52 #include <gtest/gtest.h> 52 #include <gtest/gtest.h>
53 53
54 using namespace blink; 54 using namespace blink;
55 55
56 namespace { 56 namespace {
57 57
58 PassRefPtrWillBeRawPtr<KeyboardEvent> createKeyboardEventWithLocation(KeyboardEv ent::KeyLocationCode location) 58 PassRefPtrWillBeRawPtr<KeyboardEvent> createKeyboardEventWithLocation(KeyboardEv ent::KeyLocationCode location)
59 { 59 {
60 return KeyboardEvent::create("keydown", true, true, 0, "", location, false, false, false, false); 60 return KeyboardEvent::create("keydown", true, true, 0, "", "", location, fal se, false, false, false);
61 } 61 }
62 62
63 int getModifiersForKeyLocationCode(KeyboardEvent::KeyLocationCode location) 63 int getModifiersForKeyLocationCode(KeyboardEvent::KeyLocationCode location)
64 { 64 {
65 RefPtrWillBeRawPtr<KeyboardEvent> event = createKeyboardEventWithLocation(lo cation); 65 RefPtrWillBeRawPtr<KeyboardEvent> event = createKeyboardEventWithLocation(lo cation);
66 WebKeyboardEventBuilder convertedEvent(*event); 66 WebKeyboardEventBuilder convertedEvent(*event);
67 return convertedEvent.modifiers; 67 return convertedEvent.modifiers;
68 } 68 }
69 69
70 TEST(WebInputEventConversionTest, WebKeyboardEventBuilder) 70 TEST(WebInputEventConversionTest, WebKeyboardEventBuilder)
(...skipping 719 matching lines...) Expand 10 before | Expand all | Expand 10 after
790 EXPECT_EQ(0, platformWheelBuilder.position().x()); 790 EXPECT_EQ(0, platformWheelBuilder.position().x());
791 EXPECT_EQ(5, platformWheelBuilder.position().y()); 791 EXPECT_EQ(5, platformWheelBuilder.position().y());
792 EXPECT_EQ(10, platformWheelBuilder.deltaX()); 792 EXPECT_EQ(10, platformWheelBuilder.deltaX());
793 EXPECT_EQ(15, platformWheelBuilder.deltaY()); 793 EXPECT_EQ(15, platformWheelBuilder.deltaY());
794 EXPECT_EQ(WebInputEvent::ControlKey, platformWheelBuilder.modifiers()); 794 EXPECT_EQ(WebInputEvent::ControlKey, platformWheelBuilder.modifiers());
795 EXPECT_TRUE(platformWheelBuilder.hasPreciseScrollingDeltas()); 795 EXPECT_TRUE(platformWheelBuilder.hasPreciseScrollingDeltas());
796 EXPECT_TRUE(platformWheelBuilder.canScroll()); 796 EXPECT_TRUE(platformWheelBuilder.canScroll());
797 } 797 }
798 } 798 }
799 } // anonymous namespace 799 } // anonymous namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698