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

Unified Diff: chrome/browser/metrics/metrics_log_unittest.cc

Issue 12036047: Add Brand Code to UMA Uploads (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 7 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/metrics/metrics_log.cc ('k') | chrome/common/metrics/proto/system_profile.proto » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/metrics/metrics_log_unittest.cc
diff --git a/chrome/browser/metrics/metrics_log_unittest.cc b/chrome/browser/metrics/metrics_log_unittest.cc
index 0f8a6a0a85d52aa173118d37ef6ae0f790e11470..639b62371257d75c6d8b95a2fd81893a77eb3435 100644
--- a/chrome/browser/metrics/metrics_log_unittest.cc
+++ b/chrome/browser/metrics/metrics_log_unittest.cc
@@ -10,6 +10,7 @@
#include "base/stringprintf.h"
#include "base/time.h"
#include "base/tracked_objects.h"
+#include "chrome/browser/google/google_util.h"
#include "chrome/browser/metrics/metrics_log.h"
#include "chrome/browser/prefs/browser_prefs.h"
#include "chrome/browser/prefs/pref_service.h"
@@ -37,6 +38,7 @@ const int kScreenWidth = 1024;
const int kScreenHeight = 768;
const int kScreenCount = 3;
const float kScreenScaleFactor = 2;
+const char kBrandForTesting[] = "brand_for_testing";
const chrome_variations::ActiveGroupId kFieldTrialIds[] = {
{37, 43},
{13, 47},
@@ -46,7 +48,8 @@ const chrome_variations::ActiveGroupId kFieldTrialIds[] = {
class TestMetricsLog : public MetricsLog {
public:
TestMetricsLog(const std::string& client_id, int session_id)
- : MetricsLog(client_id, session_id) {
+ : MetricsLog(client_id, session_id),
+ brand_for_testing_(kBrandForTesting) {
chrome::RegisterLocalState(&prefs_);
#if defined(OS_CHROMEOS)
@@ -99,6 +102,8 @@ class TestMetricsLog : public MetricsLog {
TestingPrefServiceSimple prefs_;
+ google_util::BrandForTesting brand_for_testing_;
+
DISALLOW_COPY_AND_ASSIGN(TestMetricsLog);
};
@@ -126,6 +131,8 @@ class MetricsLogTest : public testing::Test {
EXPECT_EQ(kFieldTrialIds[i].group, field_trial.group_id());
}
+ EXPECT_EQ(kBrandForTesting, system_profile.brand_code());
+
const metrics::SystemProfileProto::Hardware& hardware =
system_profile.hardware();
EXPECT_EQ(kScreenWidth, hardware.primary_screen_width());
« no previous file with comments | « chrome/browser/metrics/metrics_log.cc ('k') | chrome/common/metrics/proto/system_profile.proto » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698