<!DOCTYPE html>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<pre id="sample" contenteditable="true">
foo
<div contenteditable="false">bar
</div>
</pre>
<div id="log"></div>
<script>
test(function() {
var container = document.getElementById('sample');
var range = document.createRange()
range.setEndAfter(container.lastChild);
window.getSelection().addRange(range);
document.execCommand('formatblock', false, '<h1>');
}, 'formatblock');
</script>