Chromium Code Reviews| 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" | |
| 23 | 21 |
| 24 #if defined(OS_ANDROID) | 22 #if defined(OS_ANDROID) |
| 25 #include "base/android/jni_android.h" | 23 #include "base/android/jni_android.h" |
| 26 #include "net/android/network_library.h" | 24 #include "net/android/network_library.h" |
| 27 #endif | 25 #endif |
| 28 | 26 |
| 29 #if defined(OS_MACOSX) | 27 #if defined(OS_MACOSX) |
| 30 #include "base/test/mock_chrome_application_mac.h" | 28 #include "base/test/mock_chrome_application_mac.h" |
| 31 #endif | 29 #endif |
| 32 | 30 |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 103 | 101 |
| 104 #if defined(OS_MACOSX) | 102 #if defined(OS_MACOSX) |
| 105 mock_cr_app::RegisterMockCrApp(); | 103 mock_cr_app::RegisterMockCrApp(); |
| 106 #endif | 104 #endif |
| 107 | 105 |
| 108 // Explicitly initialize the GURL library before spawning any threads. | 106 // Explicitly initialize the GURL library before spawning any threads. |
| 109 // Otherwise crash may happend when different threads try to create a GURL | 107 // Otherwise crash may happend when different threads try to create a GURL |
| 110 // at same time. | 108 // at same time. |
| 111 url_util::Initialize(); | 109 url_util::Initialize(); |
| 112 test_environment = new TestEnvironment; | 110 test_environment = new TestEnvironment; |
| 113 webkit_glue::SetUserAgent(webkit_glue::BuildUserAgentFromProduct( | |
|
tfarina
2014/03/07 22:06:07
this would be my only concern on //content changes
| |
| 114 "DumpRenderTree/0.0.0.0")); | |
|
scottmg
2014/03/07 21:19:48
Is this going to break blink tests?
jam
2014/03/07 21:34:55
I had searched for this string but didn't find it
jam
2014/03/07 23:13:03
looks like this did break webkit_unit_tests, but t
| |
| 115 } | 111 } |
| 116 | 112 |
| 117 void TearDownTestEnvironment() { | 113 void TearDownTestEnvironment() { |
| 118 // Flush any remaining messages before we kill ourselves. | 114 // Flush any remaining messages before we kill ourselves. |
| 119 // http://code.google.com/p/chromium/issues/detail?id=9500 | 115 // http://code.google.com/p/chromium/issues/detail?id=9500 |
| 120 base::RunLoop().RunUntilIdle(); | 116 base::RunLoop().RunUntilIdle(); |
| 121 | 117 |
| 122 if (RunningOnValgrind()) | 118 if (RunningOnValgrind()) |
| 123 blink::WebCache::clear(); | 119 blink::WebCache::clear(); |
| 124 delete test_environment; | 120 delete test_environment; |
| 125 test_environment = NULL; | 121 test_environment = NULL; |
| 126 } | 122 } |
| 127 | 123 |
| 128 } // namespace content | 124 } // namespace content |
| OLD | NEW |