Commit d8f032ea authored by Regan Hsu's avatar Regan Hsu Committed by Commit Bot

[CrOS Settings] Reverse scrolling touchpad change.

Prior to this change, enabling Reverse scrolling would meant that
swiping up would cause the page to move up, and vice versa. This CL
corrects that so that:

* Turn off Reverse (swipe up to move the page up).
* Turn on Reverse (swipe up to move the page down).

This is fixed by setting the "natural_scroll" pref to true if
"Reverse Scrolling" is enabled, and the "natural_scroll" pref to false
if "Reverse Scrolling" is disabled, instead of the opposite as it was
previously.

Fixed: 1109966
Change-Id: Id60df73f421992dce893339b6efaac0941ef9110
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2321235
Commit-Queue: Regan Hsu <hsuregan@chromium.org>
Reviewed-by: default avatarKyle Horimoto <khorimoto@chromium.org>
Cr-Commit-Position: refs/heads/master@{#792558}
parent 9830cdf0
...@@ -151,7 +151,7 @@ ...@@ -151,7 +151,7 @@
</settings-localized-link> </settings-localized-link>
</div> </div>
<cr-toggle id="enableReverseScrollingToggle" <cr-toggle id="enableReverseScrollingToggle"
checked="{{!prefs.settings.touchpad.natural_scroll.value}}" checked="{{prefs.settings.touchpad.natural_scroll.value}}"
aria-labelledby="enableReverseScrollingLabel"> aria-labelledby="enableReverseScrollingLabel">
</cr-toggle> </cr-toggle>
</div> </div>
......
...@@ -112,6 +112,6 @@ Polymer({ ...@@ -112,6 +112,6 @@ Polymer({
onReverseScrollRowClicked_: function() { onReverseScrollRowClicked_: function() {
this.setPrefValue( this.setPrefValue(
'settings.touchpad.natural_scroll', 'settings.touchpad.natural_scroll',
!this.getPref('settings.touchpad.natural_scroll').value); this.getPref('settings.touchpad.natural_scroll').value);
}, },
}); });
...@@ -561,7 +561,7 @@ cr.define('device_page_tests', function() { ...@@ -561,7 +561,7 @@ cr.define('device_page_tests', function() {
const reverseScrollToggle = const reverseScrollToggle =
pointersPage.$$('#enableReverseScrollingToggle'); pointersPage.$$('#enableReverseScrollingToggle');
assertEquals(expected, reverseScrollToggle.checked); assertEquals(expected, reverseScrollToggle.checked);
expectNotEquals( expectEquals(
expected, devicePage.prefs.settings.touchpad.natural_scroll.value); expected, devicePage.prefs.settings.touchpad.natural_scroll.value);
} }
...@@ -665,7 +665,7 @@ cr.define('device_page_tests', function() { ...@@ -665,7 +665,7 @@ cr.define('device_page_tests', function() {
}); });
test('link doesn\'t activate control', function() { test('link doesn\'t activate control', function() {
expectReverseScrollValue(pointersPage, true); expectReverseScrollValue(pointersPage, false);
// Tapping the link shouldn't enable the radio button. // Tapping the link shouldn't enable the radio button.
const reverseScrollLabel = const reverseScrollLabel =
...@@ -675,22 +675,22 @@ cr.define('device_page_tests', function() { ...@@ -675,22 +675,22 @@ cr.define('device_page_tests', function() {
// Prevent actually opening a link, which would block test. // Prevent actually opening a link, which would block test.
a.removeAttribute('href'); a.removeAttribute('href');
a.click(); a.click();
expectReverseScrollValue(pointersPage, true); expectReverseScrollValue(pointersPage, false);
// Check specifically clicking toggle changes pref. // Check specifically clicking toggle changes pref.
const reverseScrollToggle = const reverseScrollToggle =
pointersPage.$$('#enableReverseScrollingToggle'); pointersPage.$$('#enableReverseScrollingToggle');
reverseScrollToggle.click(); reverseScrollToggle.click();
expectReverseScrollValue(pointersPage, false);
devicePage.set('prefs.settings.touchpad.natural_scroll.value', false);
expectReverseScrollValue(pointersPage, true); expectReverseScrollValue(pointersPage, true);
devicePage.set('prefs.settings.touchpad.natural_scroll.value', false);
expectReverseScrollValue(pointersPage, false);
// Check specifically clicking the row changes pref. // Check specifically clicking the row changes pref.
const reverseScrollSettings = pointersPage.$$('#reverseScrollRow'); const reverseScrollSettings = pointersPage.$$('#reverseScrollRow');
reverseScrollToggle.click(); reverseScrollToggle.click();
expectReverseScrollValue(pointersPage, false);
devicePage.set('prefs.settings.touchpad.natural_scroll.value', false);
expectReverseScrollValue(pointersPage, true); expectReverseScrollValue(pointersPage, true);
devicePage.set('prefs.settings.touchpad.natural_scroll.value', false);
expectReverseScrollValue(pointersPage, false);
}); });
}); });
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment