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

Side by Side Diff: chrome/browser/metrics/extensions_metrics_provider_unittest.cc

Issue 624173002: replace OVERRIDE and FINAL with override and final in chrome/browser/[j-q]* (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase on master 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
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 "chrome/browser/metrics/extensions_metrics_provider.h" 5 #include "chrome/browser/metrics/extensions_metrics_provider.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/prefs/testing_pref_service.h" 10 #include "base/prefs/testing_pref_service.h"
(...skipping 25 matching lines...) Expand all
36 metrics::MetricsStateManager* metrics_state_manager) 36 metrics::MetricsStateManager* metrics_state_manager)
37 : ExtensionsMetricsProvider(metrics_state_manager) {} 37 : ExtensionsMetricsProvider(metrics_state_manager) {}
38 38
39 // Makes the protected HashExtension method available to testing code. 39 // Makes the protected HashExtension method available to testing code.
40 using ExtensionsMetricsProvider::HashExtension; 40 using ExtensionsMetricsProvider::HashExtension;
41 41
42 protected: 42 protected:
43 // Override the GetInstalledExtensions method to return a set of extensions 43 // Override the GetInstalledExtensions method to return a set of extensions
44 // for tests. 44 // for tests.
45 virtual scoped_ptr<extensions::ExtensionSet> GetInstalledExtensions( 45 virtual scoped_ptr<extensions::ExtensionSet> GetInstalledExtensions(
46 Profile* profile) OVERRIDE { 46 Profile* profile) override {
47 scoped_ptr<extensions::ExtensionSet> extensions( 47 scoped_ptr<extensions::ExtensionSet> extensions(
48 new extensions::ExtensionSet()); 48 new extensions::ExtensionSet());
49 scoped_refptr<const extensions::Extension> extension; 49 scoped_refptr<const extensions::Extension> extension;
50 extension = extensions::ExtensionBuilder() 50 extension = extensions::ExtensionBuilder()
51 .SetManifest(extensions::DictionaryBuilder() 51 .SetManifest(extensions::DictionaryBuilder()
52 .Set("name", "Test extension") 52 .Set("name", "Test extension")
53 .Set("version", "1.0.0") 53 .Set("version", "1.0.0")
54 .Set("manifest_version", 2)) 54 .Set("manifest_version", 2))
55 .SetID("ahfgeienlihckogmohjhadlkjgocpleb") 55 .SetID("ahfgeienlihckogmohjhadlkjgocpleb")
56 .Build(); 56 .Build();
(...skipping 12 matching lines...) Expand all
69 .Set("version", "1.0.0") 69 .Set("version", "1.0.0")
70 .Set("manifest_version", 2)) 70 .Set("manifest_version", 2))
71 .SetID("mdhofdjgenpkhlmddfaegdjddcecipmo") 71 .SetID("mdhofdjgenpkhlmddfaegdjddcecipmo")
72 .Build(); 72 .Build();
73 extensions->Insert(extension); 73 extensions->Insert(extension);
74 return extensions.Pass(); 74 return extensions.Pass();
75 } 75 }
76 76
77 // Override GetClientID() to return a specific value on which test 77 // Override GetClientID() to return a specific value on which test
78 // expectations are based. 78 // expectations are based.
79 virtual uint64 GetClientID() OVERRIDE { return 0x3f1bfee9; } 79 virtual uint64 GetClientID() override { return 0x3f1bfee9; }
80 }; 80 };
81 81
82 } // namespace 82 } // namespace
83 83
84 // Checks that the hash function used to hide precise extension IDs produces 84 // Checks that the hash function used to hide precise extension IDs produces
85 // the expected values. 85 // the expected values.
86 TEST(ExtensionsMetricsProvider, HashExtension) { 86 TEST(ExtensionsMetricsProvider, HashExtension) {
87 EXPECT_EQ(978, 87 EXPECT_EQ(978,
88 TestExtensionsMetricsProvider::HashExtension( 88 TestExtensionsMetricsProvider::HashExtension(
89 "ahfgeienlihckogmohjhadlkjgocpleb", 0)); 89 "ahfgeienlihckogmohjhadlkjgocpleb", 0));
(...skipping 19 matching lines...) Expand all
109 &local_state, 109 &local_state,
110 base::Bind(&IsMetricsReportingEnabled), 110 base::Bind(&IsMetricsReportingEnabled),
111 base::Bind(&StoreNoClientInfoBackup), 111 base::Bind(&StoreNoClientInfoBackup),
112 base::Bind(&ReturnNoBackup))); 112 base::Bind(&ReturnNoBackup)));
113 TestExtensionsMetricsProvider extension_metrics(metrics_state_manager.get()); 113 TestExtensionsMetricsProvider extension_metrics(metrics_state_manager.get());
114 extension_metrics.ProvideSystemProfileMetrics(&system_profile); 114 extension_metrics.ProvideSystemProfileMetrics(&system_profile);
115 ASSERT_EQ(2, system_profile.occupied_extension_bucket_size()); 115 ASSERT_EQ(2, system_profile.occupied_extension_bucket_size());
116 EXPECT_EQ(10, system_profile.occupied_extension_bucket(0)); 116 EXPECT_EQ(10, system_profile.occupied_extension_bucket(0));
117 EXPECT_EQ(1007, system_profile.occupied_extension_bucket(1)); 117 EXPECT_EQ(1007, system_profile.occupied_extension_bucket(1));
118 } 118 }
OLDNEW
« no previous file with comments | « chrome/browser/metrics/extensions_metrics_provider.h ('k') | chrome/browser/metrics/field_trial_synchronizer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698