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/file_path.h" |
10 #include "base/files/scoped_temp_dir.h" | 10 #include "base/files/scoped_temp_dir.h" |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 LOG(WARNING) << "Failed to create a temp dir for the filesystem." | 89 LOG(WARNING) << "Failed to create a temp dir for the filesystem." |
90 "FileSystem feature will be disabled."; | 90 "FileSystem feature will be disabled."; |
91 DCHECK(file_system_root_.path().empty()); | 91 DCHECK(file_system_root_.path().empty()); |
92 } | 92 } |
93 | 93 |
94 #if defined(OS_WIN) | 94 #if defined(OS_WIN) |
95 // Ensure we pick up the default theme engine. | 95 // Ensure we pick up the default theme engine. |
96 SetThemeEngine(NULL); | 96 SetThemeEngine(NULL); |
97 #endif | 97 #endif |
98 | 98 |
| 99 net::CookieMonster::EnableFileScheme(); |
| 100 |
99 // Test shell always exposes the GC. | 101 // Test shell always exposes the GC. |
100 webkit_glue::SetJavaScriptFlags(" --expose-gc"); | 102 webkit_glue::SetJavaScriptFlags(" --expose-gc"); |
101 } | 103 } |
102 | 104 |
103 TestWebKitPlatformSupport::~TestWebKitPlatformSupport() { | 105 TestWebKitPlatformSupport::~TestWebKitPlatformSupport() { |
104 } | 106 } |
105 | 107 |
106 WebKit::WebMimeRegistry* TestWebKitPlatformSupport::mimeRegistry() { | 108 WebKit::WebMimeRegistry* TestWebKitPlatformSupport::mimeRegistry() { |
107 return &mime_registry_; | 109 return &mime_registry_; |
108 } | 110 } |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 | 311 |
310 WebKit::WebData TestWebKitPlatformSupport::readFromFile( | 312 WebKit::WebData TestWebKitPlatformSupport::readFromFile( |
311 const WebKit::WebString& path) { | 313 const WebKit::WebString& path) { |
312 base::FilePath file_path = base::FilePath::FromUTF16Unsafe(path); | 314 base::FilePath file_path = base::FilePath::FromUTF16Unsafe(path); |
313 | 315 |
314 std::string buffer; | 316 std::string buffer; |
315 file_util::ReadFileToString(file_path, &buffer); | 317 file_util::ReadFileToString(file_path, &buffer); |
316 | 318 |
317 return WebKit::WebData(buffer.data(), buffer.size()); | 319 return WebKit::WebData(buffer.data(), buffer.size()); |
318 } | 320 } |
OLD | NEW |