| OLD | NEW |
| 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 "chrome/browser/metrics/metrics_service.h" | 5 #include "chrome/browser/metrics/metrics_service.h" |
| 6 | 6 |
| 7 #include <ctype.h> | 7 #include <ctype.h> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 EXPECT_TRUE(uma_log.has_system_profile()); | 259 EXPECT_TRUE(uma_log.has_system_profile()); |
| 260 EXPECT_EQ(0, uma_log.user_action_event_size()); | 260 EXPECT_EQ(0, uma_log.user_action_event_size()); |
| 261 EXPECT_EQ(0, uma_log.omnibox_event_size()); | 261 EXPECT_EQ(0, uma_log.omnibox_event_size()); |
| 262 EXPECT_EQ(0, uma_log.histogram_event_size()); | 262 EXPECT_EQ(0, uma_log.histogram_event_size()); |
| 263 EXPECT_EQ(0, uma_log.profiler_event_size()); | 263 EXPECT_EQ(0, uma_log.profiler_event_size()); |
| 264 EXPECT_EQ(0, uma_log.perf_data_size()); | 264 EXPECT_EQ(0, uma_log.perf_data_size()); |
| 265 | 265 |
| 266 EXPECT_EQ(1, uma_log.system_profile().stability().crash_count()); | 266 EXPECT_EQ(1, uma_log.system_profile().stability().crash_count()); |
| 267 } | 267 } |
| 268 | 268 |
| 269 TEST_F(MetricsServiceTest, RegisterSyntheticTrial) { | 269 // Crashes on at least Mac and Linux. http://crbug.com/320433 |
| 270 TEST_F(MetricsServiceTest, DISABLED_RegisterSyntheticTrial) { |
| 270 MetricsService service; | 271 MetricsService service; |
| 271 | 272 |
| 272 // Add two synthetic trials and confirm that they show up in the list. | 273 // Add two synthetic trials and confirm that they show up in the list. |
| 273 SyntheticTrialGroup trial1(metrics::HashName("TestTrial1"), | 274 SyntheticTrialGroup trial1(metrics::HashName("TestTrial1"), |
| 274 metrics::HashName("Group1"), | 275 metrics::HashName("Group1"), |
| 275 base::TimeTicks::Now()); | 276 base::TimeTicks::Now()); |
| 276 service.RegisterSyntheticFieldTrial(trial1); | 277 service.RegisterSyntheticFieldTrial(trial1); |
| 277 | 278 |
| 278 SyntheticTrialGroup trial2(metrics::HashName("TestTrial2"), | 279 SyntheticTrialGroup trial2(metrics::HashName("TestTrial2"), |
| 279 metrics::HashName("Group2"), | 280 metrics::HashName("Group2"), |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 311 service.log_manager_.FinishCurrentLog(); | 312 service.log_manager_.FinishCurrentLog(); |
| 312 service.log_manager_.BeginLoggingWithLog(new MetricsLog("clientID", 1), | 313 service.log_manager_.BeginLoggingWithLog(new MetricsLog("clientID", 1), |
| 313 MetricsLog::ONGOING_LOG); | 314 MetricsLog::ONGOING_LOG); |
| 314 service.GetCurrentSyntheticFieldTrials(&synthetic_trials); | 315 service.GetCurrentSyntheticFieldTrials(&synthetic_trials); |
| 315 EXPECT_EQ(3U, synthetic_trials.size()); | 316 EXPECT_EQ(3U, synthetic_trials.size()); |
| 316 EXPECT_TRUE(HasSyntheticTrial(synthetic_trials, "TestTrial1", "Group2")); | 317 EXPECT_TRUE(HasSyntheticTrial(synthetic_trials, "TestTrial1", "Group2")); |
| 317 EXPECT_TRUE(HasSyntheticTrial(synthetic_trials, "TestTrial2", "Group2")); | 318 EXPECT_TRUE(HasSyntheticTrial(synthetic_trials, "TestTrial2", "Group2")); |
| 318 EXPECT_TRUE(HasSyntheticTrial(synthetic_trials, "TestTrial3", "Group3")); | 319 EXPECT_TRUE(HasSyntheticTrial(synthetic_trials, "TestTrial3", "Group3")); |
| 319 service.log_manager_.FinishCurrentLog(); | 320 service.log_manager_.FinishCurrentLog(); |
| 320 } | 321 } |
| OLD | NEW |