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

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: merge 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
« no previous file with comments | « chrome/browser/chromeos/gdata/gdata_contacts_service.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..c62b5fcf530e8e12dcfb7e265546bbf1ea5ce275 100644
--- a/chrome/browser/chromeos/gdata/gdata_contacts_service_browsertest.cc
+++ b/chrome/browser/chromeos/gdata/gdata_contacts_service_browsertest.cc
@@ -83,6 +83,8 @@ class GDataContactsServiceTest : public InProcessBrowserTest {
service_->set_rewrite_photo_url_callback_for_testing(
base::Bind(&GDataContactsServiceTest::RewritePhotoUrl,
base::Unretained(this)));
+ service_->set_photo_download_timer_interval_for_testing(
+ base::TimeDelta::FromMilliseconds(10));
}
virtual void CleanUpOnMainThread() {
@@ -159,7 +161,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 +244,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);
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());
« no previous file with comments | « chrome/browser/chromeos/gdata/gdata_contacts_service.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698