Index: third_party/WebKit/LayoutTests/editing/execCommand/queryCommandState-list.html |
diff --git a/third_party/WebKit/LayoutTests/editing/execCommand/queryCommandState-list.html b/third_party/WebKit/LayoutTests/editing/execCommand/queryCommandState-list.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..2d43a9454a509a12d0bc64a606d1f36915911888 |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/editing/execCommand/queryCommandState-list.html |
@@ -0,0 +1,42 @@ |
+<!doctype HTML> |
+<script src="../../resources/testharness.js"></script> |
+<script src="../../resources/testharnessreport.js"></script> |
+<div> |
+ <ol> |
+ <li>First list item |
+ <ul> |
+ <li id="ul_list_item">Nested list item</li> |
+ </ul> |
+ </li> |
+ </ol> |
+</div> |
+<div> |
+ <ul> |
+ <li>First list item |
+ <ol> |
+ <li id="ol_list_item">Nested list item</li> |
+ </ol> |
+ </li> |
+ </ul> |
+</div> |
+<script> |
+test(function() { |
+ document.getSelection().removeAllRanges(); |
+ var range = document.createRange(); |
+ range.selectNode(document.getElementById('ul_list_item')); |
+ document.getSelection().addRange(range); |
+ |
+ assert_equals(document.queryCommandState('insertOrderedList'), false); |
+ assert_equals(document.queryCommandState('insertUnorderedList'), true); |
+}, 'run queryCommandState() on the unordered list item'); |
+ |
+test(function() { |
+ document.getSelection().removeAllRanges(); |
+ var range = document.createRange(); |
+ range.selectNode(document.getElementById('ol_list_item')); |
+ document.getSelection().addRange(range); |
+ |
+ assert_equals(document.queryCommandState('insertOrderedList'), true); |
+ assert_equals(document.queryCommandState('insertUnorderedList'), false); |
+}, 'run queryCommandState() on the ordered list item'); |
+</script> |