blob: 2000dd099b3c2b905dfac153fdb26e427239a7c3 [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<title>cr.ui.Command test</title>
</head>
<body>
<command></command>
<script>
function testCommandDefaultPrevented() {
var calls = 0;
document.addEventListener('canExecute', function(e) {
++calls;
assertFalse(e.defaultPrevented);
e.canExecute = true;
assertTrue(e.defaultPrevented);
});
cr.ui.decorate('command', cr.ui.Command);
document.querySelector('command').canExecuteChange();
assertEquals(1, calls);
}
</script>
</body>
</html>