Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/tools/test_shell/test_shell_webkit_init.h" | 5 #include "webkit/tools/test_shell/test_shell_webkit_init.h" |
| 6 | 6 |
| 7 #include "base/metrics/stats_counters.h" | 7 #include "base/metrics/stats_counters.h" |
| 8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
| 9 #include "media/base/media.h" | 9 #include "media/base/media.h" |
| 10 #include "third_party/WebKit/WebKit/chromium/public/WebCache.h" | 10 #include "third_party/WebKit/WebKit/chromium/public/WebCache.h" |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 112 "\xff\x00\xff\x00\xff\xff\xff\xff\xff\x7b\x1f\xb1\xc4\x00\x00\x00" | 112 "\xff\x00\xff\x00\xff\xff\xff\xff\xff\x7b\x1f\xb1\xc4\x00\x00\x00" |
| 113 "\x09\x70\x48\x59\x73\x00\x00\x0b\x13\x00\x00\x0b\x13\x01\x00\x9a" | 113 "\x09\x70\x48\x59\x73\x00\x00\x0b\x13\x00\x00\x0b\x13\x01\x00\x9a" |
| 114 "\x9c\x18\x00\x00\x00\x17\x49\x44\x41\x54\x78\x01\x63\x98\x89\x0a" | 114 "\x9c\x18\x00\x00\x00\x17\x49\x44\x41\x54\x78\x01\x63\x98\x89\x0a" |
| 115 "\x18\x50\xb9\x33\x47\xf9\xa8\x01\x32\xd4\xc2\x03\x00\x33\x84\x0d" | 115 "\x18\x50\xb9\x33\x47\xf9\xa8\x01\x32\xd4\xc2\x03\x00\x33\x84\x0d" |
| 116 "\x02\x3a\x91\xeb\xa5\x00\x00\x00\x00\x49\x45\x4e\x44\xae\x42\x60" | 116 "\x02\x3a\x91\xeb\xa5\x00\x00\x00\x00\x49\x45\x4e\x44\xae\x42\x60" |
| 117 "\x82"; | 117 "\x82"; |
| 118 return WebKit::WebData(red_square, arraysize(red_square)); | 118 return WebKit::WebData(red_square, arraysize(red_square)); |
| 119 } | 119 } |
| 120 return webkit_glue::WebKitClientImpl::loadResource(name); | 120 return webkit_glue::WebKitClientImpl::loadResource(name); |
| 121 } | 121 } |
| 122 | |
| 123 WebKit::WebString TestShellWebKitInit::queryLocalizedString( | |
| 124 WebKit::WebLocalizedString::Name name) { | |
| 125 switch (name) { | |
| 126 case WebKit::WebLocalizedString::ValidationValueMissing: | |
|
tony
2010/11/16 18:11:41
Ditto.
tkent
2010/11/22 10:19:06
Done.
| |
| 127 return ASCIIToUTF16("value missing"); | |
| 128 case WebKit::WebLocalizedString::ValidationTypeMismatch: | |
| 129 case WebKit::WebLocalizedString::ValidationTypeMismatchForEmail: | |
| 130 case WebKit::WebLocalizedString::ValidationTypeMismatchForMultipleEmail: | |
| 131 case WebKit::WebLocalizedString::ValidationTypeMismatchForURL: | |
| 132 return ASCIIToUTF16("type mismatch"); | |
| 133 case WebKit::WebLocalizedString::ValidationPatternMismatch: | |
| 134 return ASCIIToUTF16("pattern mismatch"); | |
| 135 case WebKit::WebLocalizedString::ValidationTooLong: | |
| 136 return ASCIIToUTF16("too long"); | |
| 137 case WebKit::WebLocalizedString::ValidationRangeUnderflow: | |
| 138 return ASCIIToUTF16("range underflow"); | |
| 139 case WebKit::WebLocalizedString::ValidationRangeOverflow: | |
| 140 return ASCIIToUTF16("range overflow"); | |
| 141 case WebKit::WebLocalizedString::ValidationStepMismatch: | |
| 142 return ASCIIToUTF16("step mismatch"); | |
| 143 default: | |
| 144 return WebKitClientImpl::queryLocalizedString(name); | |
| 145 } | |
| 146 } | |
| 147 | |
| 148 WebKit::WebString TestShellWebKitInit::queryLocalizedString( | |
| 149 WebKit::WebLocalizedString::Name name, int value1, int value2) { | |
| 150 if (name == WebKit::WebLocalizedString::ValidationTooLong) | |
| 151 return ASCIIToUTF16("too long"); | |
| 152 return WebKitClientImpl::queryLocalizedString(name, value1, value2); | |
| 153 } | |
| 154 | |
| 155 WebKit::WebString TestShellWebKitInit::queryLocalizedString( | |
| 156 WebKit::WebLocalizedString::Name name, const WebKit::WebString& value) { | |
| 157 if (name == WebKit::WebLocalizedString::ValidationRangeUnderflow) | |
| 158 return ASCIIToUTF16("range underflow"); | |
| 159 if (name == WebKit::WebLocalizedString::ValidationRangeOverflow) | |
| 160 return ASCIIToUTF16("range overflow"); | |
| 161 return WebKitClientImpl::queryLocalizedString(name, value); | |
| 162 } | |
| 163 | |
| 164 WebKit::WebString TestShellWebKitInit::queryLocalizedString( | |
| 165 WebKit::WebLocalizedString::Name name, | |
| 166 const WebKit::WebString& value1, | |
| 167 const WebKit::WebString& value2) { | |
| 168 if (name == WebKit::WebLocalizedString::ValidationStepMismatch) | |
| 169 return ASCIIToUTF16("step mismatch"); | |
| 170 return WebKitClientImpl::queryLocalizedString(name, value1, value2); | |
| 171 } | |
| 172 | |
| OLD | NEW |