Index: chrome/test/data/webui/settings/rtl_tests.js |
diff --git a/chrome/test/data/webui/settings/rtl_tests.js b/chrome/test/data/webui/settings/rtl_tests.js |
new file mode 100644 |
index 0000000000000000000000000000000000000000..637ab2102765d02e01976a3a420d9530314e43ae |
--- /dev/null |
+++ b/chrome/test/data/webui/settings/rtl_tests.js |
@@ -0,0 +1,33 @@ |
+// Copyright 2016 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+cr.define('settings_rtl_tests', function() { |
+ /** @implements {settings.DirectionDelegate} */ |
+ function TestDirectionDelegate(isRtl) { |
+ /** @override */ |
+ this.isRtl = function() { return isRtl; }; |
+ } |
+ |
+ function registerDrawerPanelTests() { |
+ suite('settings drawer panel RTL tests', function() { |
+ test('test i18n processing flips drawer panel', function() { |
+ var ui = document.createElement('settings-ui'); |
+ document.body.appendChild(ui); |
+ Polymer.dom.flush(); |
michaelpg
2016/02/17 21:14:04
not sure why the flush is necessary, does the pane
Dan Beam
2016/02/18 00:16:15
it readies ui's local DOM
Dan Beam
2016/02/18 00:16:45
er, it theory it did: actually isn't necessary (an
michaelpg
2016/02/18 00:23:18
just to be pedantic, in theory it doesn't, either:
|
+ |
+ assertFalse(ui.$.panel.rightDrawer); |
+ |
+ ui.directionDelegate = new TestDirectionDelegate(true /* isRtl */); |
+ assertTrue(ui.$.panel.rightDrawer); |
+ |
+ ui.directionDelegate = new TestDirectionDelegate(false /* isRtl */); |
+ assertFalse(ui.$.panel.rightDrawer); |
+ }); |
+ }); |
+ } |
+ |
+ return { |
+ registerDrawerPanelTests: registerDrawerPanelTests, |
+ }; |
+}); |