| 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/path_service.h" |
| 8 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
| 9 #include "content/test/test_webkit_platform_support.h" | 10 #include "content/test/test_webkit_platform_support.h" |
| 10 #include "third_party/WebKit/public/web/WebCache.h" | 11 #include "third_party/WebKit/public/web/WebCache.h" |
| 11 #include "third_party/WebKit/public/web/WebKit.h" | 12 #include "third_party/WebKit/public/web/WebKit.h" |
| 12 #include "third_party/WebKit/public/web/WebRuntimeFeatures.h" | 13 #include "third_party/WebKit/public/web/WebRuntimeFeatures.h" |
| 14 #include "ui/base/resource/resource_bundle.h" |
| 13 #include "url/url_util.h" | 15 #include "url/url_util.h" |
| 14 #include "webkit/common/user_agent/user_agent.h" | 16 #include "webkit/common/user_agent/user_agent.h" |
| 15 #include "webkit/common/user_agent/user_agent_util.h" | 17 #include "webkit/common/user_agent/user_agent_util.h" |
| 16 | 18 |
| 17 #if defined(OS_ANDROID) | 19 #if defined(OS_ANDROID) |
| 18 #include "base/android/jni_android.h" | 20 #include "base/android/jni_android.h" |
| 19 #include "net/android/network_library.h" | 21 #include "net/android/network_library.h" |
| 20 #endif | 22 #endif |
| 21 | 23 |
| 22 #if defined(OS_MACOSX) | 24 #if defined(OS_MACOSX) |
| (...skipping 11 matching lines...) Expand all Loading... |
| 34 typedef base::MessageLoop MessageLoopType; | 36 typedef base::MessageLoop MessageLoopType; |
| 35 #else | 37 #else |
| 36 typedef base::MessageLoopForUI MessageLoopType; | 38 typedef base::MessageLoopForUI MessageLoopType; |
| 37 #endif | 39 #endif |
| 38 | 40 |
| 39 TestEnvironment() { | 41 TestEnvironment() { |
| 40 main_message_loop_.reset(new MessageLoopType); | 42 main_message_loop_.reset(new MessageLoopType); |
| 41 | 43 |
| 42 // TestWebKitPlatformSupport must be instantiated after MessageLoopType. | 44 // TestWebKitPlatformSupport must be instantiated after MessageLoopType. |
| 43 webkit_platform_support_.reset(new TestWebKitPlatformSupport); | 45 webkit_platform_support_.reset(new TestWebKitPlatformSupport); |
| 46 |
| 47 #if defined(OS_WIN) |
| 48 base::FilePath pak_file; |
| 49 PathService::Get(base::DIR_MODULE, &pak_file); |
| 50 pak_file = pak_file.AppendASCII("ui_test.pak"); |
| 51 ui::ResourceBundle::InitSharedInstanceWithPakPath(pak_file); |
| 52 #endif |
| 53 } |
| 54 |
| 55 ~TestEnvironment() { |
| 56 #if defined(OS_WIN) |
| 57 ui::ResourceBundle::CleanupSharedInstance(); |
| 58 #endif |
| 44 } | 59 } |
| 45 | 60 |
| 46 TestWebKitPlatformSupport* webkit_platform_support() const { | 61 TestWebKitPlatformSupport* webkit_platform_support() const { |
| 47 return webkit_platform_support_.get(); | 62 return webkit_platform_support_.get(); |
| 48 } | 63 } |
| 49 | 64 |
| 50 private: | 65 private: |
| 51 scoped_ptr<MessageLoopType> main_message_loop_; | 66 scoped_ptr<MessageLoopType> main_message_loop_; |
| 52 scoped_ptr<TestWebKitPlatformSupport> webkit_platform_support_; | 67 scoped_ptr<TestWebKitPlatformSupport> webkit_platform_support_; |
| 53 }; | 68 }; |
| (...skipping 30 matching lines...) Expand all Loading... |
| 84 // http://code.google.com/p/chromium/issues/detail?id=9500 | 99 // http://code.google.com/p/chromium/issues/detail?id=9500 |
| 85 base::RunLoop().RunUntilIdle(); | 100 base::RunLoop().RunUntilIdle(); |
| 86 | 101 |
| 87 if (RunningOnValgrind()) | 102 if (RunningOnValgrind()) |
| 88 blink::WebCache::clear(); | 103 blink::WebCache::clear(); |
| 89 delete test_environment; | 104 delete test_environment; |
| 90 test_environment = NULL; | 105 test_environment = NULL; |
| 91 } | 106 } |
| 92 | 107 |
| 93 } // namespace content | 108 } // namespace content |
| OLD | NEW |