OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 cr.define('settings_rtl_tests', function() { |
| 6 /** @implements {settings.DirectionDelegate} */ |
| 7 function TestDirectionDelegate(isRtl) { |
| 8 /** @override */ |
| 9 this.isRtl = function() { return isRtl; }; |
| 10 } |
| 11 |
| 12 function registerDrawerPanelTests() { |
| 13 suite('settings drawer panel RTL tests', function() { |
| 14 test('test i18n processing flips drawer panel', function() { |
| 15 var ui = document.createElement('settings-ui'); |
| 16 assertFalse(ui.$.panel.rightDrawer); |
| 17 |
| 18 ui.directionDelegate = new TestDirectionDelegate(true /* isRtl */); |
| 19 assertTrue(ui.$.panel.rightDrawer); |
| 20 |
| 21 ui.directionDelegate = new TestDirectionDelegate(false /* isRtl */); |
| 22 assertFalse(ui.$.panel.rightDrawer); |
| 23 }); |
| 24 }); |
| 25 } |
| 26 |
| 27 return { |
| 28 registerDrawerPanelTests: registerDrawerPanelTests, |
| 29 }; |
| 30 }); |
OLD | NEW |