| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/basictypes.h" | 5 #include "base/basictypes.h" |
| 6 #include "base/logging.h" | 6 #include "base/logging.h" |
| 7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
| 8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
| 9 #include "content/browser/renderer_host/input/timeout_monitor.h" | 9 #include "content/browser/renderer_host/input/timeout_monitor.h" |
| 10 #include "content/browser/renderer_host/input/touch_event_queue.h" | 10 #include "content/browser/renderer_host/input/touch_event_queue.h" |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 } | 143 } |
| 144 | 144 |
| 145 bool IsPendingAckTouchStart() const { | 145 bool IsPendingAckTouchStart() const { |
| 146 return queue_->IsPendingAckTouchStart(); | 146 return queue_->IsPendingAckTouchStart(); |
| 147 } | 147 } |
| 148 | 148 |
| 149 void OnHasTouchEventHandlers(bool has_handlers) { | 149 void OnHasTouchEventHandlers(bool has_handlers) { |
| 150 queue_->OnHasTouchEventHandlers(has_handlers); | 150 queue_->OnHasTouchEventHandlers(has_handlers); |
| 151 } | 151 } |
| 152 | 152 |
| 153 bool WillForwardTouchEvents() { | |
| 154 return queue_->has_handlers_ && | |
| 155 !queue_->scroll_in_progress_ && | |
| 156 !queue_->HasTimeoutEvent(); | |
| 157 } | |
| 158 | |
| 159 bool IsTimeoutRunning() { | 153 bool IsTimeoutRunning() { |
| 160 return queue_->IsTimeoutRunningForTesting(); | 154 return queue_->IsTimeoutRunningForTesting(); |
| 161 } | 155 } |
| 162 | 156 |
| 163 size_t queued_event_count() const { | 157 size_t queued_event_count() const { |
| 164 return queue_->size(); | 158 return queue_->size(); |
| 165 } | 159 } |
| 166 | 160 |
| 167 const WebTouchEvent& latest_event() const { | 161 const WebTouchEvent& latest_event() const { |
| 168 return queue_->GetLatestEventForTesting().event; | 162 return queue_->GetLatestEventForTesting().event; |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 EXPECT_EQ(WebInputEvent::TouchStart, acked_event().type); | 251 EXPECT_EQ(WebInputEvent::TouchStart, acked_event().type); |
| 258 | 252 |
| 259 // Flush the queue. The touch-event queue should now be emptied, but none of | 253 // Flush the queue. The touch-event queue should now be emptied, but none of |
| 260 // the queued touch-events should be sent to the renderer. | 254 // the queued touch-events should be sent to the renderer. |
| 261 OnHasTouchEventHandlers(false); | 255 OnHasTouchEventHandlers(false); |
| 262 EXPECT_EQ(0U, queued_event_count()); | 256 EXPECT_EQ(0U, queued_event_count()); |
| 263 EXPECT_EQ(0U, GetAndResetSentEventCount()); | 257 EXPECT_EQ(0U, GetAndResetSentEventCount()); |
| 264 EXPECT_EQ(31U, GetAndResetAckedEventCount()); | 258 EXPECT_EQ(31U, GetAndResetAckedEventCount()); |
| 265 } | 259 } |
| 266 | 260 |
| 261 // Tests that addition of a touch handler during a touch sequence will not cause |
| 262 // the remaining sequence to be forwarded. |
| 263 TEST_F(TouchEventQueueTest, ActiveSequenceNotForwardedWhenHandlersAdded) { |
| 264 OnHasTouchEventHandlers(false); |
| 265 |
| 266 // Send a touch-press event while there is no handler. |
| 267 PressTouchPoint(1, 1); |
| 268 EXPECT_EQ(1U, GetAndResetAckedEventCount()); |
| 269 EXPECT_EQ(0U, GetAndResetSentEventCount()); |
| 270 EXPECT_EQ(0U, queued_event_count()); |
| 271 |
| 272 OnHasTouchEventHandlers(true); |
| 273 |
| 274 // The remaining touch sequence should not be forwarded. |
| 275 MoveTouchPoint(0, 5, 5); |
| 276 ReleaseTouchPoint(0); |
| 277 EXPECT_EQ(2U, GetAndResetAckedEventCount()); |
| 278 EXPECT_EQ(0U, GetAndResetSentEventCount()); |
| 279 EXPECT_EQ(0U, queued_event_count()); |
| 280 |
| 281 // A new touch sequence should resume forwarding. |
| 282 PressTouchPoint(1, 1); |
| 283 EXPECT_EQ(1U, queued_event_count()); |
| 284 EXPECT_EQ(1U, GetAndResetSentEventCount()); |
| 285 } |
| 286 |
| 267 // Tests that removal of a touch handler during a touch sequence will prevent | 287 // Tests that removal of a touch handler during a touch sequence will prevent |
| 268 // the remaining sequence from being forwarded, even if another touch handler is | 288 // the remaining sequence from being forwarded, even if another touch handler is |
| 269 // registered during the same touch sequence. | 289 // registered during the same touch sequence. |
| 270 TEST_F(TouchEventQueueTest, ActiveSequenceDroppedWhenHandlersRemoved) { | 290 TEST_F(TouchEventQueueTest, ActiveSequenceDroppedWhenHandlersRemoved) { |
| 271 // Send a touch-press event. | 291 // Send a touch-press event. |
| 272 PressTouchPoint(1, 1); | 292 PressTouchPoint(1, 1); |
| 273 EXPECT_EQ(1U, GetAndResetSentEventCount()); | 293 EXPECT_EQ(1U, GetAndResetSentEventCount()); |
| 274 EXPECT_EQ(1U, queued_event_count()); | 294 EXPECT_EQ(1U, queued_event_count()); |
| 275 | 295 |
| 276 // Queue a touch-move event. | 296 // Queue a touch-move event. |
| (...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 716 EXPECT_EQ(1U, GetAndResetSentEventCount()); | 736 EXPECT_EQ(1U, GetAndResetSentEventCount()); |
| 717 EXPECT_EQ(1U, GetAndResetAckedEventCount()); | 737 EXPECT_EQ(1U, GetAndResetAckedEventCount()); |
| 718 EXPECT_EQ(INPUT_EVENT_ACK_STATE_NO_CONSUMER_EXISTS, acked_event_state()); | 738 EXPECT_EQ(INPUT_EVENT_ACK_STATE_NO_CONSUMER_EXISTS, acked_event_state()); |
| 719 EXPECT_EQ(WebInputEvent::TouchMove, acked_event().type); | 739 EXPECT_EQ(WebInputEvent::TouchMove, acked_event().type); |
| 720 } | 740 } |
| 721 | 741 |
| 722 // Tests basic TouchEvent forwarding suppression. | 742 // Tests basic TouchEvent forwarding suppression. |
| 723 TEST_F(TouchEventQueueTest, NoTouchBasic) { | 743 TEST_F(TouchEventQueueTest, NoTouchBasic) { |
| 724 // Disable TouchEvent forwarding. | 744 // Disable TouchEvent forwarding. |
| 725 OnHasTouchEventHandlers(false); | 745 OnHasTouchEventHandlers(false); |
| 726 MoveTouchPoint(0, 30, 5); | 746 PressTouchPoint(30, 5); |
| 727 EXPECT_EQ(0U, GetAndResetSentEventCount()); | 747 EXPECT_EQ(0U, GetAndResetSentEventCount()); |
| 728 EXPECT_EQ(1U, GetAndResetAckedEventCount()); | 748 EXPECT_EQ(1U, GetAndResetAckedEventCount()); |
| 729 | 749 |
| 730 // TouchMove should not be sent to renderer. | 750 // TouchMove should not be sent to renderer. |
| 731 MoveTouchPoint(0, 65, 10); | 751 MoveTouchPoint(0, 65, 10); |
| 732 EXPECT_EQ(0U, GetAndResetSentEventCount()); | 752 EXPECT_EQ(0U, GetAndResetSentEventCount()); |
| 733 EXPECT_EQ(1U, GetAndResetAckedEventCount()); | 753 EXPECT_EQ(1U, GetAndResetAckedEventCount()); |
| 734 | 754 |
| 735 // TouchEnd should not be sent to renderer. | 755 // TouchEnd should not be sent to renderer. |
| 736 ReleaseTouchPoint(0); | 756 ReleaseTouchPoint(0); |
| 737 EXPECT_EQ(0U, GetAndResetSentEventCount()); | 757 EXPECT_EQ(0U, GetAndResetSentEventCount()); |
| 738 EXPECT_EQ(1U, GetAndResetAckedEventCount()); | 758 EXPECT_EQ(1U, GetAndResetAckedEventCount()); |
| 739 | 759 |
| 740 // TouchStart should not be sent to renderer. | |
| 741 PressTouchPoint(5, 5); | |
| 742 EXPECT_EQ(0U, GetAndResetSentEventCount()); | |
| 743 EXPECT_EQ(1U, GetAndResetAckedEventCount()); | |
| 744 | |
| 745 // Enable TouchEvent forwarding. | 760 // Enable TouchEvent forwarding. |
| 746 OnHasTouchEventHandlers(true); | 761 OnHasTouchEventHandlers(true); |
| 747 | 762 |
| 748 PressTouchPoint(80, 10); | 763 PressTouchPoint(80, 10); |
| 749 EXPECT_EQ(1U, GetAndResetSentEventCount()); | 764 EXPECT_EQ(1U, GetAndResetSentEventCount()); |
| 750 SendTouchEventACK(INPUT_EVENT_ACK_STATE_NOT_CONSUMED); | 765 SendTouchEventACK(INPUT_EVENT_ACK_STATE_NOT_CONSUMED); |
| 751 EXPECT_EQ(1U, GetAndResetAckedEventCount()); | 766 EXPECT_EQ(1U, GetAndResetAckedEventCount()); |
| 752 | 767 |
| 753 MoveTouchPoint(0, 80, 20); | 768 MoveTouchPoint(0, 80, 20); |
| 754 EXPECT_EQ(1U, GetAndResetSentEventCount()); | 769 EXPECT_EQ(1U, GetAndResetSentEventCount()); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 776 // Queue another TouchStart. | 791 // Queue another TouchStart. |
| 777 PressTouchPoint(20, 20); | 792 PressTouchPoint(20, 20); |
| 778 EXPECT_EQ(2U, queued_event_count()); | 793 EXPECT_EQ(2U, queued_event_count()); |
| 779 EXPECT_EQ(0U, GetAndResetSentEventCount()); | 794 EXPECT_EQ(0U, GetAndResetSentEventCount()); |
| 780 EXPECT_EQ(WebInputEvent::TouchStart, latest_event().type); | 795 EXPECT_EQ(WebInputEvent::TouchStart, latest_event().type); |
| 781 | 796 |
| 782 // GestureScrollBegin inserts a synthetic TouchCancel before the TouchStart. | 797 // GestureScrollBegin inserts a synthetic TouchCancel before the TouchStart. |
| 783 WebGestureEvent followup_scroll; | 798 WebGestureEvent followup_scroll; |
| 784 followup_scroll.type = WebInputEvent::GestureScrollBegin; | 799 followup_scroll.type = WebInputEvent::GestureScrollBegin; |
| 785 SetFollowupEvent(followup_scroll); | 800 SetFollowupEvent(followup_scroll); |
| 786 ASSERT_TRUE(WillForwardTouchEvents()); | |
| 787 SendTouchEventACK(INPUT_EVENT_ACK_STATE_NOT_CONSUMED); | 801 SendTouchEventACK(INPUT_EVENT_ACK_STATE_NOT_CONSUMED); |
| 788 EXPECT_FALSE(WillForwardTouchEvents()); | |
| 789 EXPECT_EQ(1U, GetAndResetSentEventCount()); | 802 EXPECT_EQ(1U, GetAndResetSentEventCount()); |
| 790 EXPECT_EQ(1U, GetAndResetAckedEventCount()); | 803 EXPECT_EQ(1U, GetAndResetAckedEventCount()); |
| 791 EXPECT_EQ(2U, queued_event_count()); | 804 EXPECT_EQ(2U, queued_event_count()); |
| 792 EXPECT_EQ(WebInputEvent::TouchCancel, sent_event().type); | 805 EXPECT_EQ(WebInputEvent::TouchCancel, sent_event().type); |
| 793 EXPECT_EQ(WebInputEvent::TouchStart, latest_event().type); | 806 EXPECT_EQ(WebInputEvent::TouchStart, latest_event().type); |
| 794 | 807 |
| 795 // Acking the TouchCancel will result in dispatch of the next TouchStart. | 808 // Acking the TouchCancel will result in dispatch of the next TouchStart. |
| 796 SendTouchEventACK(INPUT_EVENT_ACK_STATE_NOT_CONSUMED); | 809 SendTouchEventACK(INPUT_EVENT_ACK_STATE_NOT_CONSUMED); |
| 797 // The synthetic TouchCancel should not reach client, only the TouchStart. | 810 // The synthetic TouchCancel should not reach client, only the TouchStart. |
| 798 EXPECT_EQ(1U, GetAndResetAckedEventCount()); | 811 EXPECT_EQ(1U, GetAndResetAckedEventCount()); |
| 799 EXPECT_EQ(0U, GetAndResetSentEventCount()); | 812 EXPECT_EQ(0U, GetAndResetSentEventCount()); |
| 800 EXPECT_EQ(WebInputEvent::TouchStart, acked_event().type); | 813 EXPECT_EQ(WebInputEvent::TouchStart, acked_event().type); |
| 801 | 814 |
| 802 // TouchMove should not be sent to the renderer. | 815 // TouchMove should not be sent to the renderer. |
| 803 MoveTouchPoint(0, 30, 5); | 816 MoveTouchPoint(0, 30, 5); |
| 804 EXPECT_EQ(1U, GetAndResetAckedEventCount()); | 817 EXPECT_EQ(1U, GetAndResetAckedEventCount()); |
| 805 EXPECT_EQ(0U, GetAndResetSentEventCount()); | 818 EXPECT_EQ(0U, GetAndResetSentEventCount()); |
| 806 EXPECT_EQ(INPUT_EVENT_ACK_STATE_NO_CONSUMER_EXISTS, acked_event_state()); | 819 EXPECT_EQ(INPUT_EVENT_ACK_STATE_NO_CONSUMER_EXISTS, acked_event_state()); |
| 807 | 820 |
| 808 // GestureScrollUpdates should not change affect touch forwarding. | 821 // GestureScrollUpdates should not change affect touch forwarding. |
| 809 SendGestureEvent(WebInputEvent::GestureScrollUpdate); | 822 SendGestureEvent(WebInputEvent::GestureScrollUpdate); |
| 810 EXPECT_FALSE(WillForwardTouchEvents()); | |
| 811 | 823 |
| 812 // TouchEnd should not be sent to the renderer. | 824 // TouchEnd should not be sent to the renderer. |
| 813 ReleaseTouchPoint(0); | 825 ReleaseTouchPoint(0); |
| 814 EXPECT_EQ(1U, GetAndResetAckedEventCount()); | 826 EXPECT_EQ(1U, GetAndResetAckedEventCount()); |
| 815 EXPECT_EQ(0U, GetAndResetSentEventCount()); | 827 EXPECT_EQ(0U, GetAndResetSentEventCount()); |
| 816 EXPECT_EQ(INPUT_EVENT_ACK_STATE_NO_CONSUMER_EXISTS, acked_event_state()); | 828 EXPECT_EQ(INPUT_EVENT_ACK_STATE_NO_CONSUMER_EXISTS, acked_event_state()); |
| 817 | 829 |
| 818 // GestureScrollEnd will resume the sending of TouchEvents to renderer. | 830 ReleaseTouchPoint(0); |
| 819 SendGestureEvent(blink::WebInputEvent::GestureScrollEnd); | 831 EXPECT_EQ(1U, GetAndResetAckedEventCount()); |
| 820 EXPECT_TRUE(WillForwardTouchEvents()); | 832 EXPECT_EQ(0U, GetAndResetSentEventCount()); |
| 833 EXPECT_EQ(INPUT_EVENT_ACK_STATE_NO_CONSUMER_EXISTS, acked_event_state()); |
| 821 | 834 |
| 822 // Now TouchEvents should be forwarded normally. | 835 // Touch events from a new gesture sequence should be forwarded normally. |
| 823 PressTouchPoint(80, 10); | 836 PressTouchPoint(80, 10); |
| 824 EXPECT_EQ(1U, GetAndResetSentEventCount()); | 837 EXPECT_EQ(1U, GetAndResetSentEventCount()); |
| 825 SendTouchEventACK(INPUT_EVENT_ACK_STATE_NOT_CONSUMED); | 838 SendTouchEventACK(INPUT_EVENT_ACK_STATE_NOT_CONSUMED); |
| 826 EXPECT_EQ(1U, GetAndResetAckedEventCount()); | 839 EXPECT_EQ(1U, GetAndResetAckedEventCount()); |
| 827 | 840 |
| 828 MoveTouchPoint(0, 80, 20); | 841 MoveTouchPoint(0, 80, 20); |
| 829 EXPECT_EQ(1U, GetAndResetSentEventCount()); | 842 EXPECT_EQ(1U, GetAndResetSentEventCount()); |
| 830 SendTouchEventACK(INPUT_EVENT_ACK_STATE_NOT_CONSUMED); | 843 SendTouchEventACK(INPUT_EVENT_ACK_STATE_NOT_CONSUMED); |
| 831 EXPECT_EQ(1U, GetAndResetAckedEventCount()); | 844 EXPECT_EQ(1U, GetAndResetAckedEventCount()); |
| 832 | 845 |
| 833 ReleaseTouchPoint(0); | 846 ReleaseTouchPoint(0); |
| 834 EXPECT_EQ(1U, GetAndResetSentEventCount()); | 847 EXPECT_EQ(1U, GetAndResetSentEventCount()); |
| 835 SendTouchEventACK(INPUT_EVENT_ACK_STATE_NOT_CONSUMED); | 848 SendTouchEventACK(INPUT_EVENT_ACK_STATE_NOT_CONSUMED); |
| 836 EXPECT_EQ(1U, GetAndResetAckedEventCount()); | 849 EXPECT_EQ(1U, GetAndResetAckedEventCount()); |
| 837 } | 850 } |
| 838 | 851 |
| 852 // Tests that a scroll event will not insert a synthetic TouchCancel if there |
| 853 // was no consumer for the current touch sequence. |
| 854 TEST_F(TouchEventQueueTest, NoTouchCancelOnScrollIfNoConsumer) { |
| 855 // Queue a TouchStart. |
| 856 PressTouchPoint(0, 1); |
| 857 EXPECT_EQ(1U, GetAndResetSentEventCount()); |
| 858 SendTouchEventACK(INPUT_EVENT_ACK_STATE_NO_CONSUMER_EXISTS); |
| 859 EXPECT_EQ(1U, GetAndResetAckedEventCount()); |
| 860 EXPECT_EQ(WebInputEvent::TouchStart, sent_event().type); |
| 861 |
| 862 // Queue a TouchMove that turns into a GestureScrollBegin. |
| 863 WebGestureEvent followup_scroll; |
| 864 followup_scroll.type = WebInputEvent::GestureScrollBegin; |
| 865 SetFollowupEvent(followup_scroll); |
| 866 MoveTouchPoint(0, 20, 5); |
| 867 |
| 868 // The TouchMove has no consumer, and should be ack'ed immediately. However, |
| 869 // *no* synthetic TouchCancel should be inserted as the touch sequence |
| 870 // had no consumer. |
| 871 EXPECT_EQ(0U, queued_event_count()); |
| 872 EXPECT_EQ(0U, GetAndResetSentEventCount()); |
| 873 EXPECT_EQ(1U, GetAndResetAckedEventCount()); |
| 874 EXPECT_EQ(0U, queued_event_count()); |
| 875 EXPECT_EQ(WebInputEvent::TouchStart, sent_event().type); |
| 876 |
| 877 // Subsequent TouchMove's should not be sent to the renderer. |
| 878 MoveTouchPoint(0, 30, 5); |
| 879 EXPECT_EQ(1U, GetAndResetAckedEventCount()); |
| 880 EXPECT_EQ(0U, GetAndResetSentEventCount()); |
| 881 EXPECT_EQ(INPUT_EVENT_ACK_STATE_NO_CONSUMER_EXISTS, acked_event_state()); |
| 882 |
| 883 // TouchEnd should not be sent to the renderer. |
| 884 ReleaseTouchPoint(0); |
| 885 EXPECT_EQ(1U, GetAndResetAckedEventCount()); |
| 886 EXPECT_EQ(0U, GetAndResetSentEventCount()); |
| 887 EXPECT_EQ(INPUT_EVENT_ACK_STATE_NO_CONSUMER_EXISTS, acked_event_state()); |
| 888 |
| 889 // Touch events from a new gesture sequence should be forwarded normally. |
| 890 PressTouchPoint(80, 10); |
| 891 EXPECT_EQ(1U, GetAndResetSentEventCount()); |
| 892 SendTouchEventACK(INPUT_EVENT_ACK_STATE_NOT_CONSUMED); |
| 893 EXPECT_EQ(1U, GetAndResetAckedEventCount()); |
| 894 } |
| 895 |
| 839 // Tests that IsTouchStartPendingAck works correctly. | 896 // Tests that IsTouchStartPendingAck works correctly. |
| 840 TEST_F(TouchEventQueueTest, PendingStart) { | 897 TEST_F(TouchEventQueueTest, PendingStart) { |
| 841 | 898 |
| 842 EXPECT_FALSE(IsPendingAckTouchStart()); | 899 EXPECT_FALSE(IsPendingAckTouchStart()); |
| 843 | 900 |
| 844 // Send the touchstart for one point (#1). | 901 // Send the touchstart for one point (#1). |
| 845 PressTouchPoint(1, 1); | 902 PressTouchPoint(1, 1); |
| 846 EXPECT_EQ(1U, queued_event_count()); | 903 EXPECT_EQ(1U, queued_event_count()); |
| 847 EXPECT_TRUE(IsPendingAckTouchStart()); | 904 EXPECT_TRUE(IsPendingAckTouchStart()); |
| 848 | 905 |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 920 TEST_F(TouchEventQueueTest, TouchTimeoutBasic) { | 977 TEST_F(TouchEventQueueTest, TouchTimeoutBasic) { |
| 921 SetUpForTimeoutTesting(kDefaultTouchTimeoutDelayMs); | 978 SetUpForTimeoutTesting(kDefaultTouchTimeoutDelayMs); |
| 922 | 979 |
| 923 // Queue a TouchStart. | 980 // Queue a TouchStart. |
| 924 GetAndResetSentEventCount(); | 981 GetAndResetSentEventCount(); |
| 925 GetAndResetAckedEventCount(); | 982 GetAndResetAckedEventCount(); |
| 926 PressTouchPoint(0, 1); | 983 PressTouchPoint(0, 1); |
| 927 ASSERT_EQ(1U, GetAndResetSentEventCount()); | 984 ASSERT_EQ(1U, GetAndResetSentEventCount()); |
| 928 ASSERT_EQ(0U, GetAndResetAckedEventCount()); | 985 ASSERT_EQ(0U, GetAndResetAckedEventCount()); |
| 929 EXPECT_TRUE(IsTimeoutRunning()); | 986 EXPECT_TRUE(IsTimeoutRunning()); |
| 930 EXPECT_TRUE(WillForwardTouchEvents()); | |
| 931 | 987 |
| 932 // Delay the ack. | 988 // Delay the ack. |
| 933 base::MessageLoop::current()->PostDelayedTask( | 989 base::MessageLoop::current()->PostDelayedTask( |
| 934 FROM_HERE, | 990 FROM_HERE, |
| 935 base::MessageLoop::QuitClosure(), | 991 base::MessageLoop::QuitClosure(), |
| 936 base::TimeDelta::FromMilliseconds(kDefaultTouchTimeoutDelayMs * 2)); | 992 base::TimeDelta::FromMilliseconds(kDefaultTouchTimeoutDelayMs * 2)); |
| 937 base::MessageLoop::current()->Run(); | 993 base::MessageLoop::current()->Run(); |
| 938 | 994 |
| 939 // The timeout should have fired, synthetically ack'ing the timed-out event. | 995 // The timeout should have fired, synthetically ack'ing the timed-out event. |
| 940 // TouchEvent forwarding is disabled until the ack is received for the | 996 // TouchEvent forwarding is disabled until the ack is received for the |
| 941 // timed-out event and the future cancel event. | 997 // timed-out event and the future cancel event. |
| 942 EXPECT_FALSE(IsTimeoutRunning()); | 998 EXPECT_FALSE(IsTimeoutRunning()); |
| 943 EXPECT_FALSE(WillForwardTouchEvents()); | |
| 944 EXPECT_EQ(0U, GetAndResetSentEventCount()); | 999 EXPECT_EQ(0U, GetAndResetSentEventCount()); |
| 945 EXPECT_EQ(1U, GetAndResetAckedEventCount()); | 1000 EXPECT_EQ(1U, GetAndResetAckedEventCount()); |
| 946 | 1001 |
| 947 // Ack'ing the original event should trigger a cancel event. | 1002 // Ack'ing the original event should trigger a cancel event. |
| 948 SendTouchEventACK(INPUT_EVENT_ACK_STATE_NOT_CONSUMED); | 1003 SendTouchEventACK(INPUT_EVENT_ACK_STATE_NOT_CONSUMED); |
| 949 EXPECT_FALSE(IsTimeoutRunning()); | 1004 EXPECT_FALSE(IsTimeoutRunning()); |
| 950 EXPECT_FALSE(WillForwardTouchEvents()); | |
| 951 EXPECT_EQ(0U, GetAndResetAckedEventCount()); | 1005 EXPECT_EQ(0U, GetAndResetAckedEventCount()); |
| 952 EXPECT_EQ(1U, GetAndResetSentEventCount()); | 1006 EXPECT_EQ(1U, GetAndResetSentEventCount()); |
| 953 | 1007 |
| 954 // Touch events should not be forwarded until we receive the cancel acks. | 1008 // Touch events should not be forwarded until we receive the cancel acks. |
| 955 PressTouchPoint(0, 1); | 1009 MoveTouchPoint(0, 1, 1); |
| 956 ASSERT_EQ(0U, GetAndResetSentEventCount()); | 1010 ASSERT_EQ(0U, GetAndResetSentEventCount()); |
| 957 ASSERT_EQ(1U, GetAndResetAckedEventCount()); | 1011 ASSERT_EQ(1U, GetAndResetAckedEventCount()); |
| 958 | 1012 |
| 1013 ReleaseTouchPoint(0); |
| 1014 ASSERT_EQ(0U, GetAndResetSentEventCount()); |
| 1015 ASSERT_EQ(1U, GetAndResetAckedEventCount()); |
| 1016 |
| 959 // The synthetic TouchCancel ack should not reach the client, but should | 1017 // The synthetic TouchCancel ack should not reach the client, but should |
| 960 // resume touch forwarding. | 1018 // resume touch forwarding. |
| 961 SendTouchEventACK(INPUT_EVENT_ACK_STATE_NOT_CONSUMED); | 1019 SendTouchEventACK(INPUT_EVENT_ACK_STATE_NOT_CONSUMED); |
| 962 EXPECT_EQ(0U, GetAndResetSentEventCount()); | 1020 EXPECT_EQ(0U, GetAndResetSentEventCount()); |
| 963 EXPECT_EQ(0U, GetAndResetAckedEventCount()); | 1021 EXPECT_EQ(0U, GetAndResetAckedEventCount()); |
| 964 EXPECT_TRUE(WillForwardTouchEvents()); | |
| 965 | 1022 |
| 966 // Subsequent events should be handled normally. | 1023 // Subsequent events should be handled normally. |
| 967 PressTouchPoint(0, 1); | 1024 PressTouchPoint(0, 1); |
| 968 EXPECT_EQ(1U, GetAndResetSentEventCount()); | 1025 EXPECT_EQ(1U, GetAndResetSentEventCount()); |
| 969 EXPECT_EQ(0U, GetAndResetAckedEventCount()); | 1026 EXPECT_EQ(0U, GetAndResetAckedEventCount()); |
| 970 } | 1027 } |
| 971 | 1028 |
| 972 // Tests that the timeout is never started if the renderer consumes | 1029 // Tests that the timeout is never started if the renderer consumes |
| 973 // a TouchEvent from the current touch sequence. | 1030 // a TouchEvent from the current touch sequence. |
| 974 TEST_F(TouchEventQueueTest, NoTouchTimeoutIfRendererIsConsumingGesture) { | 1031 TEST_F(TouchEventQueueTest, NoTouchTimeoutIfRendererIsConsumingGesture) { |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1028 } | 1085 } |
| 1029 | 1086 |
| 1030 // Tests that a TouchCancel timeout plays nice when the timed out touch stream | 1087 // Tests that a TouchCancel timeout plays nice when the timed out touch stream |
| 1031 // turns into a scroll gesture sequence. | 1088 // turns into a scroll gesture sequence. |
| 1032 TEST_F(TouchEventQueueTest, TouchTimeoutWithFollowupGesture) { | 1089 TEST_F(TouchEventQueueTest, TouchTimeoutWithFollowupGesture) { |
| 1033 SetUpForTimeoutTesting(kDefaultTouchTimeoutDelayMs); | 1090 SetUpForTimeoutTesting(kDefaultTouchTimeoutDelayMs); |
| 1034 | 1091 |
| 1035 // Queue a TouchStart. | 1092 // Queue a TouchStart. |
| 1036 PressTouchPoint(0, 1); | 1093 PressTouchPoint(0, 1); |
| 1037 EXPECT_TRUE(IsTimeoutRunning()); | 1094 EXPECT_TRUE(IsTimeoutRunning()); |
| 1038 EXPECT_TRUE(WillForwardTouchEvents()); | |
| 1039 EXPECT_EQ(1U, GetAndResetSentEventCount()); | 1095 EXPECT_EQ(1U, GetAndResetSentEventCount()); |
| 1040 | 1096 |
| 1041 // The cancelled sequence may turn into a scroll gesture. | 1097 // The cancelled sequence may turn into a scroll gesture. |
| 1042 WebGestureEvent followup_scroll; | 1098 WebGestureEvent followup_scroll; |
| 1043 followup_scroll.type = WebInputEvent::GestureScrollBegin; | 1099 followup_scroll.type = WebInputEvent::GestureScrollBegin; |
| 1044 SetFollowupEvent(followup_scroll); | 1100 SetFollowupEvent(followup_scroll); |
| 1045 | 1101 |
| 1046 // Delay the ack. | 1102 // Delay the ack. |
| 1047 base::MessageLoop::current()->PostDelayedTask( | 1103 base::MessageLoop::current()->PostDelayedTask( |
| 1048 FROM_HERE, | 1104 FROM_HERE, |
| 1049 base::MessageLoop::QuitClosure(), | 1105 base::MessageLoop::QuitClosure(), |
| 1050 base::TimeDelta::FromMilliseconds(kDefaultTouchTimeoutDelayMs * 2)); | 1106 base::TimeDelta::FromMilliseconds(kDefaultTouchTimeoutDelayMs * 2)); |
| 1051 base::MessageLoop::current()->Run(); | 1107 base::MessageLoop::current()->Run(); |
| 1052 | 1108 |
| 1053 // The timeout should have fired, disabling touch forwarding until both acks | 1109 // The timeout should have fired, disabling touch forwarding until both acks |
| 1054 // are received, acking the timed out event. | 1110 // are received, acking the timed out event. |
| 1055 EXPECT_FALSE(IsTimeoutRunning()); | 1111 EXPECT_FALSE(IsTimeoutRunning()); |
| 1056 EXPECT_FALSE(WillForwardTouchEvents()); | |
| 1057 EXPECT_EQ(0U, GetAndResetSentEventCount()); | 1112 EXPECT_EQ(0U, GetAndResetSentEventCount()); |
| 1058 EXPECT_EQ(1U, GetAndResetAckedEventCount()); | 1113 EXPECT_EQ(1U, GetAndResetAckedEventCount()); |
| 1059 | 1114 |
| 1060 // Ack the original event, triggering a TouchCancel. | 1115 // Ack the original event, triggering a TouchCancel. |
| 1061 SendTouchEventACK(INPUT_EVENT_ACK_STATE_CONSUMED); | 1116 SendTouchEventACK(INPUT_EVENT_ACK_STATE_CONSUMED); |
| 1062 EXPECT_FALSE(IsTimeoutRunning()); | 1117 EXPECT_FALSE(IsTimeoutRunning()); |
| 1063 EXPECT_FALSE(WillForwardTouchEvents()); | |
| 1064 EXPECT_EQ(1U, GetAndResetSentEventCount()); | 1118 EXPECT_EQ(1U, GetAndResetSentEventCount()); |
| 1065 EXPECT_EQ(0U, GetAndResetAckedEventCount()); | 1119 EXPECT_EQ(0U, GetAndResetAckedEventCount()); |
| 1066 | 1120 |
| 1067 // Ack the cancel event. Normally, this would resume touch forwarding, | 1121 // Ack the cancel event. Normally, this would resume touch forwarding, |
| 1068 // but we're still within a scroll gesture so it remains disabled. | 1122 // but we're still within a scroll gesture so it remains disabled. |
| 1069 SendTouchEventACK(INPUT_EVENT_ACK_STATE_CONSUMED); | 1123 SendTouchEventACK(INPUT_EVENT_ACK_STATE_CONSUMED); |
| 1070 EXPECT_FALSE(IsTimeoutRunning()); | 1124 EXPECT_FALSE(IsTimeoutRunning()); |
| 1071 EXPECT_FALSE(WillForwardTouchEvents()); | |
| 1072 EXPECT_EQ(0U, GetAndResetSentEventCount()); | 1125 EXPECT_EQ(0U, GetAndResetSentEventCount()); |
| 1073 EXPECT_EQ(0U, GetAndResetAckedEventCount()); | 1126 EXPECT_EQ(0U, GetAndResetAckedEventCount()); |
| 1074 | 1127 |
| 1075 // Try to forward a touch event. | 1128 // Try to forward touch events for the current sequence. |
| 1076 GetAndResetSentEventCount(); | 1129 GetAndResetSentEventCount(); |
| 1077 GetAndResetAckedEventCount(); | 1130 GetAndResetAckedEventCount(); |
| 1078 PressTouchPoint(0, 1); | 1131 MoveTouchPoint(0, 1, 1); |
| 1132 ReleaseTouchPoint(0); |
| 1079 EXPECT_FALSE(IsTimeoutRunning()); | 1133 EXPECT_FALSE(IsTimeoutRunning()); |
| 1080 EXPECT_EQ(0U, GetAndResetSentEventCount()); | 1134 EXPECT_EQ(0U, GetAndResetSentEventCount()); |
| 1081 EXPECT_EQ(1U, GetAndResetAckedEventCount()); | 1135 EXPECT_EQ(2U, GetAndResetAckedEventCount()); |
| 1082 | 1136 |
| 1083 // Now end the scroll sequence, resuming touch handling. | 1137 // Now end the scroll sequence, resuming touch handling. |
| 1084 SendGestureEvent(blink::WebInputEvent::GestureScrollEnd); | 1138 SendGestureEvent(blink::WebInputEvent::GestureScrollEnd); |
| 1085 EXPECT_TRUE(WillForwardTouchEvents()); | |
| 1086 PressTouchPoint(0, 1); | 1139 PressTouchPoint(0, 1); |
| 1087 EXPECT_TRUE(IsTimeoutRunning()); | 1140 EXPECT_TRUE(IsTimeoutRunning()); |
| 1088 EXPECT_EQ(1U, GetAndResetSentEventCount()); | 1141 EXPECT_EQ(1U, GetAndResetSentEventCount()); |
| 1089 EXPECT_EQ(0U, GetAndResetAckedEventCount()); | 1142 EXPECT_EQ(0U, GetAndResetAckedEventCount()); |
| 1090 } | 1143 } |
| 1091 | 1144 |
| 1092 // Tests that a TouchCancel timeout plays nice when the timed out touch stream | 1145 // Tests that a TouchCancel timeout plays nice when the timed out touch stream |
| 1093 // turns into a scroll gesture sequence, but the original event acks are | 1146 // turns into a scroll gesture sequence, but the original event acks are |
| 1094 // significantly delayed. | 1147 // significantly delayed. |
| 1095 TEST_F(TouchEventQueueTest, TouchTimeoutWithFollowupGestureAndDelayedAck) { | 1148 TEST_F(TouchEventQueueTest, TouchTimeoutWithFollowupGestureAndDelayedAck) { |
| 1096 SetUpForTimeoutTesting(kDefaultTouchTimeoutDelayMs); | 1149 SetUpForTimeoutTesting(kDefaultTouchTimeoutDelayMs); |
| 1097 | 1150 |
| 1098 // Queue a TouchStart. | 1151 // Queue a TouchStart. |
| 1099 PressTouchPoint(0, 1); | 1152 PressTouchPoint(0, 1); |
| 1100 EXPECT_TRUE(IsTimeoutRunning()); | 1153 EXPECT_TRUE(IsTimeoutRunning()); |
| 1101 EXPECT_TRUE(WillForwardTouchEvents()); | |
| 1102 EXPECT_EQ(1U, GetAndResetSentEventCount()); | 1154 EXPECT_EQ(1U, GetAndResetSentEventCount()); |
| 1103 | 1155 |
| 1104 // The cancelled sequence may turn into a scroll gesture. | 1156 // The cancelled sequence may turn into a scroll gesture. |
| 1105 WebGestureEvent followup_scroll; | 1157 WebGestureEvent followup_scroll; |
| 1106 followup_scroll.type = WebInputEvent::GestureScrollBegin; | 1158 followup_scroll.type = WebInputEvent::GestureScrollBegin; |
| 1107 SetFollowupEvent(followup_scroll); | 1159 SetFollowupEvent(followup_scroll); |
| 1108 | 1160 |
| 1109 // Delay the ack. | 1161 // Delay the ack. |
| 1110 base::MessageLoop::current()->PostDelayedTask( | 1162 base::MessageLoop::current()->PostDelayedTask( |
| 1111 FROM_HERE, | 1163 FROM_HERE, |
| 1112 base::MessageLoop::QuitClosure(), | 1164 base::MessageLoop::QuitClosure(), |
| 1113 base::TimeDelta::FromMilliseconds(kDefaultTouchTimeoutDelayMs * 2)); | 1165 base::TimeDelta::FromMilliseconds(kDefaultTouchTimeoutDelayMs * 2)); |
| 1114 base::MessageLoop::current()->Run(); | 1166 base::MessageLoop::current()->Run(); |
| 1115 | 1167 |
| 1116 // The timeout should have fired, disabling touch forwarding until both acks | 1168 // The timeout should have fired, disabling touch forwarding until both acks |
| 1117 // are received and acking the timed out event. | 1169 // are received and acking the timed out event. |
| 1118 EXPECT_FALSE(IsTimeoutRunning()); | 1170 EXPECT_FALSE(IsTimeoutRunning()); |
| 1119 EXPECT_FALSE(WillForwardTouchEvents()); | |
| 1120 EXPECT_EQ(0U, GetAndResetSentEventCount()); | 1171 EXPECT_EQ(0U, GetAndResetSentEventCount()); |
| 1121 EXPECT_EQ(1U, GetAndResetAckedEventCount()); | 1172 EXPECT_EQ(1U, GetAndResetAckedEventCount()); |
| 1122 | 1173 |
| 1123 // Try to forward a touch event. | 1174 // Try to forward a touch event. |
| 1124 GetAndResetSentEventCount(); | 1175 GetAndResetSentEventCount(); |
| 1125 GetAndResetAckedEventCount(); | 1176 GetAndResetAckedEventCount(); |
| 1126 PressTouchPoint(0, 1); | 1177 MoveTouchPoint(0, 1, 1); |
| 1127 EXPECT_FALSE(IsTimeoutRunning()); | 1178 EXPECT_FALSE(IsTimeoutRunning()); |
| 1128 EXPECT_EQ(0U, GetAndResetSentEventCount()); | 1179 EXPECT_EQ(0U, GetAndResetSentEventCount()); |
| 1129 EXPECT_EQ(1U, GetAndResetAckedEventCount()); | 1180 EXPECT_EQ(1U, GetAndResetAckedEventCount()); |
| 1130 | 1181 |
| 1131 // Now end the scroll sequence. Events will not be forwarded until the two | 1182 // Now end the scroll sequence. Events will not be forwarded until the two |
| 1132 // outstanding touch acks are received. | 1183 // outstanding touch acks are received. |
| 1133 SendGestureEvent(blink::WebInputEvent::GestureScrollEnd); | 1184 SendGestureEvent(blink::WebInputEvent::GestureScrollEnd); |
| 1134 PressTouchPoint(0, 1); | 1185 MoveTouchPoint(0, 2, 2); |
| 1186 ReleaseTouchPoint(0); |
| 1135 EXPECT_FALSE(IsTimeoutRunning()); | 1187 EXPECT_FALSE(IsTimeoutRunning()); |
| 1136 EXPECT_EQ(0U, GetAndResetSentEventCount()); | 1188 EXPECT_EQ(0U, GetAndResetSentEventCount()); |
| 1137 EXPECT_EQ(1U, GetAndResetAckedEventCount()); | 1189 EXPECT_EQ(2U, GetAndResetAckedEventCount()); |
| 1138 | 1190 |
| 1139 // Ack the original event, triggering a cancel. | 1191 // Ack the original event, triggering a cancel. |
| 1140 SendTouchEventACK(INPUT_EVENT_ACK_STATE_CONSUMED); | 1192 SendTouchEventACK(INPUT_EVENT_ACK_STATE_CONSUMED); |
| 1141 EXPECT_EQ(1U, GetAndResetSentEventCount()); | 1193 EXPECT_EQ(1U, GetAndResetSentEventCount()); |
| 1142 EXPECT_EQ(0U, GetAndResetAckedEventCount()); | 1194 EXPECT_EQ(0U, GetAndResetAckedEventCount()); |
| 1143 | 1195 |
| 1144 // Ack the cancel event, resuming touch forwarding. | 1196 // Ack the cancel event, resuming touch forwarding. |
| 1145 SendTouchEventACK(INPUT_EVENT_ACK_STATE_CONSUMED); | 1197 SendTouchEventACK(INPUT_EVENT_ACK_STATE_CONSUMED); |
| 1146 EXPECT_EQ(0U, GetAndResetSentEventCount()); | 1198 EXPECT_EQ(0U, GetAndResetSentEventCount()); |
| 1147 EXPECT_EQ(0U, GetAndResetAckedEventCount()); | 1199 EXPECT_EQ(0U, GetAndResetAckedEventCount()); |
| 1148 | 1200 |
| 1149 PressTouchPoint(0, 1); | 1201 PressTouchPoint(0, 1); |
| 1150 EXPECT_TRUE(IsTimeoutRunning()); | 1202 EXPECT_TRUE(IsTimeoutRunning()); |
| 1151 EXPECT_EQ(1U, GetAndResetSentEventCount()); | 1203 EXPECT_EQ(1U, GetAndResetSentEventCount()); |
| 1152 } | 1204 } |
| 1153 | 1205 |
| 1154 // Tests that a delayed TouchEvent ack will not trigger a TouchCancel timeout if | 1206 // Tests that a delayed TouchEvent ack will not trigger a TouchCancel timeout if |
| 1155 // the timed-out event had no consumer. | 1207 // the timed-out event had no consumer. |
| 1156 TEST_F(TouchEventQueueTest, NoCancelOnTouchTimeoutWithoutConsumer) { | 1208 TEST_F(TouchEventQueueTest, NoCancelOnTouchTimeoutWithoutConsumer) { |
| 1157 SetUpForTimeoutTesting(kDefaultTouchTimeoutDelayMs); | 1209 SetUpForTimeoutTesting(kDefaultTouchTimeoutDelayMs); |
| 1158 | 1210 |
| 1159 // Queue a TouchStart. | 1211 // Queue a TouchStart. |
| 1160 PressTouchPoint(0, 1); | 1212 PressTouchPoint(0, 1); |
| 1161 ASSERT_EQ(1U, GetAndResetSentEventCount()); | 1213 ASSERT_EQ(1U, GetAndResetSentEventCount()); |
| 1162 ASSERT_EQ(0U, GetAndResetAckedEventCount()); | 1214 ASSERT_EQ(0U, GetAndResetAckedEventCount()); |
| 1163 EXPECT_TRUE(IsTimeoutRunning()); | 1215 EXPECT_TRUE(IsTimeoutRunning()); |
| 1164 EXPECT_TRUE(WillForwardTouchEvents()); | |
| 1165 | 1216 |
| 1166 // Delay the ack. | 1217 // Delay the ack. |
| 1167 base::MessageLoop::current()->PostDelayedTask( | 1218 base::MessageLoop::current()->PostDelayedTask( |
| 1168 FROM_HERE, | 1219 FROM_HERE, |
| 1169 base::MessageLoop::QuitClosure(), | 1220 base::MessageLoop::QuitClosure(), |
| 1170 base::TimeDelta::FromMilliseconds(kDefaultTouchTimeoutDelayMs * 2)); | 1221 base::TimeDelta::FromMilliseconds(kDefaultTouchTimeoutDelayMs * 2)); |
| 1171 base::MessageLoop::current()->Run(); | 1222 base::MessageLoop::current()->Run(); |
| 1172 | 1223 |
| 1173 // The timeout should have fired, synthetically ack'ing the timed out event. | 1224 // The timeout should have fired, synthetically ack'ing the timed out event. |
| 1174 // TouchEvent forwarding is disabled until the original ack is received. | 1225 // TouchEvent forwarding is disabled until the original ack is received. |
| 1175 EXPECT_FALSE(IsTimeoutRunning()); | 1226 EXPECT_FALSE(IsTimeoutRunning()); |
| 1176 EXPECT_FALSE(WillForwardTouchEvents()); | |
| 1177 EXPECT_EQ(0U, GetAndResetSentEventCount()); | 1227 EXPECT_EQ(0U, GetAndResetSentEventCount()); |
| 1178 EXPECT_EQ(1U, GetAndResetAckedEventCount()); | 1228 EXPECT_EQ(1U, GetAndResetAckedEventCount()); |
| 1179 | 1229 |
| 1180 // Touch events should not be forwarded until we receive the original ack. | 1230 // Touch events should not be forwarded until we receive the original ack. |
| 1181 PressTouchPoint(0, 1); | 1231 MoveTouchPoint(0, 1, 1); |
| 1232 ReleaseTouchPoint(0); |
| 1182 ASSERT_EQ(0U, GetAndResetSentEventCount()); | 1233 ASSERT_EQ(0U, GetAndResetSentEventCount()); |
| 1183 ASSERT_EQ(1U, GetAndResetAckedEventCount()); | 1234 ASSERT_EQ(2U, GetAndResetAckedEventCount()); |
| 1184 | 1235 |
| 1185 // Ack'ing the original event should not trigger a cancel event, as the | 1236 // Ack'ing the original event should not trigger a cancel event, as the |
| 1186 // TouchStart had no consumer. However, it should re-enable touch forwarding. | 1237 // TouchStart had no consumer. However, it should re-enable touch forwarding. |
| 1187 SendTouchEventACK(INPUT_EVENT_ACK_STATE_NO_CONSUMER_EXISTS); | 1238 SendTouchEventACK(INPUT_EVENT_ACK_STATE_NO_CONSUMER_EXISTS); |
| 1188 EXPECT_FALSE(IsTimeoutRunning()); | 1239 EXPECT_FALSE(IsTimeoutRunning()); |
| 1189 EXPECT_TRUE(WillForwardTouchEvents()); | |
| 1190 EXPECT_EQ(0U, GetAndResetAckedEventCount()); | 1240 EXPECT_EQ(0U, GetAndResetAckedEventCount()); |
| 1191 EXPECT_EQ(0U, GetAndResetSentEventCount()); | 1241 EXPECT_EQ(0U, GetAndResetSentEventCount()); |
| 1192 | 1242 |
| 1193 // Subsequent events should be handled normally. | 1243 // Subsequent events should be handled normally. |
| 1194 PressTouchPoint(0, 1); | 1244 PressTouchPoint(0, 1); |
| 1195 EXPECT_EQ(1U, GetAndResetSentEventCount()); | 1245 EXPECT_EQ(1U, GetAndResetSentEventCount()); |
| 1196 EXPECT_EQ(0U, GetAndResetAckedEventCount()); | 1246 EXPECT_EQ(0U, GetAndResetAckedEventCount()); |
| 1197 } | 1247 } |
| 1198 } // namespace content | 1248 } // namespace content |
| OLD | NEW |