X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fcontent%2Ftest%2Fwebkit_support.cc;h=50342eb3ed74e3978827abae5956e57a1e157935;hb=ff3e2503a20db9193d323c1d19c38c68004dec4a;hp=73bfe0045d45bc641af3e304f43f676bb481bbc5;hpb=7338fba38ba696536d1cc9d389afd716a6ab2fe6;p=platform%2Fframework%2Fweb%2Fcrosswalk.git diff --git a/src/content/test/webkit_support.cc b/src/content/test/webkit_support.cc index 73bfe00..50342eb 100644 --- a/src/content/test/webkit_support.cc +++ b/src/content/test/webkit_support.cc @@ -4,9 +4,14 @@ #include "content/test/webkit_support.h" +#include + +#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);