diff options
author | elijahtaylor@chromium.org <elijahtaylor@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-13 14:08:18 +0000 |
---|---|---|
committer | elijahtaylor@chromium.org <elijahtaylor@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-13 14:08:18 +0000 |
commit | 65796dc249d7d5f31f07dd2e3f3af7eeede3e2d8 (patch) | |
tree | efff40093156198701c7468f7e1e1451c3f494cc /ppapi | |
parent | 1c2f808c894cc923b0cda477f95edfc20523eb90 (diff) | |
download | chromium_src-65796dc249d7d5f31f07dd2e3f3af7eeede3e2d8.zip chromium_src-65796dc249d7d5f31f07dd2e3f3af7eeede3e2d8.tar.gz chromium_src-65796dc249d7d5f31f07dd2e3f3af7eeede3e2d8.tar.bz2 |
Return a NULL histogram pointer on construction error
Check the pointer returned for the metricsPrivate API to keep from crashing Chrome with bad data.
BUG=334135
Review URL: https://codereview.chromium.org/141393002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@256822 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi')
-rw-r--r-- | ppapi/tests/test_uma.cc | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/ppapi/tests/test_uma.cc b/ppapi/tests/test_uma.cc index ef21005..c7bdbde 100644 --- a/ppapi/tests/test_uma.cc +++ b/ppapi/tests/test_uma.cc @@ -30,6 +30,11 @@ std::string TestUMA::TestCount() { uma_interface_->HistogramCustomCounts(instance, name, 30, 1, 100, 50); uma_interface_->HistogramCustomCounts(instance, name, 20, 1, 100, 50); uma_interface_->HistogramCustomCounts(instance, name, 40, 1, 100, 50); + // Test that passing in different construction arguments for the same + // histogram name does not crash. + uma_interface_->HistogramCustomCounts(instance, name, 40, 1, 100, 100); + uma_interface_->HistogramCustomCounts(instance, name, 40, 1, 90, 50); + uma_interface_->HistogramCustomCounts(instance, name, 40, 10, 100, 50); PASS(); } @@ -41,6 +46,11 @@ std::string TestUMA::TestTime() { uma_interface_->HistogramCustomTimes(instance, name, 1000, 1, 10000, 50); uma_interface_->HistogramCustomTimes(instance, name, 5000, 1, 10000, 50); uma_interface_->HistogramCustomTimes(instance, name, 10, 1, 10000, 50); + // Test that passing in different construction arguments for the same + // histogram name does not crash. + uma_interface_->HistogramCustomTimes(instance, name, 10, 1, 10000, 100); + uma_interface_->HistogramCustomTimes(instance, name, 10, 1, 9000, 50); + uma_interface_->HistogramCustomTimes(instance, name, 10, 100, 10000, 50); PASS(); } @@ -53,6 +63,9 @@ std::string TestUMA::TestEnum() { uma_interface_->HistogramEnumeration(instance, name, 3, 5); uma_interface_->HistogramEnumeration(instance, name, 1, 5); uma_interface_->HistogramEnumeration(instance, name, 2, 5); + // Test that passing in different construction arguments for the same + // histogram name does not crash. + uma_interface_->HistogramEnumeration(instance, name, 2, 6); PASS(); } |