| 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/test_blink_web_unit_test_support.h" | 5 #include "content/test/test_blink_web_unit_test_support.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | |
| 8 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
| 9 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
| 10 #include "base/files/scoped_temp_dir.h" | 9 #include "base/files/scoped_temp_dir.h" |
| 11 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| 12 #include "base/strings/utf_string_conversions.h" | 11 #include "base/strings/utf_string_conversions.h" |
| 13 #include "content/public/common/content_switches.h" | |
| 14 #include "content/renderer/scheduler/renderer_scheduler.h" | 12 #include "content/renderer/scheduler/renderer_scheduler.h" |
| 15 #include "content/renderer/scheduler/web_scheduler_impl.h" | 13 #include "content/renderer/scheduler/web_scheduler_impl.h" |
| 16 #include "content/renderer/scheduler/webthread_impl_for_scheduler.h" | 14 #include "content/renderer/scheduler/webthread_impl_for_scheduler.h" |
| 17 #include "content/test/mock_webclipboard_impl.h" | 15 #include "content/test/mock_webclipboard_impl.h" |
| 18 #include "content/test/web_gesture_curve_mock.h" | 16 #include "content/test/web_gesture_curve_mock.h" |
| 19 #include "content/test/web_layer_tree_view_impl_for_testing.h" | 17 #include "content/test/web_layer_tree_view_impl_for_testing.h" |
| 20 #include "content/test/weburl_loader_mock_factory.h" | 18 #include "content/test/weburl_loader_mock_factory.h" |
| 21 #include "media/base/media.h" | 19 #include "media/base/media.h" |
| 22 #include "net/cookies/cookie_monster.h" | 20 #include "net/cookies/cookie_monster.h" |
| 23 #include "net/test/spawned_test_server/spawned_test_server.h" | 21 #include "net/test/spawned_test_server/spawned_test_server.h" |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 LOG(WARNING) << "Failed to create a temp dir for the filesystem." | 97 LOG(WARNING) << "Failed to create a temp dir for the filesystem." |
| 100 "FileSystem feature will be disabled."; | 98 "FileSystem feature will be disabled."; |
| 101 DCHECK(file_system_root_.path().empty()); | 99 DCHECK(file_system_root_.path().empty()); |
| 102 } | 100 } |
| 103 | 101 |
| 104 #if defined(OS_WIN) | 102 #if defined(OS_WIN) |
| 105 // Ensure we pick up the default theme engine. | 103 // Ensure we pick up the default theme engine. |
| 106 SetThemeEngine(NULL); | 104 SetThemeEngine(NULL); |
| 107 #endif | 105 #endif |
| 108 | 106 |
| 109 base::CommandLine::ForCurrentProcess()->AppendSwitch( | |
| 110 switches::kEnableFileCookies); | |
| 111 | |
| 112 // Test shell always exposes the GC. | 107 // Test shell always exposes the GC. |
| 113 std::string flags("--expose-gc"); | 108 std::string flags("--expose-gc"); |
| 114 v8::V8::SetFlagsFromString(flags.c_str(), static_cast<int>(flags.size())); | 109 v8::V8::SetFlagsFromString(flags.c_str(), static_cast<int>(flags.size())); |
| 115 } | 110 } |
| 116 | 111 |
| 117 TestBlinkWebUnitTestSupport::~TestBlinkWebUnitTestSupport() { | 112 TestBlinkWebUnitTestSupport::~TestBlinkWebUnitTestSupport() { |
| 118 url_loader_factory_.reset(); | 113 url_loader_factory_.reset(); |
| 119 mock_clipboard_.reset(); | 114 mock_clipboard_.reset(); |
| 120 blink::shutdown(); | 115 blink::shutdown(); |
| 121 } | 116 } |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 321 return web_scheduler_.get(); | 316 return web_scheduler_.get(); |
| 322 } | 317 } |
| 323 | 318 |
| 324 blink::WebThread* TestBlinkWebUnitTestSupport::currentThread() { | 319 blink::WebThread* TestBlinkWebUnitTestSupport::currentThread() { |
| 325 if (web_thread_ && web_thread_->isCurrentThread()) | 320 if (web_thread_ && web_thread_->isCurrentThread()) |
| 326 return web_thread_.get(); | 321 return web_thread_.get(); |
| 327 return BlinkPlatformImpl::currentThread(); | 322 return BlinkPlatformImpl::currentThread(); |
| 328 } | 323 } |
| 329 | 324 |
| 330 } // namespace content | 325 } // namespace content |
| OLD | NEW |