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" |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 webkit_glue::SetUserAgent(webkit_glue::BuildUserAgentFromProduct( |
114 "DumpRenderTree/0.0.0.0"), false); | 114 "DumpRenderTree/0.0.0.0")); |
115 } | 115 } |
116 | 116 |
117 void TearDownTestEnvironment() { | 117 void TearDownTestEnvironment() { |
118 // Flush any remaining messages before we kill ourselves. | 118 // Flush any remaining messages before we kill ourselves. |
119 // http://code.google.com/p/chromium/issues/detail?id=9500 | 119 // http://code.google.com/p/chromium/issues/detail?id=9500 |
120 base::RunLoop().RunUntilIdle(); | 120 base::RunLoop().RunUntilIdle(); |
121 | 121 |
122 if (RunningOnValgrind()) | 122 if (RunningOnValgrind()) |
123 blink::WebCache::clear(); | 123 blink::WebCache::clear(); |
124 delete test_environment; | 124 delete test_environment; |
125 test_environment = NULL; | 125 test_environment = NULL; |
126 } | 126 } |
127 | 127 |
128 } // namespace content | 128 } // namespace content |
OLD | NEW |