Bug 1200194 - Remove unneeded AccessibleCaretManager::OnScrolling(). r=roc

This functions is for hiding caret in cursor mode on desktop browser
when receiving NS_WHEEL_WHEEL, which is never used on B2G in production.

On desktop browser, a proper wheel scroll cycle begins by NS_WHEEL_START
and ends by NS_WHEEL_STOP, which was covered by gtest. Move the three
marionette test for TouchCaret only.

--HG--
extra : commitid : KCG4QMsPhdY
extra : rebase_source : b33ca79699cfffe33da1890aed10935fa7565e1c
This commit is contained in:
Ting-Yu Lin 2015-09-09 16:47:21 +08:00
parent b9f7a85db6
commit 8d952a059e
5 changed files with 12 additions and 38 deletions

View File

@ -66,11 +66,6 @@ public:
aContext->SetState(aContext->ScrollState());
}
virtual void OnScrolling(AccessibleCaretEventHub* aContext) override
{
aContext->mManager->OnScrolling();
}
virtual void OnScrollPositionChanged(AccessibleCaretEventHub* aContext) override
{
aContext->mManager->OnScrollPositionChanged();

View File

@ -415,22 +415,6 @@ AccessibleCaretManager::OnScrollEnd()
}
}
void
AccessibleCaretManager::OnScrolling()
{
if (mCaretMode != GetCaretMode()) {
return;
}
if (GetCaretMode() == CaretMode::Cursor) {
AC_LOG("%s: HideCarets()", __FUNCTION__);
HideCarets();
} else {
AC_LOG("%s: UpdateCarets()", __FUNCTION__);
UpdateCarets();
}
}
void
AccessibleCaretManager::OnScrollPositionChanged()
{

View File

@ -75,9 +75,6 @@ public:
// Handle scroll-end event.
virtual void OnScrollEnd();
// Handle NS_WHEEL_WHEEL event.
virtual void OnScrolling();
// Handle ScrollPositionChanged from nsIScrollObserver. This might be called
// at anytime, not necessary between OnScrollStart and OnScrollEnd.
virtual void OnScrollPositionChanged();

View File

@ -47,7 +47,6 @@ public:
MOCK_METHOD1(SelectWordOrShortcut, nsresult(const nsPoint& aPoint));
MOCK_METHOD0(OnScrollStart, void());
MOCK_METHOD0(OnScrollEnd, void());
MOCK_METHOD0(OnScrolling, void());
MOCK_METHOD0(OnScrollPositionChanged, void());
MOCK_METHOD0(OnBlur, void());
};
@ -635,7 +634,6 @@ TEST_F(AccessibleCaretEventHubTester, TestNoEventAsyncPanZoomScroll)
EXPECT_CALL(check, Call("1"));
EXPECT_CALL(*mHub->GetMockAccessibleCaretManager(), OnScrollStart());
EXPECT_CALL(*mHub->GetMockAccessibleCaretManager(), OnScrolling()).Times(0);
EXPECT_CALL(*mHub->GetMockAccessibleCaretManager(),
OnScrollPositionChanged()).Times(0);

View File

@ -255,10 +255,6 @@ class CommonCaretTestCase(object):
self.open_test_html(timeout_ms=1000)
self._test_touch_caret_timeout_by_dragging_it_to_top_left_corner_after_timout(self._input, self.assertNotEqual)
def test_input_touch_caret_hides_after_receiving_wheel_event(self):
self.open_test_html()
self._test_touch_caret_hides_after_receiving_wheel_event(self._input, self.assertNotEqual)
########################################################################
# <input> test cases with touch caret disabled
########################################################################
@ -289,10 +285,6 @@ class CommonCaretTestCase(object):
self.open_test_html(timeout_ms=1000)
self._test_touch_caret_timeout_by_dragging_it_to_top_left_corner_after_timout(self._textarea, self.assertNotEqual)
def test_textarea_touch_caret_hides_after_receiving_wheel_event(self):
self.open_test_html()
self._test_touch_caret_hides_after_receiving_wheel_event(self._textarea, self.assertNotEqual)
########################################################################
# <textarea> test cases with touch caret disabled
########################################################################
@ -323,10 +315,6 @@ class CommonCaretTestCase(object):
self.open_test_html(timeout_ms=1000)
self._test_touch_caret_timeout_by_dragging_it_to_top_left_corner_after_timout(self._contenteditable, self.assertNotEqual)
def test_contenteditable_touch_caret_hides_after_receiving_wheel_event(self):
self.open_test_html()
self._test_touch_caret_hides_after_receiving_wheel_event(self._contenteditable, self.assertNotEqual)
########################################################################
# <div> contenteditable test cases with touch caret disabled
########################################################################
@ -346,6 +334,18 @@ class TouchCaretTestCase(CommonCaretTestCase, MarionetteTestCase):
self.caret_disabled_pref = 'layout.accessiblecaret.enabled'
self.caret_timeout_ms_pref = 'touchcaret.expiration.time'
def test_input_touch_caret_hides_after_receiving_wheel_event(self):
self.open_test_html()
self._test_touch_caret_hides_after_receiving_wheel_event(self._input, self.assertNotEqual)
def test_textarea_touch_caret_hides_after_receiving_wheel_event(self):
self.open_test_html()
self._test_touch_caret_hides_after_receiving_wheel_event(self._textarea, self.assertNotEqual)
def test_contenteditable_touch_caret_hides_after_receiving_wheel_event(self):
self.open_test_html()
self._test_touch_caret_hides_after_receiving_wheel_event(self._contenteditable, self.assertNotEqual)
class AccessibleCaretCursorModeTestCase(CommonCaretTestCase, MarionetteTestCase):
def setUp(self):