Index: third_party/WebKit/LayoutTests/editing/style/justify-left-crash.html |
diff --git a/third_party/WebKit/LayoutTests/editing/style/justify-left-crash.html b/third_party/WebKit/LayoutTests/editing/style/justify-left-crash.html |
index 02ae756f5a4fc06d358474c25869431c93348c9d..18054a22032dee0a84033df3d975da66dee694ef 100644 |
--- a/third_party/WebKit/LayoutTests/editing/style/justify-left-crash.html |
+++ b/third_party/WebKit/LayoutTests/editing/style/justify-left-crash.html |
@@ -1,20 +1,30 @@ |
-<!DOCTYPE html> |
+<!doctype html> |
<html hidden> |
<head> |
+<script src="../../resources/testharness.js"></script> |
+<script src="../../resources/testharnessreport.js"></script> |
<style> |
html, head, style { |
display: block; |
} |
</style> |
</head> |
+<body> |
+<div id="sample">foo</div> |
<script> |
- document.designMode = "on"; |
- document.execCommand("selectAll"); |
- document.execCommand("italic"); |
- document.execCommand("justifyLeft"); |
- document.documentElement.removeAttribute("hidden"); |
+ document.designMode = 'on'; |
+ document.execCommand('selectAll'); |
+ document.execCommand('italic'); |
+ document.execCommand('justifyLeft'); |
+ document.documentElement.removeAttribute('hidden'); |
+ |
+ test(() => { |
+ var sample = document.getElementById('sample'); |
+ assert_equals(sample.innerHTML, '<i>foo</i>'); |
+ // TODO(yosin): Once we do lazy visible position canonicalization, |
+ // we should have a caret. |
+ assert_equals(getSelection().rangeCount, 0); |
+ }, 'This is a crash test.'); |
</script> |
-<body> |
-This test passes if it does not crash. |
</body> |
</html> |