Chromium Code Reviews| Index: chrome/browser/resources/google_now/common_test_util.js |
| diff --git a/chrome/browser/resources/google_now/common_test_util.js b/chrome/browser/resources/google_now/common_test_util.js |
| index 9a4215b304206654098fd7ac9b8c735377960c9c..28c4b930a67f8a69480d53e58a520342d65cd8a2 100644 |
| --- a/chrome/browser/resources/google_now/common_test_util.js |
| +++ b/chrome/browser/resources/google_now/common_test_util.js |
| @@ -4,6 +4,23 @@ |
| // Common test utilities. |
| +/** |
| + * Allows console.log output. |
| + */ |
| +var showConsoleLogOutput = false; |
|
vadimt
2014/01/28 21:07:12
showConsoleLogOutput seems to be a constant set to
robliao
2014/01/28 21:56:02
One of the main complaints is that the unit tests
|
| + |
| +/** |
| + * Conditionally allow console.log output based off of showConsoleLogOutput. |
| + */ |
| +console.log = function() { |
| + var originalConsoleLog = console.log; |
| + return function() { |
| + if (showConsoleLogOutput) { |
| + originalConsoleLog.apply(console, arguments); |
| + } |
| + }; |
| +}(); |
| + |
| function emptyMock() {} |
| // Container for event handlers added by mocked 'addListener' functions. |