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

Unified Diff: chrome/browser/ui/webui/options/options_browsertest.js

Issue 400993003: Save slider preferences when using touch. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Can only test CrOS Created 6 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/resources/options/pref_ui.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/options/options_browsertest.js
diff --git a/chrome/browser/ui/webui/options/options_browsertest.js b/chrome/browser/ui/webui/options/options_browsertest.js
index 022fdd385ff9bead2a3111afd4ffaee5a4717e5e..82b636273f3b8f8fcbded5fe24cb06f09a5f7cae 100644
--- a/chrome/browser/ui/webui/options/options_browsertest.js
+++ b/chrome/browser/ui/webui/options/options_browsertest.js
@@ -311,6 +311,47 @@ TEST_F('OptionsWebUITest', 'DISABLED_OverlayShowDoesntShift', function() {
expectGT(numFrozenPages, 0);
});
+GEN('#if defined(OS_CHROMEOS)');
+// Verify that range inputs respond to touch events. Currently only Chrome OS
+// uses slider options.
+TEST_F('OptionsWebUITest', 'RangeInputHandlesTouchEvents', function() {
+ this.mockHandler.expects(once()).setIntegerPref([
+ 'settings.touchpad.sensitivity2', 1]);
+
+ var touchpadRange = $('touchpad-sensitivity-range');
+ var event = document.createEvent('UIEvent');
+ event.initUIEvent('touchstart', true, true, window);
+ touchpadRange.dispatchEvent(event);
+
+ event = document.createEvent('UIEvent');
+ event.initUIEvent('touchmove', true, true, window);
+ touchpadRange.dispatchEvent(event);
+
+ touchpadRange.value = 1;
+
+ event = document.createEvent('UIEvent');
+ event.initUIEvent('touchend', true, true, window);
+ touchpadRange.dispatchEvent(event);
+
+ // touchcancel should also trigger the handler, since it
+ // changes the slider position.
+ this.mockHandler.expects(once()).setIntegerPref([
+ 'settings.touchpad.sensitivity2', 2]);
+
+ event = document.createEvent('UIEvent');
+ event.initUIEvent('touchstart', true, true, window);
+ touchpadRange.dispatchEvent(event);
+
+ touchpadRange.value = 2;
+
+ event = document.createEvent('UIEvent');
+ event.initUIEvent('touchcancel', true, true, window);
+ touchpadRange.dispatchEvent(event);
+
+ testDone();
+});
+GEN('#endif'); // defined(OS_CHROMEOS)
+
/**
* TestFixture for OptionsPage WebUI testing including tab history and support
* for preference manipulation. If you don't need the features in the C++
« no previous file with comments | « chrome/browser/resources/options/pref_ui.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698