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

Unified Diff: content/test/webkit_support.cc

Issue 139783014: Parse blink platform log channel command line args in webkit unit tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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
« no previous file with comments | « content/public/common/content_switches.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/test/webkit_support.cc
diff --git a/content/test/webkit_support.cc b/content/test/webkit_support.cc
index 73bfe0045d45bc641af3e304f43f676bb481bbc5..50342eb3ed74e3978827abae5956e57a1e157935 100644
--- a/content/test/webkit_support.cc
+++ b/content/test/webkit_support.cc
@@ -4,9 +4,14 @@
#include "content/test/webkit_support.h"
+#include <string>
+
+#include "base/command_line.h"
#include "base/message_loop/message_loop.h"
#include "base/path_service.h"
#include "base/run_loop.h"
+#include "base/strings/string_tokenizer.h"
+#include "content/public/common/content_switches.h"
#include "content/test/test_webkit_platform_support.h"
#include "third_party/WebKit/public/web/WebCache.h"
#include "third_party/WebKit/public/web/WebKit.h"
@@ -29,6 +34,20 @@ namespace content {
namespace {
+void EnableBlinkPlatformLogChannels(const std::string& channels) {
+ if (channels.empty())
+ return;
+ base::StringTokenizer t(channels, ", ");
+ while (t.GetNext())
+ blink::enableLogChannel(t.token().c_str());
+}
+
+void ParseBlinkCommandLineArgumentsForUnitTests() {
+ const CommandLine& command_line = *CommandLine::ForCurrentProcess();
+ EnableBlinkPlatformLogChannels(
+ command_line.GetSwitchValueASCII(switches::kBlinkPlatformLogChannels));
+}
+
class TestEnvironment {
public:
#if defined(OS_ANDROID)
@@ -72,6 +91,8 @@ TestEnvironment* test_environment;
} // namespace
void SetUpTestEnvironmentForUnitTests() {
+ ParseBlinkCommandLineArgumentsForUnitTests();
+
blink::WebRuntimeFeatures::enableStableFeatures(true);
blink::WebRuntimeFeatures::enableExperimentalFeatures(true);
blink::WebRuntimeFeatures::enableTestOnlyFeatures(true);
« no previous file with comments | « content/public/common/content_switches.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698