OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "webkit/support/test_webkit_platform_support.h" | 5 #include "webkit/support/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/scoped_temp_dir.h" | 10 #include "base/files/scoped_temp_dir.h" |
10 #include "base/metrics/stats_counters.h" | 11 #include "base/metrics/stats_counters.h" |
11 #include "base/path_service.h" | 12 #include "base/path_service.h" |
12 #include "base/strings/utf_string_conversions.h" | 13 #include "base/strings/utf_string_conversions.h" |
13 #include "cc/output/context_provider.h" | 14 #include "cc/output/context_provider.h" |
14 #include "media/base/media.h" | 15 #include "media/base/media.h" |
15 #include "net/cookies/cookie_monster.h" | 16 #include "net/cookies/cookie_monster.h" |
16 #include "net/test/spawned_test_server/spawned_test_server.h" | 17 #include "net/test/spawned_test_server/spawned_test_server.h" |
17 #include "third_party/WebKit/public/platform/WebData.h" | 18 #include "third_party/WebKit/public/platform/WebData.h" |
18 #include "third_party/WebKit/public/platform/WebFileSystem.h" | 19 #include "third_party/WebKit/public/platform/WebFileSystem.h" |
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
338 return view.release(); | 339 return view.release(); |
339 } | 340 } |
340 | 341 |
341 WebKit::WebLayerTreeView* | 342 WebKit::WebLayerTreeView* |
342 TestWebKitPlatformSupport::createLayerTreeViewForTesting( | 343 TestWebKitPlatformSupport::createLayerTreeViewForTesting( |
343 TestViewType type) { | 344 TestViewType type) { |
344 DCHECK_EQ(TestViewTypeUnitTest, type); | 345 DCHECK_EQ(TestViewTypeUnitTest, type); |
345 return createLayerTreeViewForTesting(); | 346 return createLayerTreeViewForTesting(); |
346 } | 347 } |
347 | 348 |
| 349 WebKit::WebData TestWebKitPlatformSupport::readFromFile( |
| 350 const WebKit::WebString& path) { |
| 351 base::FilePath file_path = base::FilePath::FromUTF16Unsafe(path); |
| 352 |
| 353 std::string buffer; |
| 354 file_util::ReadFileToString(file_path, &buffer); |
| 355 |
| 356 return WebKit::WebData(buffer.data(), buffer.size()); |
| 357 } |
OLD | NEW |