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

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

Issue 1259493003: Treat PPAPI disconnect as a crash for plugin metrics. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: more realistic test Created 5 years, 4 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
« no previous file with comments | « chrome/browser/metrics/plugin_metrics_provider.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/plugin_metrics_provider.h" 5 #include "chrome/browser/metrics/plugin_metrics_provider.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/prefs/pref_service.h" 10 #include "base/prefs/pref_service.h"
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 "1.5", true)); 163 "1.5", true));
164 provider.SetPluginsForTesting(plugins); 164 provider.SetPluginsForTesting(plugins);
165 metrics::SystemProfileProto system_profile; 165 metrics::SystemProfileProto system_profile;
166 provider.ProvideSystemProfileMetrics(&system_profile); 166 provider.ProvideSystemProfileMetrics(&system_profile);
167 167
168 // Increase number of created instances which should also start a delayed 168 // Increase number of created instances which should also start a delayed
169 // task. 169 // task.
170 content::ChildProcessData child_process_data(content::PROCESS_TYPE_PLUGIN); 170 content::ChildProcessData child_process_data(content::PROCESS_TYPE_PLUGIN);
171 child_process_data.name = base::UTF8ToUTF16("p1"); 171 child_process_data.name = base::UTF8ToUTF16("p1");
172 provider.BrowserChildProcessInstanceCreated(child_process_data); 172 provider.BrowserChildProcessInstanceCreated(child_process_data);
173 provider.BrowserChildProcessCrashed(child_process_data, 1);
174
175 provider.BrowserChildProcessInstanceCreated(child_process_data);
176 provider.BrowserChildProcessHostDisconnected(child_process_data);
173 177
174 // Call ProvideStabilityMetrics to check that it will force pending tasks to 178 // Call ProvideStabilityMetrics to check that it will force pending tasks to
175 // be executed immediately. 179 // be executed immediately.
176 provider.ProvideStabilityMetrics(&system_profile); 180 provider.ProvideStabilityMetrics(&system_profile);
177 181
178 // Check current number of instances created. 182 // Check current number of instances created.
179 const metrics::SystemProfileProto_Stability& stability = 183 const metrics::SystemProfileProto_Stability& stability =
180 system_profile.stability(); 184 system_profile.stability();
181 EXPECT_EQ(1, stability.plugin_stability(0).instance_count()); 185 EXPECT_EQ(2, stability.plugin_stability(0).instance_count());
186 EXPECT_EQ(2, stability.plugin_stability(0).crash_count());
182 } 187 }
OLDNEW
« no previous file with comments | « chrome/browser/metrics/plugin_metrics_provider.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698