blob: 41e0265a918ea597d2fd8f1cc5e6a87c454d3122 [file] [log] [blame]
/*
* Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
* for details. All rights reserved. Use of this source code is governed by a
* BSD-style license that can be found in the LICENSE file.
*/
/**
* @description
*/
import "dart:html";
import "../../testcommon.dart";
import "../../../Utils/async_utils.dart";
main() {
document.body.setInnerHtml('''
<p>This tests that dispatching a keyboard event created via dart does
not crash.</p>
<p id="results"></p>
<input id="1">
''', treeSanitizer: new NullTreeSanitizer());
var evt = new KeyboardEvent("keydown", canBubble:true, cancelable:true, view:window,
keyLocation:0, ctrlKey:false, altKey:false, shiftKey:false, metaKey:false,
altGraphKey:false);
var elt = document.getElementById("1");
elt.focus();
elt.dispatchEvent(evt);
document.getElementById("results").text = "PASS";
}