| 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 |Feedback| object. | 5 // Unit tests for |Feedback| object. |
| 6 | 6 |
| 7 #include "chrome/browser/spellchecker/feedback.h" | 7 #include "chrome/browser/spellchecker/feedback.h" |
| 8 | 8 |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| 11 | 11 |
| 12 using base::ASCIIToUTF16; |
| 13 |
| 12 namespace spellcheck { | 14 namespace spellcheck { |
| 13 | 15 |
| 14 namespace { | 16 namespace { |
| 15 | 17 |
| 16 // Identifier for a renderer process. | 18 // Identifier for a renderer process. |
| 17 const int kRendererProcessId = 7; | 19 const int kRendererProcessId = 7; |
| 18 | 20 |
| 19 // Hash identifier for a misspelling. | 21 // Hash identifier for a misspelling. |
| 20 const uint32 kMisspellingHash = 42; | 22 const uint32 kMisspellingHash = 42; |
| 21 | 23 |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 248 kMisspellingStart, | 250 kMisspellingStart, |
| 249 kMisspellingLength, | 251 kMisspellingLength, |
| 250 std::vector<base::string16>(1, kSuggestion), | 252 std::vector<base::string16>(1, kSuggestion), |
| 251 kMisspellingHash)); | 253 kMisspellingHash)); |
| 252 feedback_.GetMisspelling(kMisspellingHash)->action.Finalize(); | 254 feedback_.GetMisspelling(kMisspellingHash)->action.Finalize(); |
| 253 feedback_.EraseFinalizedMisspellings(kRendererProcessId); | 255 feedback_.EraseFinalizedMisspellings(kRendererProcessId); |
| 254 EXPECT_TRUE(feedback_.FindMisspellings(kMisspelledWord).empty()); | 256 EXPECT_TRUE(feedback_.FindMisspellings(kMisspelledWord).empty()); |
| 255 } | 257 } |
| 256 | 258 |
| 257 } // namespace spellcheck | 259 } // namespace spellcheck |
| OLD | NEW |