Adds tests for Chrome logging and refactors accordingly.