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

Side by Side Diff: chrome/browser/search/hotword_service_unittest.cc

Issue 648653003: Standardize usage of virtual/override/final in chrome/browser/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months 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
« no previous file with comments | « chrome/browser/search/hotword_service_factory.h ('k') | chrome/browser/search/iframe_source.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "base/command_line.h" 5 #include "base/command_line.h"
6 #include "base/memory/scoped_ptr.h" 6 #include "base/memory/scoped_ptr.h"
7 #include "base/metrics/field_trial.h" 7 #include "base/metrics/field_trial.h"
8 #include "base/prefs/pref_service.h" 8 #include "base/prefs/pref_service.h"
9 #include "chrome/browser/browser_process.h" 9 #include "chrome/browser/browser_process.h"
10 #include "chrome/browser/extensions/extension_service_test_base.h" 10 #include "chrome/browser/extensions/extension_service_test_base.h"
(...skipping 14 matching lines...) Expand all
25 25
26 namespace { 26 namespace {
27 27
28 class MockHotwordService : public HotwordService { 28 class MockHotwordService : public HotwordService {
29 public: 29 public:
30 explicit MockHotwordService(Profile* profile) 30 explicit MockHotwordService(Profile* profile)
31 : HotwordService(profile), 31 : HotwordService(profile),
32 uninstall_count_(0) { 32 uninstall_count_(0) {
33 } 33 }
34 34
35 virtual bool UninstallHotwordExtension( 35 bool UninstallHotwordExtension(ExtensionService* extension_service) override {
36 ExtensionService* extension_service) override {
37 uninstall_count_++; 36 uninstall_count_++;
38 return HotwordService::UninstallHotwordExtension(extension_service); 37 return HotwordService::UninstallHotwordExtension(extension_service);
39 } 38 }
40 39
41 virtual void InstallHotwordExtensionFromWebstore() override{ 40 void InstallHotwordExtensionFromWebstore() override {
42 scoped_ptr<base::DictionaryValue> manifest = 41 scoped_ptr<base::DictionaryValue> manifest =
43 extensions::DictionaryBuilder() 42 extensions::DictionaryBuilder()
44 .Set("name", "Hotword Test Extension") 43 .Set("name", "Hotword Test Extension")
45 .Set("version", "1.0") 44 .Set("version", "1.0")
46 .Set("manifest_version", 2) 45 .Set("manifest_version", 2)
47 .Build(); 46 .Build();
48 scoped_refptr<extensions::Extension> extension = 47 scoped_refptr<extensions::Extension> extension =
49 extensions::ExtensionBuilder().SetManifest(manifest.Pass()) 48 extensions::ExtensionBuilder().SetManifest(manifest.Pass())
50 .AddFlags(extensions::Extension::FROM_WEBSTORE 49 .AddFlags(extensions::Extension::FROM_WEBSTORE
51 | extensions::Extension::WAS_INSTALLED_BY_DEFAULT) 50 | extensions::Extension::WAS_INSTALLED_BY_DEFAULT)
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
336 EXPECT_EQ("fr_fr", 335 EXPECT_EQ("fr_fr",
337 profile()->GetPrefs()->GetString(prefs::kHotwordPreviousLanguage)); 336 profile()->GetPrefs()->GetString(prefs::kHotwordPreviousLanguage));
338 337
339 // If the locale is set back to the last valid one, then an uninstall-install 338 // If the locale is set back to the last valid one, then an uninstall-install
340 // shouldn't be needed. 339 // shouldn't be needed.
341 SetApplicationLocale(profile(), "fr_fr"); 340 SetApplicationLocale(profile(), "fr_fr");
342 EXPECT_TRUE(HotwordServiceFactory::IsHotwordAllowed(profile())); 341 EXPECT_TRUE(HotwordServiceFactory::IsHotwordAllowed(profile()));
343 EXPECT_FALSE(hotword_service->MaybeReinstallHotwordExtension()); 342 EXPECT_FALSE(hotword_service->MaybeReinstallHotwordExtension());
344 EXPECT_EQ(1, hotword_service->uninstall_count()); // no change 343 EXPECT_EQ(1, hotword_service->uninstall_count()); // no change
345 } 344 }
OLDNEW
« no previous file with comments | « chrome/browser/search/hotword_service_factory.h ('k') | chrome/browser/search/iframe_source.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698