| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/test/webkit_support.h" | 5 #include "content/test/webkit_support.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| 11 #include "base/path_service.h" | 11 #include "base/path_service.h" |
| 12 #include "base/run_loop.h" | 12 #include "base/run_loop.h" |
| 13 #include "base/strings/string_tokenizer.h" | 13 #include "base/strings/string_tokenizer.h" |
| 14 #include "content/public/common/content_switches.h" | 14 #include "content/public/common/content_switches.h" |
| 15 #include "content/public/common/user_agent.h" |
| 16 #include "content/public/common/user_agent_util.h" |
| 15 #include "content/test/test_webkit_platform_support.h" | 17 #include "content/test/test_webkit_platform_support.h" |
| 16 #include "third_party/WebKit/public/web/WebCache.h" | 18 #include "third_party/WebKit/public/web/WebCache.h" |
| 17 #include "third_party/WebKit/public/web/WebKit.h" | 19 #include "third_party/WebKit/public/web/WebKit.h" |
| 18 #include "third_party/WebKit/public/web/WebRuntimeFeatures.h" | 20 #include "third_party/WebKit/public/web/WebRuntimeFeatures.h" |
| 19 #include "ui/base/resource/resource_bundle.h" | 21 #include "ui/base/resource/resource_bundle.h" |
| 20 #include "url/url_util.h" | 22 #include "url/url_util.h" |
| 21 #include "webkit/common/user_agent/user_agent.h" | |
| 22 #include "webkit/common/user_agent/user_agent_util.h" | |
| 23 | 23 |
| 24 #if defined(OS_ANDROID) | 24 #if defined(OS_ANDROID) |
| 25 #include "base/android/jni_android.h" | 25 #include "base/android/jni_android.h" |
| 26 #include "net/android/network_library.h" | 26 #include "net/android/network_library.h" |
| 27 #endif | 27 #endif |
| 28 | 28 |
| 29 #if defined(OS_MACOSX) | 29 #if defined(OS_MACOSX) |
| 30 #include "base/test/mock_chrome_application_mac.h" | 30 #include "base/test/mock_chrome_application_mac.h" |
| 31 #endif | 31 #endif |
| 32 | 32 |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 | 103 |
| 104 #if defined(OS_MACOSX) | 104 #if defined(OS_MACOSX) |
| 105 mock_cr_app::RegisterMockCrApp(); | 105 mock_cr_app::RegisterMockCrApp(); |
| 106 #endif | 106 #endif |
| 107 | 107 |
| 108 // Explicitly initialize the GURL library before spawning any threads. | 108 // Explicitly initialize the GURL library before spawning any threads. |
| 109 // Otherwise crash may happend when different threads try to create a GURL | 109 // Otherwise crash may happend when different threads try to create a GURL |
| 110 // at same time. | 110 // at same time. |
| 111 url_util::Initialize(); | 111 url_util::Initialize(); |
| 112 test_environment = new TestEnvironment; | 112 test_environment = new TestEnvironment; |
| 113 webkit_glue::SetUserAgent(webkit_glue::BuildUserAgentFromProduct( | 113 SetUserAgent(BuildUserAgentFromProduct("DumpRenderTree/0.0.0.0"), false); |
| 114 "DumpRenderTree/0.0.0.0"), false); | |
| 115 } | 114 } |
| 116 | 115 |
| 117 void TearDownTestEnvironment() { | 116 void TearDownTestEnvironment() { |
| 118 // Flush any remaining messages before we kill ourselves. | 117 // Flush any remaining messages before we kill ourselves. |
| 119 // http://code.google.com/p/chromium/issues/detail?id=9500 | 118 // http://code.google.com/p/chromium/issues/detail?id=9500 |
| 120 base::RunLoop().RunUntilIdle(); | 119 base::RunLoop().RunUntilIdle(); |
| 121 | 120 |
| 122 if (RunningOnValgrind()) | 121 if (RunningOnValgrind()) |
| 123 blink::WebCache::clear(); | 122 blink::WebCache::clear(); |
| 124 delete test_environment; | 123 delete test_environment; |
| 125 test_environment = NULL; | 124 test_environment = NULL; |
| 126 } | 125 } |
| 127 | 126 |
| 128 } // namespace content | 127 } // namespace content |
| OLD | NEW |