Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(70)

Side by Side Diff: content/test/test_webkit_platform_support.cc

Issue 545553003: fileSystem() for the blink::Platform used in blink unit tests. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/test/test_webkit_platform_support.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
11 #include "base/metrics/stats_counters.h" 11 #include "base/metrics/stats_counters.h"
12 #include "base/path_service.h" 12 #include "base/path_service.h"
13 #include "base/strings/utf_string_conversions.h" 13 #include "base/strings/utf_string_conversions.h"
14 #include "content/child/fileapi/webfilesystem_impl.h"
14 #include "content/public/common/content_switches.h" 15 #include "content/public/common/content_switches.h"
15 #include "content/test/mock_webclipboard_impl.h" 16 #include "content/test/mock_webclipboard_impl.h"
16 #include "content/test/web_gesture_curve_mock.h" 17 #include "content/test/web_gesture_curve_mock.h"
17 #include "content/test/web_layer_tree_view_impl_for_testing.h" 18 #include "content/test/web_layer_tree_view_impl_for_testing.h"
18 #include "content/test/weburl_loader_mock_factory.h" 19 #include "content/test/weburl_loader_mock_factory.h"
19 #include "media/base/media.h" 20 #include "media/base/media.h"
20 #include "net/cookies/cookie_monster.h" 21 #include "net/cookies/cookie_monster.h"
21 #include "net/test/spawned_test_server/spawned_test_server.h" 22 #include "net/test/spawned_test_server/spawned_test_server.h"
22 #include "third_party/WebKit/public/platform/WebData.h" 23 #include "third_party/WebKit/public/platform/WebData.h"
23 #include "third_party/WebKit/public/platform/WebFileSystem.h" 24 #include "third_party/WebKit/public/platform/WebFileSystem.h"
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 blink::WebClipboard* TestWebKitPlatformSupport::clipboard() { 121 blink::WebClipboard* TestWebKitPlatformSupport::clipboard() {
121 // Mock out clipboard calls so that tests don't mess 122 // Mock out clipboard calls so that tests don't mess
122 // with each other's copies/pastes when running in parallel. 123 // with each other's copies/pastes when running in parallel.
123 return mock_clipboard_.get(); 124 return mock_clipboard_.get();
124 } 125 }
125 126
126 blink::WebFileUtilities* TestWebKitPlatformSupport::fileUtilities() { 127 blink::WebFileUtilities* TestWebKitPlatformSupport::fileUtilities() {
127 return &file_utilities_; 128 return &file_utilities_;
128 } 129 }
129 130
131 blink::WebFileSystem* TestWebKitPlatformSupport::fileSystem() {
132 return WebFileSystemImpl::ThreadSpecificInstance(
133 base::MessageLoopProxy::current());
134 }
135
130 blink::WebIDBFactory* TestWebKitPlatformSupport::idbFactory() { 136 blink::WebIDBFactory* TestWebKitPlatformSupport::idbFactory() {
131 NOTREACHED() << 137 NOTREACHED() <<
132 "IndexedDB cannot be tested with in-process harnesses."; 138 "IndexedDB cannot be tested with in-process harnesses.";
133 return NULL; 139 return NULL;
134 } 140 }
135 141
136 blink::WebMimeRegistry* TestWebKitPlatformSupport::mimeRegistry() { 142 blink::WebMimeRegistry* TestWebKitPlatformSupport::mimeRegistry() {
137 return &mime_registry_; 143 return &mime_registry_;
138 } 144 }
139 145
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 const blink::WebString& path) { 300 const blink::WebString& path) {
295 base::FilePath file_path = base::FilePath::FromUTF16Unsafe(path); 301 base::FilePath file_path = base::FilePath::FromUTF16Unsafe(path);
296 302
297 std::string buffer; 303 std::string buffer;
298 base::ReadFileToString(file_path, &buffer); 304 base::ReadFileToString(file_path, &buffer);
299 305
300 return blink::WebData(buffer.data(), buffer.size()); 306 return blink::WebData(buffer.data(), buffer.size());
301 } 307 }
302 308
303 } // namespace content 309 } // namespace content
OLDNEW
« no previous file with comments | « content/test/test_webkit_platform_support.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698