OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 // Unit tests for |Misspelling| object. | 5 // Unit tests for |Misspelling| object. |
6 | 6 |
7 #include "chrome/browser/spellchecker/misspelling.h" | 7 #include "components/spellcheck/browser/misspelling.h" |
8 | 8 |
9 #include "base/json/json_reader.h" | 9 #include "base/json/json_reader.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
11 #include "base/values.h" | 11 #include "base/values.h" |
12 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
13 | 13 |
14 TEST(MisspellingTest, SerializeTest) { | 14 TEST(MisspellingTest, SerializeTest) { |
15 Misspelling misspelling; | 15 Misspelling misspelling; |
16 misspelling.context = base::ASCIIToUTF16("How doe sit know"); | 16 misspelling.context = base::ASCIIToUTF16("How doe sit know"); |
17 misspelling.location = 4; | 17 misspelling.location = 4; |
(...skipping 26 matching lines...) Expand all Loading... |
44 misspelling.length = 0; | 44 misspelling.length = 0; |
45 EXPECT_EQ(base::string16(), GetMisspelledString(misspelling)); | 45 EXPECT_EQ(base::string16(), GetMisspelledString(misspelling)); |
46 | 46 |
47 misspelling.location = misspelling.context.length(); | 47 misspelling.location = misspelling.context.length(); |
48 misspelling.length = 7; | 48 misspelling.length = 7; |
49 EXPECT_EQ(base::string16(), GetMisspelledString(misspelling)); | 49 EXPECT_EQ(base::string16(), GetMisspelledString(misspelling)); |
50 | 50 |
51 misspelling.location = misspelling.context.length() + 1; | 51 misspelling.location = misspelling.context.length() + 1; |
52 EXPECT_EQ(base::string16(), GetMisspelledString(misspelling)); | 52 EXPECT_EQ(base::string16(), GetMisspelledString(misspelling)); |
53 } | 53 } |
OLD | NEW |