OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 GEN('#include "chrome/browser/ui/webui/options/options_browsertest.h"'); | 5 GEN('#include "chrome/browser/ui/webui/options/options_browsertest.h"'); |
6 | 6 |
7 /** @const */ var MANAGED_USERS_PREF = 'profile.managed_users'; | 7 /** @const */ var MANAGED_USERS_PREF = 'profile.managed_users'; |
8 | 8 |
9 /** | 9 /** |
10 * Wait for the method specified by |methodName|, on the |object| object, to be | 10 * Wait for the method specified by |methodName|, on the |object| object, to be |
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
304 assertFalse(overlay.classList.contains('transparent')); | 304 assertFalse(overlay.classList.contains('transparent')); |
305 expectEquals(numFrozenPages, frozenPages.length); | 305 expectEquals(numFrozenPages, frozenPages.length); |
306 testDone(); | 306 testDone(); |
307 }); | 307 }); |
308 | 308 |
309 OptionsPage.navigateToPage(overlayName); | 309 OptionsPage.navigateToPage(overlayName); |
310 var numFrozenPages = frozenPages.length; | 310 var numFrozenPages = frozenPages.length; |
311 expectGT(numFrozenPages, 0); | 311 expectGT(numFrozenPages, 0); |
312 }); | 312 }); |
313 | 313 |
| 314 GEN('#if defined(OS_CHROMEOS)'); |
| 315 // Verify that range inputs respond to touch events. Currently only Chrome OS |
| 316 // uses slider options. |
| 317 TEST_F('OptionsWebUITest', 'RangeInputHandlesTouchEvents', function() { |
| 318 this.mockHandler.expects(once()).setIntegerPref([ |
| 319 'settings.touchpad.sensitivity2', 1]); |
| 320 |
| 321 var touchpadRange = $('touchpad-sensitivity-range'); |
| 322 var event = document.createEvent('UIEvent'); |
| 323 event.initUIEvent('touchstart', true, true, window); |
| 324 touchpadRange.dispatchEvent(event); |
| 325 |
| 326 event = document.createEvent('UIEvent'); |
| 327 event.initUIEvent('touchmove', true, true, window); |
| 328 touchpadRange.dispatchEvent(event); |
| 329 |
| 330 touchpadRange.value = 1; |
| 331 |
| 332 event = document.createEvent('UIEvent'); |
| 333 event.initUIEvent('touchend', true, true, window); |
| 334 touchpadRange.dispatchEvent(event); |
| 335 |
| 336 // touchcancel should also trigger the handler, since it |
| 337 // changes the slider position. |
| 338 this.mockHandler.expects(once()).setIntegerPref([ |
| 339 'settings.touchpad.sensitivity2', 2]); |
| 340 |
| 341 event = document.createEvent('UIEvent'); |
| 342 event.initUIEvent('touchstart', true, true, window); |
| 343 touchpadRange.dispatchEvent(event); |
| 344 |
| 345 touchpadRange.value = 2; |
| 346 |
| 347 event = document.createEvent('UIEvent'); |
| 348 event.initUIEvent('touchcancel', true, true, window); |
| 349 touchpadRange.dispatchEvent(event); |
| 350 |
| 351 testDone(); |
| 352 }); |
| 353 GEN('#endif'); // defined(OS_CHROMEOS) |
| 354 |
314 /** | 355 /** |
315 * TestFixture for OptionsPage WebUI testing including tab history and support | 356 * TestFixture for OptionsPage WebUI testing including tab history and support |
316 * for preference manipulation. If you don't need the features in the C++ | 357 * for preference manipulation. If you don't need the features in the C++ |
317 * fixture, use the simpler OptionsWebUITest (above) instead. | 358 * fixture, use the simpler OptionsWebUITest (above) instead. |
318 * @extends {testing.Test} | 359 * @extends {testing.Test} |
319 * @constructor | 360 * @constructor |
320 */ | 361 */ |
321 function OptionsWebUIExtendedTest() {} | 362 function OptionsWebUIExtendedTest() {} |
322 | 363 |
323 OptionsWebUIExtendedTest.prototype = { | 364 OptionsWebUIExtendedTest.prototype = { |
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
792 __proto__: OptionsWebUIExtendedTest.prototype, | 833 __proto__: OptionsWebUIExtendedTest.prototype, |
793 | 834 |
794 /** @override */ | 835 /** @override */ |
795 browsePreload: 'chrome://settings-frame/nonexistantPage', | 836 browsePreload: 'chrome://settings-frame/nonexistantPage', |
796 }; | 837 }; |
797 | 838 |
798 TEST_F('OptionsWebUIRedirectTest', 'TestURL', function() { | 839 TEST_F('OptionsWebUIRedirectTest', 'TestURL', function() { |
799 assertEquals('chrome://settings-frame/', document.location.href); | 840 assertEquals('chrome://settings-frame/', document.location.href); |
800 this.verifyHistory_([''], testDone); | 841 this.verifyHistory_([''], testDone); |
801 }); | 842 }); |
OLD | NEW |