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/test/test_webkit_platform_support.h" | 15 #include "content/test/test_webkit_platform_support.h" |
16 #include "third_party/WebKit/public/web/WebCache.h" | 16 #include "third_party/WebKit/public/web/WebCache.h" |
17 #include "third_party/WebKit/public/web/WebKit.h" | 17 #include "third_party/WebKit/public/web/WebKit.h" |
18 #include "third_party/WebKit/public/web/WebRuntimeFeatures.h" | 18 #include "third_party/WebKit/public/web/WebRuntimeFeatures.h" |
19 #include "ui/base/resource/resource_bundle.h" | 19 #include "ui/base/resource/resource_bundle.h" |
20 #include "url/url_util.h" | 20 #include "url/url_util.h" |
| 21 #include "webkit/common/user_agent/user_agent.h" |
| 22 #include "webkit/common/user_agent/user_agent_util.h" |
21 | 23 |
22 #if defined(OS_ANDROID) | 24 #if defined(OS_ANDROID) |
23 #include "base/android/jni_android.h" | 25 #include "base/android/jni_android.h" |
24 #include "net/android/network_library.h" | 26 #include "net/android/network_library.h" |
25 #endif | 27 #endif |
26 | 28 |
27 #if defined(OS_MACOSX) | 29 #if defined(OS_MACOSX) |
28 #include "base/test/mock_chrome_application_mac.h" | 30 #include "base/test/mock_chrome_application_mac.h" |
29 #endif | 31 #endif |
30 | 32 |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 | 103 |
102 #if defined(OS_MACOSX) | 104 #if defined(OS_MACOSX) |
103 mock_cr_app::RegisterMockCrApp(); | 105 mock_cr_app::RegisterMockCrApp(); |
104 #endif | 106 #endif |
105 | 107 |
106 // Explicitly initialize the GURL library before spawning any threads. | 108 // Explicitly initialize the GURL library before spawning any threads. |
107 // 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 |
108 // at same time. | 110 // at same time. |
109 url_util::Initialize(); | 111 url_util::Initialize(); |
110 test_environment = new TestEnvironment; | 112 test_environment = new TestEnvironment; |
| 113 webkit_glue::SetUserAgent(webkit_glue::BuildUserAgentFromProduct( |
| 114 "DumpRenderTree/0.0.0.0")); |
111 } | 115 } |
112 | 116 |
113 void TearDownTestEnvironment() { | 117 void TearDownTestEnvironment() { |
114 // Flush any remaining messages before we kill ourselves. | 118 // Flush any remaining messages before we kill ourselves. |
115 // http://code.google.com/p/chromium/issues/detail?id=9500 | 119 // http://code.google.com/p/chromium/issues/detail?id=9500 |
116 base::RunLoop().RunUntilIdle(); | 120 base::RunLoop().RunUntilIdle(); |
117 | 121 |
118 if (RunningOnValgrind()) | 122 if (RunningOnValgrind()) |
119 blink::WebCache::clear(); | 123 blink::WebCache::clear(); |
120 delete test_environment; | 124 delete test_environment; |
121 test_environment = NULL; | 125 test_environment = NULL; |
122 } | 126 } |
123 | 127 |
124 } // namespace content | 128 } // namespace content |
OLD | NEW |