Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5551)

Unified Diff: chrome/browser/resources/google_now/common_test_util.js

Issue 145353010: Gate console.log output in Google Now (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: CR Feedback Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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;
+
+/**
+ * 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.
« no previous file with comments | « chrome/browser/resources/google_now/cards_unittest.gtestjs ('k') | chrome/browser/resources/google_now/utility.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698