summaryrefslogtreecommitdiffstats
path: root/base
diff options
context:
space:
mode:
authorrtenneti@chromium.org <rtenneti@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-30 00:38:19 +0000
committerrtenneti@chromium.org <rtenneti@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-30 00:38:19 +0000
commitbcf09fc7ff33c6bd4058f515baa5ab3133f355ec (patch)
tree5a21b8d0fc2fc80e2c5fb693b4d4a0324b44a6c0 /base
parentb15c6493ab3a7d99df7fe45c260de4145bf22406 (diff)
downloadchromium_src-bcf09fc7ff33c6bd4058f515baa5ab3133f355ec.zip
chromium_src-bcf09fc7ff33c6bd4058f515baa5ab3133f355ec.tar.gz
chromium_src-bcf09fc7ff33c6bd4058f515baa5ab3133f355ec.tar.bz2
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 the original ateempt hasn't completed, then we start another attempt to resolve for the same request. We take the results from the attempt that finishes first and leave all other attempts as orphaned. BUG=73327 TEST=dns host resolver tests R=eroman,jar Review URL: http://codereview.chromium.org/6782001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@83641 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r--base/metrics/histogram_unittest.cc22
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.