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_webkit_platform_support.h" | 5 #include "content/test/test_webkit_platform_support.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/files/scoped_temp_dir.h" | 10 #include "base/files/scoped_temp_dir.h" |
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
296 std::string path_ascii = path.MaybeAsASCII(); | 296 std::string path_ascii = path.MaybeAsASCII(); |
297 CHECK(!path_ascii.empty()); | 297 CHECK(!path_ascii.empty()); |
298 return blink::WebString::fromUTF8(path_ascii.c_str()); | 298 return blink::WebString::fromUTF8(path_ascii.c_str()); |
299 } | 299 } |
300 | 300 |
301 blink::WebLayerTreeView* | 301 blink::WebLayerTreeView* |
302 TestWebKitPlatformSupport::createLayerTreeViewForTesting() { | 302 TestWebKitPlatformSupport::createLayerTreeViewForTesting() { |
303 scoped_ptr<WebLayerTreeViewImplForTesting> view( | 303 scoped_ptr<WebLayerTreeViewImplForTesting> view( |
304 new WebLayerTreeViewImplForTesting()); | 304 new WebLayerTreeViewImplForTesting()); |
305 | 305 |
306 if (!view->Initialize()) | 306 view->Initialize(); |
307 return NULL; | |
308 return view.release(); | 307 return view.release(); |
309 } | 308 } |
310 | 309 |
311 blink::WebLayerTreeView* | 310 blink::WebLayerTreeView* |
312 TestWebKitPlatformSupport::createLayerTreeViewForTesting(TestViewType type) { | 311 TestWebKitPlatformSupport::createLayerTreeViewForTesting(TestViewType type) { |
313 DCHECK_EQ(TestViewTypeUnitTest, type); | 312 DCHECK_EQ(TestViewTypeUnitTest, type); |
314 return createLayerTreeViewForTesting(); | 313 return createLayerTreeViewForTesting(); |
315 } | 314 } |
316 | 315 |
317 blink::WebData TestWebKitPlatformSupport::readFromFile( | 316 blink::WebData TestWebKitPlatformSupport::readFromFile( |
318 const blink::WebString& path) { | 317 const blink::WebString& path) { |
319 base::FilePath file_path = base::FilePath::FromUTF16Unsafe(path); | 318 base::FilePath file_path = base::FilePath::FromUTF16Unsafe(path); |
320 | 319 |
321 std::string buffer; | 320 std::string buffer; |
322 base::ReadFileToString(file_path, &buffer); | 321 base::ReadFileToString(file_path, &buffer); |
323 | 322 |
324 return blink::WebData(buffer.data(), buffer.size()); | 323 return blink::WebData(buffer.data(), buffer.size()); |
325 } | 324 } |
326 | 325 |
327 } // namespace content | 326 } // namespace content |
OLD | NEW |