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

Unified Diff: chrome/browser/chromeos/gdata/gdata_contacts_service_browsertest.cc

Issue 10823182: contacts: Rate-limit GData photo requests and handle 404s. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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
Index: chrome/browser/chromeos/gdata/gdata_contacts_service_browsertest.cc
diff --git a/chrome/browser/chromeos/gdata/gdata_contacts_service_browsertest.cc b/chrome/browser/chromeos/gdata/gdata_contacts_service_browsertest.cc
index 5bf238ad458b349c6c9abda4af0c005bbda7d9e7..522f3146abd07b65a6e0c4c4e81e32394ed8f8a7 100644
--- a/chrome/browser/chromeos/gdata/gdata_contacts_service_browsertest.cc
+++ b/chrome/browser/chromeos/gdata/gdata_contacts_service_browsertest.cc
@@ -159,7 +159,11 @@ IN_PROC_BROWSER_TEST_F(GDataContactsServiceTest, BrokenFeeds) {
EXPECT_FALSE(Download("no_feed.json", base::Time(), &contacts));
EXPECT_FALSE(Download("no_category.json", base::Time(), &contacts));
EXPECT_FALSE(Download("wrong_category.json", base::Time(), &contacts));
- EXPECT_FALSE(Download("feed_photo_404.json", base::Time(), &contacts));
+
+ // Missing photos should be allowed, though (as this can occur in production).
+ EXPECT_TRUE(Download("feed_photo_404.json", base::Time(), &contacts));
+ ASSERT_EQ(static_cast<size_t>(1), contacts->size());
+ EXPECT_FALSE((*contacts)[0]->has_raw_untrusted_photo());
}
// Check that we're able to download an empty feed and a normal-looking feed
@@ -238,7 +242,7 @@ IN_PROC_BROWSER_TEST_F(GDataContactsServiceTest, Download) {
IN_PROC_BROWSER_TEST_F(GDataContactsServiceTest, ParallelPhotoDownload) {
// The feed used for this test contains 8 contacts.
const int kNumContacts = 8;
- service()->set_max_simultaneous_photo_downloads_for_testing(2);
+ service()->set_max_photo_downloads_per_second_for_testing(6);
Daniel Erat 2012/08/06 16:25:34 This means that the test will take at least a seco
satorux1 2012/08/06 20:57:08 Might want to add some comment? You might want to
Daniel Erat 2012/08/06 23:12:21 Done.
scoped_ptr<ScopedVector<contacts::Contact> > contacts;
EXPECT_TRUE(Download("feed_multiple_photos.json", base::Time(), &contacts));
ASSERT_EQ(static_cast<size_t>(kNumContacts), contacts->size());

Powered by Google App Engine
This is Rietveld 408576698