| 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/files/file_path.h" | 8 #include "base/files/file_path.h" |
| 9 #include "base/files/file_util.h" | 9 #include "base/files/file_util.h" |
| 10 #include "base/files/scoped_temp_dir.h" | 10 #include "base/files/scoped_temp_dir.h" |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 } | 193 } |
| 194 } | 194 } |
| 195 | 195 |
| 196 blink::WebString TestWebKitPlatformSupport::queryLocalizedString( | 196 blink::WebString TestWebKitPlatformSupport::queryLocalizedString( |
| 197 blink::WebLocalizedString::Name name, | 197 blink::WebLocalizedString::Name name, |
| 198 const blink::WebString& value) { | 198 const blink::WebString& value) { |
| 199 if (name == blink::WebLocalizedString::ValidationRangeUnderflow) | 199 if (name == blink::WebLocalizedString::ValidationRangeUnderflow) |
| 200 return base::ASCIIToUTF16("range underflow"); | 200 return base::ASCIIToUTF16("range underflow"); |
| 201 if (name == blink::WebLocalizedString::ValidationRangeOverflow) | 201 if (name == blink::WebLocalizedString::ValidationRangeOverflow) |
| 202 return base::ASCIIToUTF16("range overflow"); | 202 return base::ASCIIToUTF16("range overflow"); |
| 203 if (name == blink::WebLocalizedString::SelectMenuListText) |
| 204 return base::ASCIIToUTF16("$1 selected"); |
| 203 return BlinkPlatformImpl::queryLocalizedString(name, value); | 205 return BlinkPlatformImpl::queryLocalizedString(name, value); |
| 204 } | 206 } |
| 205 | 207 |
| 206 blink::WebString TestWebKitPlatformSupport::queryLocalizedString( | 208 blink::WebString TestWebKitPlatformSupport::queryLocalizedString( |
| 207 blink::WebLocalizedString::Name name, | 209 blink::WebLocalizedString::Name name, |
| 208 const blink::WebString& value1, | 210 const blink::WebString& value1, |
| 209 const blink::WebString& value2) { | 211 const blink::WebString& value2) { |
| 210 if (name == blink::WebLocalizedString::ValidationTooLong) | 212 if (name == blink::WebLocalizedString::ValidationTooLong) |
| 211 return base::ASCIIToUTF16("too long"); | 213 return base::ASCIIToUTF16("too long"); |
| 212 if (name == blink::WebLocalizedString::ValidationStepMismatch) | 214 if (name == blink::WebLocalizedString::ValidationStepMismatch) |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 294 const blink::WebString& path) { | 296 const blink::WebString& path) { |
| 295 base::FilePath file_path = base::FilePath::FromUTF16Unsafe(path); | 297 base::FilePath file_path = base::FilePath::FromUTF16Unsafe(path); |
| 296 | 298 |
| 297 std::string buffer; | 299 std::string buffer; |
| 298 base::ReadFileToString(file_path, &buffer); | 300 base::ReadFileToString(file_path, &buffer); |
| 299 | 301 |
| 300 return blink::WebData(buffer.data(), buffer.size()); | 302 return blink::WebData(buffer.data(), buffer.size()); |
| 301 } | 303 } |
| 302 | 304 |
| 303 } // namespace content | 305 } // namespace content |
| OLD | NEW |