| 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/files/file_path.h" | 7 #include "base/files/file_path.h" |
| 8 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
| 9 #include "base/files/scoped_temp_dir.h" | 9 #include "base/files/scoped_temp_dir.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| (...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 322 PathService::Get(base::DIR_SOURCE_ROOT, &path); | 322 PathService::Get(base::DIR_SOURCE_ROOT, &path); |
| 323 path = path.Append(FILE_PATH_LITERAL("third_party/WebKit")); | 323 path = path.Append(FILE_PATH_LITERAL("third_party/WebKit")); |
| 324 path = base::MakeAbsoluteFilePath(path); | 324 path = base::MakeAbsoluteFilePath(path); |
| 325 CHECK(!path.empty()); | 325 CHECK(!path.empty()); |
| 326 std::string path_ascii = path.MaybeAsASCII(); | 326 std::string path_ascii = path.MaybeAsASCII(); |
| 327 CHECK(!path_ascii.empty()); | 327 CHECK(!path_ascii.empty()); |
| 328 return blink::WebString::fromUTF8(path_ascii.c_str()); | 328 return blink::WebString::fromUTF8(path_ascii.c_str()); |
| 329 } | 329 } |
| 330 | 330 |
| 331 blink::WebLayerTreeView* | 331 blink::WebLayerTreeView* |
| 332 TestBlinkWebUnitTestSupport::createLayerTreeViewForTesting() { | 332 TestBlinkWebUnitTestSupport::createLayerTreeViewForTesting( |
| 333 bool use_compositor_animation_timelines) { |
| 333 scoped_ptr<WebLayerTreeViewImplForTesting> view( | 334 scoped_ptr<WebLayerTreeViewImplForTesting> view( |
| 334 new WebLayerTreeViewImplForTesting()); | 335 new WebLayerTreeViewImplForTesting()); |
| 335 | 336 |
| 336 view->Initialize(); | 337 view->Initialize(use_compositor_animation_timelines); |
| 337 return view.release(); | 338 return view.release(); |
| 338 } | 339 } |
| 339 | 340 |
| 340 blink::WebData TestBlinkWebUnitTestSupport::readFromFile( | 341 blink::WebData TestBlinkWebUnitTestSupport::readFromFile( |
| 341 const blink::WebString& path) { | 342 const blink::WebString& path) { |
| 342 base::FilePath file_path = base::FilePath::FromUTF16Unsafe(path); | 343 base::FilePath file_path = base::FilePath::FromUTF16Unsafe(path); |
| 343 | 344 |
| 344 std::string buffer; | 345 std::string buffer; |
| 345 base::ReadFileToString(file_path, &buffer); | 346 base::ReadFileToString(file_path, &buffer); |
| 346 | 347 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 369 base::MessageLoop::current()->QuitWhenIdle(); | 370 base::MessageLoop::current()->QuitWhenIdle(); |
| 370 } | 371 } |
| 371 | 372 |
| 372 void TestBlinkWebUnitTestSupport::getPluginList( | 373 void TestBlinkWebUnitTestSupport::getPluginList( |
| 373 bool refresh, blink::WebPluginListBuilder* builder) { | 374 bool refresh, blink::WebPluginListBuilder* builder) { |
| 374 builder->addPlugin("pdf", "pdf", "pdf-files"); | 375 builder->addPlugin("pdf", "pdf", "pdf-files"); |
| 375 builder->addMediaTypeToLastPlugin("application/pdf", "pdf"); | 376 builder->addMediaTypeToLastPlugin("application/pdf", "pdf"); |
| 376 } | 377 } |
| 377 | 378 |
| 378 } // namespace content | 379 } // namespace content |
| OLD | NEW |