OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/shell/renderer/test_runner/mock_spell_check.h" | 5 #include "content/shell/renderer/test_runner/mock_spell_check.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "content/shell/renderer/test_runner/test_common.h" | 8 #include "content/shell/renderer/test_runner/test_common.h" |
9 #include "third_party/WebKit/public/platform/WebCString.h" | 9 #include "third_party/WebKit/public/platform/WebCString.h" |
10 | 10 |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 // well-spelled words, it is easier to compare the given word with misspelled | 145 // well-spelled words, it is easier to compare the given word with misspelled |
146 // ones than to compare with well-spelled ones. | 146 // ones than to compare with well-spelled ones. |
147 static const char* misspelled_words[] = { | 147 static const char* misspelled_words[] = { |
148 // These words are known misspelled words in webkit tests. | 148 // These words are known misspelled words in webkit tests. |
149 // If there are other misspelled words in webkit tests, please add them in | 149 // If there are other misspelled words in webkit tests, please add them in |
150 // this array. | 150 // this array. |
151 "foo", "Foo", "baz", "fo", "LibertyF", | 151 "foo", "Foo", "baz", "fo", "LibertyF", |
152 "chello", "xxxtestxxx", "XXxxx", "Textx", "blockquoted", | 152 "chello", "xxxtestxxx", "XXxxx", "Textx", "blockquoted", |
153 "asd", "Lorem", "Nunc", "Curabitur", "eu", | 153 "asd", "Lorem", "Nunc", "Curabitur", "eu", |
154 "adlj", "adaasj", "sdklj", "jlkds", "jsaada", | 154 "adlj", "adaasj", "sdklj", "jlkds", "jsaada", |
155 "jlda", "zz", "contentEditable", | 155 "jlda", "zz", "contentEditable", "meagesga", |
| 156 |
156 // The following words are used by unit tests. | 157 // The following words are used by unit tests. |
157 "ifmmp", "qwertyuiopasd", "qwertyuiopasdf", "upper case", "wellcome"}; | 158 "ifmmp", "qwertyuiopasd", "qwertyuiopasdf", "upper case", "wellcome"}; |
158 | 159 |
159 misspelled_words_.clear(); | 160 misspelled_words_.clear(); |
160 for (size_t i = 0; i < arraysize(misspelled_words); ++i) | 161 for (size_t i = 0; i < arraysize(misspelled_words); ++i) |
161 misspelled_words_.push_back( | 162 misspelled_words_.push_back( |
162 base::string16(misspelled_words[i], | 163 base::string16(misspelled_words[i], |
163 misspelled_words[i] + strlen(misspelled_words[i]))); | 164 misspelled_words[i] + strlen(misspelled_words[i]))); |
164 | 165 |
165 // Mark as initialized to prevent this object from being initialized twice | 166 // Mark as initialized to prevent this object from being initialized twice |
166 // or more. | 167 // or more. |
167 initialized_ = true; | 168 initialized_ = true; |
168 | 169 |
169 // Since this MockSpellCheck class doesn't download dictionaries, this | 170 // Since this MockSpellCheck class doesn't download dictionaries, this |
170 // function always returns false. | 171 // function always returns false. |
171 return false; | 172 return false; |
172 } | 173 } |
173 | 174 |
174 } // namespace content | 175 } // namespace content |
OLD | NEW |