blob: ae4a8e6cc6b2e59fccf77cc3cc886b9f15ae34ad [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.
// @dart = 2.9
/// @assertion Event(String type, {bool canBubble: true, bool cancelable: true})
/// @description Checks that event of custom type can be constructed and that
/// canBubble and cancelable are true by default.
import "dart:html";
import "../../../Utils/expect.dart";
main() {
var ev = new Event('whatever');
var body = document.body;
var div = new DivElement();
body.append(div);
asyncStart();
// wait for bubbling
body.on['whatever'].listen((e) {
Expect.isTrue(e.cancelable);
asyncEnd();
});
div.dispatchEvent(ev); // initiate on inner div
}