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

Side by Side Diff: ppapi/tests/test_uma.cc

Issue 141393002: Return a NULL histogram pointer on construction error (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase, git cl format Created 6 years, 9 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/test/data/extensions/api_test/metrics/test.js ('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 (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "ppapi/tests/test_uma.h" 5 #include "ppapi/tests/test_uma.h"
6 6
7 #include "ppapi/cpp/instance.h" 7 #include "ppapi/cpp/instance.h"
8 #include "ppapi/cpp/module.h" 8 #include "ppapi/cpp/module.h"
9 #include "ppapi/tests/testing_instance.h" 9 #include "ppapi/tests/testing_instance.h"
10 10
(...skipping 12 matching lines...) Expand all
23 } 23 }
24 24
25 std::string TestUMA::TestCount() { 25 std::string TestUMA::TestCount() {
26 pp::Var name_var = pp::Var("Test.CountHistogram"); 26 pp::Var name_var = pp::Var("Test.CountHistogram");
27 PP_Var name = name_var.pp_var(); 27 PP_Var name = name_var.pp_var();
28 PP_Instance instance = instance_->pp_instance(); 28 PP_Instance instance = instance_->pp_instance();
29 uma_interface_->HistogramCustomCounts(instance, name, 10, 1, 100, 50); 29 uma_interface_->HistogramCustomCounts(instance, name, 10, 1, 100, 50);
30 uma_interface_->HistogramCustomCounts(instance, name, 30, 1, 100, 50); 30 uma_interface_->HistogramCustomCounts(instance, name, 30, 1, 100, 50);
31 uma_interface_->HistogramCustomCounts(instance, name, 20, 1, 100, 50); 31 uma_interface_->HistogramCustomCounts(instance, name, 20, 1, 100, 50);
32 uma_interface_->HistogramCustomCounts(instance, name, 40, 1, 100, 50); 32 uma_interface_->HistogramCustomCounts(instance, name, 40, 1, 100, 50);
33 // Test that passing in different construction arguments for the same
34 // histogram name does not crash.
35 uma_interface_->HistogramCustomCounts(instance, name, 40, 1, 100, 100);
36 uma_interface_->HistogramCustomCounts(instance, name, 40, 1, 90, 50);
37 uma_interface_->HistogramCustomCounts(instance, name, 40, 10, 100, 50);
33 PASS(); 38 PASS();
34 } 39 }
35 40
36 std::string TestUMA::TestTime() { 41 std::string TestUMA::TestTime() {
37 pp::Var name_var = pp::Var("Test.TimeHistogram"); 42 pp::Var name_var = pp::Var("Test.TimeHistogram");
38 PP_Var name = name_var.pp_var(); 43 PP_Var name = name_var.pp_var();
39 PP_Instance instance = instance_->pp_instance(); 44 PP_Instance instance = instance_->pp_instance();
40 uma_interface_->HistogramCustomTimes(instance, name, 100, 1, 10000, 50); 45 uma_interface_->HistogramCustomTimes(instance, name, 100, 1, 10000, 50);
41 uma_interface_->HistogramCustomTimes(instance, name, 1000, 1, 10000, 50); 46 uma_interface_->HistogramCustomTimes(instance, name, 1000, 1, 10000, 50);
42 uma_interface_->HistogramCustomTimes(instance, name, 5000, 1, 10000, 50); 47 uma_interface_->HistogramCustomTimes(instance, name, 5000, 1, 10000, 50);
43 uma_interface_->HistogramCustomTimes(instance, name, 10, 1, 10000, 50); 48 uma_interface_->HistogramCustomTimes(instance, name, 10, 1, 10000, 50);
49 // Test that passing in different construction arguments for the same
50 // histogram name does not crash.
51 uma_interface_->HistogramCustomTimes(instance, name, 10, 1, 10000, 100);
52 uma_interface_->HistogramCustomTimes(instance, name, 10, 1, 9000, 50);
53 uma_interface_->HistogramCustomTimes(instance, name, 10, 100, 10000, 50);
44 PASS(); 54 PASS();
45 } 55 }
46 56
47 std::string TestUMA::TestEnum() { 57 std::string TestUMA::TestEnum() {
48 pp::Var name_var = pp::Var("Test.EnumHistogram"); 58 pp::Var name_var = pp::Var("Test.EnumHistogram");
49 PP_Var name = name_var.pp_var(); 59 PP_Var name = name_var.pp_var();
50 PP_Instance instance = instance_->pp_instance(); 60 PP_Instance instance = instance_->pp_instance();
51 uma_interface_->HistogramEnumeration(instance, name, 0, 5); 61 uma_interface_->HistogramEnumeration(instance, name, 0, 5);
52 uma_interface_->HistogramEnumeration(instance, name, 3, 5); 62 uma_interface_->HistogramEnumeration(instance, name, 3, 5);
53 uma_interface_->HistogramEnumeration(instance, name, 3, 5); 63 uma_interface_->HistogramEnumeration(instance, name, 3, 5);
54 uma_interface_->HistogramEnumeration(instance, name, 1, 5); 64 uma_interface_->HistogramEnumeration(instance, name, 1, 5);
55 uma_interface_->HistogramEnumeration(instance, name, 2, 5); 65 uma_interface_->HistogramEnumeration(instance, name, 2, 5);
66 // Test that passing in different construction arguments for the same
67 // histogram name does not crash.
68 uma_interface_->HistogramEnumeration(instance, name, 2, 6);
56 PASS(); 69 PASS();
57 } 70 }
58 71
OLDNEW
« no previous file with comments | « chrome/test/data/extensions/api_test/metrics/test.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698