chromium/third_party/blink/renderer/core/testing/data/selection_readonly.html

<input id="readonly-input" type="text" value="This text should be selected." readonly>
<script>
var input = document.getElementById('readonly-input');
input.select();
</script>