| <!doctype html><!-- webkit-test-runner [ dumpJSConsoleLogInStdErr=true ] --> |
| <html> |
| <head> |
| <script src="../../http/tests/inspector/resources/inspector-test.js"></script> |
| <script> |
| |
| let video; |
| function setup() |
| { |
| // 250ms of silence in 16-bit signed little endian WAV format. |
| let data = "UklGRmQfAABXQVZFZm10IBAAAAABAAEAgD4AAAB9AAACABAAZGF0YUAfAAAAAP//AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//wAAAAAAAP//AAAAAAAAAAAAAAAAAQAAAP//AAAAAAAAAAAAAAAAAAAAAAAAAAABAP//AAAAAAAAAAABAP//AAAAAAAA/////wAAAQAAAAAAAAAAAAAAAQD//wAAAAD//wAAAQD/////AAAAAAEA/////wAAAAAAAP//AAD//wAAAQAAAP//AAD//wAAAAABAAEAAAAAAAAAAAAAAAAAAAAAAAAA//8AAAAAAAAAAAAAAAAAAAAA//8AAAAAAAAAAP//AAAAAP//AAD//wAAAAAAAAAAAAAAAP//AAABAAAAAAAAAAAAAAD/////AAAAAAAAAAAAAAEAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAEAAAAAAAAAAAD//wAA//8AAAAAAAAAAAAAAAAAAAEA//8AAAEAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAA/////wAAAAAAAP//AAAAAAAAAAAAAAAAAAAAAAAAAAABAAEAAAAAAP//AQAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//8AAAAAAAABAAAA//8AAAAAAAAAAAAAAAD//wAAAQAAAAAA//8AAAAAAAAAAAAAAQAAAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//8AAAAAAQAAAAEAAAABAAEAAAAAAAAAAAAAAAAA//8AAAAAAAAAAAAAAAD//wAAAAAAAP//AAAAAAAA//8AAAAAAQAAAP//AAAB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AAAAAAAAAAAAAAAAAAAEA//8AAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAAAAP//AAD//wAAAAD//wAAAAAAAAAAAAAAAAAAAAAAAP//AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAQAAAAAAAAAAAAEA//8AAAAAAAABAAAA//8BAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAABAAAAAAD//wAAAAAAAAAAAAAAAAAA//8AAAAAAQAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAD//wAAAAD//wAAAAABAAAAAAAAAAAAAAAAAAAAAAABAAAAAAABAAAAAAABAAAAAAAAAAEAAAD//wAAAAAAAAAA//8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//8AAAAAAAD//wAAAAAAAP//AQAAAAAA/////wAAAAAAAAAA//8AAAAAAAAAAAAAAAAAAAEAAAAAAP//AQABAAAAAQABAAAA//8AAAAAAAAAAAEAAQAAAAEAAAAAAAAA//8AAAAAAAAAAAAAAAD//wAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAP//AAAAAAAA//8AAAAAAAD//wEAAAAAAAAAAAAAAP////8AAAAAAAABAAAAAAAAAAAAAAAAAAAAAAABAP//AAAAAAAAAQAAAP////8AAAEAAAAAAAAAAAABAAAAAAABAAAAAAAAAAEAAQD//wEAAQAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAD//wAAAAAAAAAAAAD//wAAAAAAAAAAAAAAAAAA//8AAAAAAAAAAAEAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAQAAAAAA//8BAAAAAAAAAAAAAAAAAA=="; |
| video = document.getElementsByTagName('video')[0]; |
| video.src = "data:audio/wav;base64," + data; |
| runTest(); |
| } |
| |
| function play() |
| { |
| video.currentTime = 0; |
| video.play().catch((err) => { }); |
| TestPage.dispatchEventToFrontend('PlayEvent', {count: 1}); |
| } |
| |
| function pause() |
| { |
| video.pause(); |
| TestPage.dispatchEventToFrontend('PauseEvent', {count: 1}); |
| } |
| |
| function setupTrackTest() |
| { |
| let track = document.createElement('track'); |
| track.src = 'data:text/vtt,'+encodeURIComponent('WEBVTT\n\n00:00:00.000 --> 00:00:00.001\nCue 1\n\n'+ |
| '00:00:00.000 --> 00:00:00.001 line:0\nCue 2\n\n'+ |
| '00:00:00.000 --> 00:00:00.001 line:0%\nCue 3'); |
| track.track.mode = 'showing'; |
| video.appendChild(track); |
| } |
| |
| function test() |
| { |
| let suite = InspectorTest.createAsyncSuite("Console.Logging"); |
| |
| suite.addTestCase({ |
| name: "Console.Logging.BasicProperties", |
| description: "Check initial properties.", |
| test(resolve, reject) { |
| ConsoleAgent.getLoggingChannels((error, channels) => { |
| if (error) { |
| InspectorTest.fail(`ConsoleAgent.getLoggingChannels() failed with error ${error}`); |
| reject(); |
| } |
| |
| InspectorTest.expectThat(WI.ConsoleManager.supportsLogChannels(), "Log channels should be supported."); |
| InspectorTest.expectThat(WI.consoleManager.customLoggingChannels, "Has WI.consoleManager.customLoggingChannels."); |
| InspectorTest.expectThat(WI.consoleManager.customLoggingChannels.length, "WI.consoleManager.customLoggingChannels is not empty."); |
| |
| let sources = Object.values(WI.ConsoleMessage.MessageSource); |
| WI.consoleManager.customLoggingChannels.forEach((channel) => { |
| InspectorTest.expectThat(sources.includes(channel.source), "Log channel has known source."); |
| InspectorTest.expectEqual(channel.level, WI.LoggingChannel.Level.Off, "Log channel disabled by default."); |
| }); |
| |
| resolve(); |
| }); |
| } |
| }); |
| |
| suite.addTestCase({ |
| name: "Console.Logging.InvalidLevel", |
| description: "setLoggingChannelLevel should reject invalid log channel level.", |
| test(resolve, reject) { |
| ConsoleAgent.setLoggingChannelLevel(WI.ConsoleMessage.MessageSource.Media, "DOES_NOT_EXIST", (error) => { |
| if (!error) { |
| InspectorTest.fail("Should have an error with invalid level."); |
| reject(); |
| return; |
| } |
| InspectorTest.pass(error); |
| resolve(); |
| }); |
| } |
| }); |
| |
| suite.addTestCase({ |
| name: "Console.Logging.NoLogging", |
| description: "No <video> logging when disabled.", |
| test(resolve, reject) { |
| let channel = WI.consoleManager.customLoggingChannels.find(channel => channel.source === WI.ConsoleMessage.MessageSource.Media); |
| InspectorTest.expectThat(channel.level === WI.LoggingChannel.Level.Off, "Media logging disabled."); |
| |
| let logListener = WI.consoleManager.addEventListener(WI.ConsoleManager.Event.MessageAdded, (event) => { |
| InspectorTest.fail("Nothing should be logged to the console."); |
| reject(); |
| }); |
| |
| InspectorTest.awaitEvent("PlayEvent").then((event) => { |
| InspectorTest.log("Started Playing"); |
| }); |
| |
| InspectorTest.awaitEvent("PauseEvent").then((event) => { |
| InspectorTest.log("Stopped Playing"); |
| WI.consoleManager.removeEventListener(WI.ConsoleManager.Event.MessageAdded, logListener, null); |
| }).then(resolve, reject); |
| |
| InspectorTest.evaluateInPage(`play()`); |
| InspectorTest.evaluateInPage(`pause()`); |
| } |
| }); |
| |
| |
| suite.addTestCase({ |
| name: "Console.Logging.MediaLogging", |
| description: "<video> logging when enabled.", |
| test(resolve, reject) { |
| ConsoleAgent.clearMessages(); |
| |
| let channel = WI.consoleManager.customLoggingChannels.find(channel => channel.source === WI.ConsoleMessage.MessageSource.Media); |
| InspectorTest.expectThat(channel.level === WI.LoggingChannel.Level.Off, "Media logging disabled."); |
| |
| ConsoleAgent.setLoggingChannelLevel(channel.source, WI.LoggingChannel.Level.Basic) |
| ConsoleAgent.getLoggingChannels((error, channels) => { |
| if (error) { |
| InspectorTest.fail(`ConsoleAgent.getLoggingChannels() failed with error ${error}`); |
| reject(); |
| } |
| |
| let mediaChannel = channels.find(channel => channel.source === WI.ConsoleMessage.MessageSource.Media); |
| InspectorTest.expectThat(mediaChannel.level === WI.LoggingChannel.Level.Basic, "Media logging has been enabled."); |
| |
| let logListener = WI.consoleManager.addEventListener(WI.ConsoleManager.Event.MessageAdded, (event) => { |
| let message = event.data.message; |
| InspectorTest.assert(message instanceof WI.ConsoleMessage); |
| InspectorTest.expectThat(message.source === WI.ConsoleMessage.MessageSource.Media, "Media log message should have source 'media'."); |
| WI.consoleManager.removeEventListener(WI.ConsoleManager.Event.MessageAdded, logListener, null); |
| ConsoleAgent.setLoggingChannelLevel(mediaChannel.source, WI.LoggingChannel.Level.Off) |
| resolve(); |
| }); |
| |
| InspectorTest.evaluateInPage(`play()`); |
| InspectorTest.evaluateInPage(`pause()`); |
| }) |
| } |
| }); |
| |
| suite.addTestCase({ |
| name: "Console.Logging.LogAsJSONWithoutRepeat", |
| description: "JSON messages logged correctly.", |
| test(resolve, reject) { |
| ConsoleAgent.clearMessages(); |
| |
| let channel = WI.consoleManager.customLoggingChannels.find(channel => channel.source === WI.ConsoleMessage.MessageSource.Media); |
| InspectorTest.expectThat(channel.level === WI.LoggingChannel.Level.Off, "Media logging disabled."); |
| |
| ConsoleAgent.setLoggingChannelLevel(channel.source, WI.LoggingChannel.Level.Verbose) |
| ConsoleAgent.getLoggingChannels((error, channels) => { |
| if (error) { |
| InspectorTest.fail(`ConsoleAgent.getLoggingChannels() failed with error ${error}`); |
| reject(); |
| } |
| |
| let mediaChannel = channels.find(channel => channel.source === WI.ConsoleMessage.MessageSource.Media); |
| InspectorTest.expectThat(mediaChannel.level === WI.LoggingChannel.Level.Verbose, "Verbose media logging has been enabled."); |
| |
| let messageCount = 0; |
| let logListener = WI.consoleManager.addEventListener(WI.ConsoleManager.Event.MessageAdded, (event) => { |
| let message = event.data.message; |
| InspectorTest.assert(message instanceof WI.ConsoleMessage); |
| InspectorTest.assert(message.source === WI.ConsoleMessage.MessageSource.Media); |
| |
| if (message.messageText.includes("LoadableTextTrack::newCuesAvailable")) { |
| InspectorTest.expectThat(message.parameters.length > 1, "Message logged as JSON."); |
| InspectorTest.expectThat(message.repeatCount === 1, "ConsoleMessage repeatCount is 1."); |
| if (++messageCount === 3) { |
| InspectorTest.log("Received three JSON messages."); |
| WI.consoleManager.removeEventListener(WI.ConsoleManager.Event.MessageAdded, logListener, null); |
| ConsoleAgent.setLoggingChannelLevel(mediaChannel.source, WI.LoggingChannel.Level.Off) |
| resolve(); |
| } |
| } |
| }); |
| |
| InspectorTest.evaluateInPage(`setupTrackTest()`); |
| }) |
| } |
| }); |
| |
| suite.runTestCasesAndFinish(); |
| } |
| |
| </script> |
| </head> |
| <body onload="setup()"> |
| <p>Test WebKit logging configuration and console display.</p> |
| <video width=320 height=240 controls></video> |
| </body> |
| </html> |