| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |