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

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

Issue 108683003: Store gpu crashes in the systemprofileproto (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Alexei comments1 Created 7 years 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 (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_log.h" 5 #include "chrome/browser/metrics/metrics_log.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/base64.h" 9 #include "base/base64.h"
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after
377 EXPECT_TRUE(stability.has_launch_count()); 377 EXPECT_TRUE(stability.has_launch_count());
378 EXPECT_TRUE(stability.has_crash_count()); 378 EXPECT_TRUE(stability.has_crash_count());
379 // Initial log metrics: 379 // Initial log metrics:
380 EXPECT_FALSE(stability.has_incomplete_shutdown_count()); 380 EXPECT_FALSE(stability.has_incomplete_shutdown_count());
381 EXPECT_FALSE(stability.has_breakpad_registration_success_count()); 381 EXPECT_FALSE(stability.has_breakpad_registration_success_count());
382 EXPECT_FALSE(stability.has_breakpad_registration_failure_count()); 382 EXPECT_FALSE(stability.has_breakpad_registration_failure_count());
383 EXPECT_FALSE(stability.has_debugger_present_count()); 383 EXPECT_FALSE(stability.has_debugger_present_count());
384 EXPECT_FALSE(stability.has_debugger_not_present_count()); 384 EXPECT_FALSE(stability.has_debugger_not_present_count());
385 } 385 }
386 386
387 TEST_F(MetricsLogTest, GpuCrashMetric) {
388 TestMetricsLog log(kClientId, kSessionId);
389 log.GetPrefService()->SetInteger(prefs::kStabilityGpuCrashCount, 12);
390 log.RecordEnvironment(std::vector<content::WebPluginInfo>(),
391 GoogleUpdateMetrics(),
392 std::vector<chrome_variations::ActiveGroupId>());
393 log.RecordStabilityMetrics(base::TimeDelta(), MetricsLog::ONGOING_LOG);
394 const metrics::SystemProfileProto_Stability& stability =
395 log.system_profile().stability();
396 EXPECT_EQ(12, stability.gpu_crash_count());
397 }
398
387 #if defined(ENABLE_PLUGINS) 399 #if defined(ENABLE_PLUGINS)
388 TEST_F(MetricsLogTest, Plugins) { 400 TEST_F(MetricsLogTest, Plugins) {
389 TestMetricsLog log(kClientId, kSessionId); 401 TestMetricsLog log(kClientId, kSessionId);
390 402
391 std::vector<content::WebPluginInfo> plugins; 403 std::vector<content::WebPluginInfo> plugins;
392 plugins.push_back(CreateFakePluginInfo("p1", FILE_PATH_LITERAL("p1.plugin"), 404 plugins.push_back(CreateFakePluginInfo("p1", FILE_PATH_LITERAL("p1.plugin"),
393 "1.5", true)); 405 "1.5", true));
394 plugins.push_back(CreateFakePluginInfo("p2", FILE_PATH_LITERAL("p2.plugin"), 406 plugins.push_back(CreateFakePluginInfo("p2", FILE_PATH_LITERAL("p2.plugin"),
395 "2.0", false)); 407 "2.0", false));
396 log.RecordEnvironment(plugins, GoogleUpdateMetrics(), 408 log.RecordEnvironment(plugins, GoogleUpdateMetrics(),
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
606 TestMetricsLog log(kClientId, kSessionId); 618 TestMetricsLog log(kClientId, kSessionId);
607 EXPECT_EQ(1u, log.system_profile().multi_profile_user_count()); 619 EXPECT_EQ(1u, log.system_profile().multi_profile_user_count());
608 620
609 user_manager->LoginUser(user2); 621 user_manager->LoginUser(user2);
610 std::vector<chrome_variations::ActiveGroupId> synthetic_trials; 622 std::vector<chrome_variations::ActiveGroupId> synthetic_trials;
611 log.RecordEnvironment(std::vector<content::WebPluginInfo>(), 623 log.RecordEnvironment(std::vector<content::WebPluginInfo>(),
612 GoogleUpdateMetrics(), synthetic_trials); 624 GoogleUpdateMetrics(), synthetic_trials);
613 EXPECT_EQ(0u, log.system_profile().multi_profile_user_count()); 625 EXPECT_EQ(0u, log.system_profile().multi_profile_user_count());
614 } 626 }
615 #endif // OS_CHROMEOS 627 #endif // OS_CHROMEOS
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698