Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/editing/execCommand/queryCommandState-04-mac.html |
| diff --git a/third_party/WebKit/LayoutTests/editing/execCommand/queryCommandState-04-mac.html b/third_party/WebKit/LayoutTests/editing/execCommand/queryCommandState-04-mac.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..d67112968ab9ec2357eeb44ee52d3ed859c0e2ea |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/editing/execCommand/queryCommandState-04-mac.html |
| @@ -0,0 +1,44 @@ |
| +<!doctype HTML> |
|
yosin_UTC9
2016/05/30 01:28:11
Could you integrate this test into CommandState-04
|
| +<script src="../../resources/testharness.js"></script> |
| +<script src="../../resources/testharnessreport.js"></script> |
| +<div contenteditable="true"> |
| +<sub><i>1. Make text subscript and italic</i></sub> |
| +<sup><i>2. Make text superscript and italic</i></sup> |
| +</div> |
| +<div id="log"></div> |
| +<script> |
| +function test_sub(platform) { |
| + internals.settings.setEditingBehavior(platform); |
| + |
| + document.getSelection().removeAllRanges(); |
| + var range = document.createRange(); |
| + range.selectNode(document.querySelector('i')); |
| + document.getSelection().addRange(range); |
| + |
| + assert_equals(document.queryCommandState('subscript'), true); |
| +}; |
| + |
| +function test_sup(platform) { |
| + internals.settings.setEditingBehavior(platform); |
| + |
| + document.getSelection().removeAllRanges(); |
| + var range = document.createRange(); |
| + range.selectNode(document.querySelectorAll('i')[1]); |
| + document.getSelection().addRange(range); |
| + |
| + assert_equals(document.queryCommandState('superscript'), true); |
| +} |
| + |
| +if (window.internals) { |
| + test(function(){test_sub('win')}, 'Windows behavior'); |
| + test(function(){test_sup('win')}, 'Windows behavior'); |
| + test(function(){test_sub('mac')}, 'Mac behavior'); |
| + test(function(){test_sup('mac')}, 'Mac behavior'); |
| + |
| + var isMac = navigator.platform.indexOf('Mac') == 0; |
| + if (isMac) { |
| + test(function(){test_sub('mac')}, 'Mac behavior on Mac'); |
| + test(function(){test_sup('mac')}, 'Mac behavior on Mac'); |
| + } |
| +} |
| +</script> |