blob: d53159e8db8c6d3e23f7634051ad63400d0893d3 [file] [log] [blame]
<!doctype html>
<html>
<head>
<script src="../../http/tests/inspector/resources/inspector-test.js"></script>
<script>
function test()
{
let suite = InspectorTest.createAsyncSuite("Console.clearMessages");
suite.addTestCase({
name: "CallClearMessages",
description: "Calling the Console.clearMessages command should trigger Console.messagesCleared.",
test(resolve, reject) {
ConsoleAgent.clearMessages();
WI.consoleManager.awaitEvent(WI.ConsoleManager.Event.MessageAdded)
.then((event) => {
InspectorTest.assert(false, "MessageAdded event should not fire.");
})
.then(reject, reject);
WI.consoleManager.awaitEvent(WI.ConsoleManager.Event.Cleared)
.then((event) => {
InspectorTest.expectThat(event, "Cleared event should fire.");
})
.then(resolve, reject);
}
});
suite.runTestCasesAndFinish();
}
</script>
</head>
<body onload="runTest()">
<p>Test for the Console.clearMessages command.</p>
</body>
</html>