blob: 3e0b80e9c941283af5aa71c8d83fdb2af3ee1f45 [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.logManager.awaitEvent(WI.LogManager.Event.MessageAdded)
.then((event) => {
InspectorTest.assert(false, "MessageAdded event should not fire.");
})
.then(reject, reject);
WI.logManager.awaitEvent(WI.LogManager.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>