diff options
author | rtenneti@chromium.org <rtenneti@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-11 01:48:54 +0000 |
---|---|---|
committer | rtenneti@chromium.org <rtenneti@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-11 01:48:54 +0000 |
commit | 189163ee560220770ed5a119f6cfb9244c50c39d (patch) | |
tree | c24d6fce3397470234a2e22a9deae0243f83b5a8 /base | |
parent | aae2282336aed7a76bc30fa41fc746f13e941a63 (diff) | |
download | chromium_src-189163ee560220770ed5a119f6cfb9244c50c39d.zip chromium_src-189163ee560220770ed5a119f6cfb9244c50c39d.tar.gz chromium_src-189163ee560220770ed5a119f6cfb9244c50c39d.tar.bz2 |
Revert of 83710 which reverted 83641 - DNS Host resolver changes
with retry logic. Fix for bug Chromium cannot recover from a state
when its DNS requests have been dropped.
Whenever we try to resolve the host, we post a delayed task
to check if host resolution (OnLookupComplete) is completed
or not. If it hasn't completed, then we start a new job
to resolve for the same request.
BUG=73327
TEST=dns host resolver tests
R=eroman,jar
Review URL: http://codereview.chromium.org/6976006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@84908 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r-- | base/metrics/histogram_unittest.cc | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/base/metrics/histogram_unittest.cc b/base/metrics/histogram_unittest.cc index 496ff63..9d671df 100644 --- a/base/metrics/histogram_unittest.cc +++ b/base/metrics/histogram_unittest.cc @@ -288,6 +288,28 @@ TEST(HistogramTest, BoundsTest) { EXPECT_EQ(kBucketCount, array_size); EXPECT_EQ(0, sample.counts(array_size - 2)); EXPECT_EQ(2, sample.counts(array_size - 1)); + + std::vector<int> custom_ranges; + custom_ranges.push_back(10); + custom_ranges.push_back(50); + custom_ranges.push_back(100); + Histogram* test_custom_histogram(CustomHistogram::FactoryGet( + "TestCustomRangeBoundedHistogram", custom_ranges, Histogram::kNoFlags)); + + // Put two samples "out of bounds" above and below. + test_custom_histogram->Add(5); + test_custom_histogram->Add(-50); + test_custom_histogram->Add(100); + test_custom_histogram->Add(1000); + + // Verify they landed in the underflow, and overflow buckets. + Histogram::SampleSet custom_sample; + test_custom_histogram->SnapshotSample(&custom_sample); + EXPECT_EQ(2, custom_sample.counts(0)); + EXPECT_EQ(0, custom_sample.counts(1)); + size_t custom_array_size = test_custom_histogram->bucket_count(); + EXPECT_EQ(0, custom_sample.counts(custom_array_size - 2)); + EXPECT_EQ(2, custom_sample.counts(custom_array_size - 1)); } // Check to be sure samples land as expected is "correct" buckets. |