| 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 "base/message_loop/message_loop.h" |   7 #include "base/message_loop/message_loop.h" | 
|   8 #include "base/run_loop.h" |   8 #include "base/run_loop.h" | 
|   9 #include "content/test/test_webkit_platform_support.h" |   9 #include "content/test/test_webkit_platform_support.h" | 
|  10 #include "third_party/WebKit/public/web/WebCache.h" |  10 #include "third_party/WebKit/public/web/WebCache.h" | 
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  70   mock_cr_app::RegisterMockCrApp(); |  70   mock_cr_app::RegisterMockCrApp(); | 
|  71 #endif |  71 #endif | 
|  72  |  72  | 
|  73   // Explicitly initialize the GURL library before spawning any threads. |  73   // Explicitly initialize the GURL library before spawning any threads. | 
|  74   // Otherwise crash may happend when different threads try to create a GURL |  74   // Otherwise crash may happend when different threads try to create a GURL | 
|  75   // at same time. |  75   // at same time. | 
|  76   url_util::Initialize(); |  76   url_util::Initialize(); | 
|  77   test_environment = new TestEnvironment; |  77   test_environment = new TestEnvironment; | 
|  78   webkit_glue::SetUserAgent(webkit_glue::BuildUserAgentFromProduct( |  78   webkit_glue::SetUserAgent(webkit_glue::BuildUserAgentFromProduct( | 
|  79       "DumpRenderTree/0.0.0.0"), false); |  79       "DumpRenderTree/0.0.0.0"), false); | 
|  80  |  | 
|  81   WebKit::initialize(test_environment->webkit_platform_support()); |  | 
|  82 } |  80 } | 
|  83  |  81  | 
|  84 void TearDownTestEnvironment() { |  82 void TearDownTestEnvironment() { | 
|  85   // Flush any remaining messages before we kill ourselves. |  83   // Flush any remaining messages before we kill ourselves. | 
|  86   // http://code.google.com/p/chromium/issues/detail?id=9500 |  84   // http://code.google.com/p/chromium/issues/detail?id=9500 | 
|  87   base::RunLoop().RunUntilIdle(); |  85   base::RunLoop().RunUntilIdle(); | 
|  88  |  86  | 
|  89   if (RunningOnValgrind()) |  87   if (RunningOnValgrind()) | 
|  90     WebKit::WebCache::clear(); |  88     WebKit::WebCache::clear(); | 
|  91   delete test_environment; |  89   delete test_environment; | 
|  92   test_environment = NULL; |  90   test_environment = NULL; | 
|  93 } |  91 } | 
|  94  |  92  | 
|  95 }  // namespace content |  93 }  // namespace content | 
| OLD | NEW |