Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(273)

Side by Side Diff: chrome/browser/spellchecker/spellcheck_custom_dictionary_unittest.cc

Issue 684613002: Standardize usage of virtual/override/final specifiers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 <vector> 5 #include <vector>
6 6
7 #include "base/files/file_util.h" 7 #include "base/files/file_util.h"
8 #include "base/metrics/histogram_samples.h" 8 #include "base/metrics/histogram_samples.h"
9 #include "base/metrics/statistics_recorder.h" 9 #include "base/metrics/statistics_recorder.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 } 56 }
57 57
58 } // namespace 58 } // namespace
59 59
60 static KeyedService* BuildSpellcheckService(content::BrowserContext* profile) { 60 static KeyedService* BuildSpellcheckService(content::BrowserContext* profile) {
61 return new SpellcheckService(static_cast<Profile*>(profile)); 61 return new SpellcheckService(static_cast<Profile*>(profile));
62 } 62 }
63 63
64 class SpellcheckCustomDictionaryTest : public testing::Test { 64 class SpellcheckCustomDictionaryTest : public testing::Test {
65 protected: 65 protected:
66 virtual void SetUp() override { 66 void SetUp() override {
67 // Use SetTestingFactoryAndUse to force creation and initialization. 67 // Use SetTestingFactoryAndUse to force creation and initialization.
68 SpellcheckServiceFactory::GetInstance()->SetTestingFactoryAndUse( 68 SpellcheckServiceFactory::GetInstance()->SetTestingFactoryAndUse(
69 &profile_, &BuildSpellcheckService); 69 &profile_, &BuildSpellcheckService);
70 70
71 StatisticsRecorder::Initialize(); 71 StatisticsRecorder::Initialize();
72 } 72 }
73 73
74 // A wrapper around SpellcheckCustomDictionary::LoadDictionaryFile private 74 // A wrapper around SpellcheckCustomDictionary::LoadDictionaryFile private
75 // function to avoid a large number of FRIEND_TEST declarations in 75 // function to avoid a large number of FRIEND_TEST declarations in
76 // SpellcheckCustomDictionary. 76 // SpellcheckCustomDictionary.
(...skipping 1092 matching lines...) Expand 10 before | Expand all | Expand 10 after
1169 SpellcheckServiceFactory::GetForContext(&profile_); 1169 SpellcheckServiceFactory::GetForContext(&profile_);
1170 SpellcheckCustomDictionary* custom_dictionary = 1170 SpellcheckCustomDictionary* custom_dictionary =
1171 spellcheck_service->GetCustomDictionary(); 1171 spellcheck_service->GetCustomDictionary();
1172 OnLoaded(*custom_dictionary, WordList()); 1172 OnLoaded(*custom_dictionary, WordList());
1173 EXPECT_FALSE(custom_dictionary->HasWord("foo")); 1173 EXPECT_FALSE(custom_dictionary->HasWord("foo"));
1174 EXPECT_FALSE(custom_dictionary->HasWord("bar")); 1174 EXPECT_FALSE(custom_dictionary->HasWord("bar"));
1175 custom_dictionary->AddWord("foo"); 1175 custom_dictionary->AddWord("foo");
1176 EXPECT_TRUE(custom_dictionary->HasWord("foo")); 1176 EXPECT_TRUE(custom_dictionary->HasWord("foo"));
1177 EXPECT_FALSE(custom_dictionary->HasWord("bar")); 1177 EXPECT_FALSE(custom_dictionary->HasWord("bar"));
1178 } 1178 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698