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

Unified Diff: third_party/libaddressinput/chromium/cpp/test/retriever_test.cc

Issue 115523011: [rAc - libaddressinput] slay a Helper class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: assert instead Created 6 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/libaddressinput/chromium/cpp/src/retriever.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/libaddressinput/chromium/cpp/test/retriever_test.cc
diff --git a/third_party/libaddressinput/chromium/cpp/test/retriever_test.cc b/third_party/libaddressinput/chromium/cpp/test/retriever_test.cc
index 42a4b50074a8fd0f415a00f49bd58c32a7aca48d..15674fe4d91742c029f92649c191d14eff8b431d 100644
--- a/third_party/libaddressinput/chromium/cpp/test/retriever_test.cc
+++ b/third_party/libaddressinput/chromium/cpp/test/retriever_test.cc
@@ -122,6 +122,32 @@ TEST_F(RetrieverTest, FaultyDownloader) {
EXPECT_TRUE(data_.empty());
}
+// The downloader that doesn't get back to you.
+class HangingDownloader : public Downloader {
+ public:
+ HangingDownloader() {}
+ virtual ~HangingDownloader() {}
+
+ // Downloader implementation.
+ virtual void Download(const std::string& url,
+ scoped_ptr<Callback> downloaded) const {}
+};
+
+TEST_F(RetrieverTest, RequestsDontStack) {
+ Retriever slow_retriever(FakeDownloader::kFakeDataUrl,
+ scoped_ptr<const Downloader>(new HangingDownloader),
+ scoped_ptr<Storage>(new FakeStorage));
+
+ slow_retriever.Retrieve(kKey, BuildCallback());
+ EXPECT_FALSE(success_);
+ EXPECT_TRUE(key_.empty());
+
+#if !defined(NDEBUG)
+ // This request should cause an assert.
+ ASSERT_DEATH(slow_retriever.Retrieve(kKey, BuildCallback()), "");
+#endif
+}
+
} // namespace
} // namespace addressinput
« no previous file with comments | « third_party/libaddressinput/chromium/cpp/src/retriever.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698