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

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: add test 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..d5429d4008543d712a1b2ff02c93e3c28345cc2c 100644
--- a/chrome/browser/metrics/metrics_log_unittest.cc
+++ b/chrome/browser/metrics/metrics_log_unittest.cc
@@ -5,11 +5,13 @@
#include <string>
#include "base/basictypes.h"
+#include "base/memory/scoped_ptr.h"
#include "base/port.h"
#include "base/string_util.h"
#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 +39,7 @@ const int kScreenWidth = 1024;
const int kScreenHeight = 768;
const int kScreenCount = 3;
const float kScreenScaleFactor = 2;
+const char* kBrandForTesting = "brand_for_testing";
Ilya Sherman 2013/01/24 00:31:46 nit: This should have type "const char kBrandForTe
Mark P 2013/01/24 00:43:05 Done.
const chrome_variations::ActiveGroupId kFieldTrialIds[] = {
{37, 43},
{13, 47},
@@ -48,6 +51,8 @@ class TestMetricsLog : public MetricsLog {
TestMetricsLog(const std::string& client_id, int session_id)
: MetricsLog(client_id, session_id) {
chrome::RegisterLocalState(&prefs_);
+ brand_for_testing_.reset(
+ new google_util::BrandForTesting(kBrandForTesting));
#if defined(OS_CHROMEOS)
prefs_.SetInteger(prefs::kStabilityChildProcessCrashCount, 10);
@@ -99,6 +104,8 @@ class TestMetricsLog : public MetricsLog {
TestingPrefServiceSimple prefs_;
+ scoped_ptr<google_util::BrandForTesting> brand_for_testing_;
Ilya Sherman 2013/01/23 23:32:54 nit: No need to use a pointer; just allocate as a
Mark P 2013/01/23 23:49:26 I can do that if I make the kBrandForTesting a str
Ilya Sherman 2013/01/24 00:31:46 I don't think the explicit on BrandForTesting's co
Mark P 2013/01/24 00:43:05 Works now (without the explicit conversion). Dunn
+
DISALLOW_COPY_AND_ASSIGN(TestMetricsLog);
};
@@ -126,6 +133,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