38 lines
1.1 KiB
HTML
38 lines
1.1 KiB
HTML
<!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>
|