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

Side by Side Diff: sync/internal_api/attachments/attachment_service_impl_unittest.cc

Issue 982883002: [Sync] Add size and crc32c to AttachmentId. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix argument evaluation order bug. Created 5 years, 9 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "sync/internal_api/public/attachments/attachment_service_impl.h" 5 #include "sync/internal_api/public/attachments/attachment_service_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/memory/weak_ptr.h" 8 #include "base/memory/weak_ptr.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 AttachmentIdList ids = read_ids.back(); 61 AttachmentIdList ids = read_ids.back();
62 read_callbacks.pop_back(); 62 read_callbacks.pop_back();
63 read_ids.pop_back(); 63 read_ids.pop_back();
64 64
65 scoped_ptr<AttachmentMap> attachments(new AttachmentMap()); 65 scoped_ptr<AttachmentMap> attachments(new AttachmentMap());
66 scoped_ptr<AttachmentIdList> unavailable_attachments( 66 scoped_ptr<AttachmentIdList> unavailable_attachments(
67 new AttachmentIdList()); 67 new AttachmentIdList());
68 for (AttachmentIdList::const_iterator iter = ids.begin(); iter != ids.end(); 68 for (AttachmentIdList::const_iterator iter = ids.begin(); iter != ids.end();
69 ++iter) { 69 ++iter) {
70 if (local_attachments.find(*iter) != local_attachments.end()) { 70 if (local_attachments.find(*iter) != local_attachments.end()) {
71 uint32_t crc32c = ComputeCrc32c(data); 71 Attachment attachment = Attachment::CreateFromParts(*iter, data);
72 Attachment attachment =
73 Attachment::CreateFromParts(*iter, data, crc32c);
74 attachments->insert(std::make_pair(*iter, attachment)); 72 attachments->insert(std::make_pair(*iter, attachment));
75 } else { 73 } else {
76 unavailable_attachments->push_back(*iter); 74 unavailable_attachments->push_back(*iter);
77 } 75 }
78 } 76 }
79 Result result = 77 Result result =
80 unavailable_attachments->empty() ? SUCCESS : UNSPECIFIED_ERROR; 78 unavailable_attachments->empty() ? SUCCESS : UNSPECIFIED_ERROR;
81 79
82 base::MessageLoop::current()->PostTask( 80 base::MessageLoop::current()->PostTask(
83 FROM_HERE, 81 FROM_HERE,
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 download_requests.insert(std::make_pair(id, callback)); 118 download_requests.insert(std::make_pair(id, callback));
121 } 119 }
122 120
123 // Multiple requests to download will be active at the same time. 121 // Multiple requests to download will be active at the same time.
124 // RespondToDownload should respond to only one of them. 122 // RespondToDownload should respond to only one of them.
125 void RespondToDownload(const AttachmentId& id, const DownloadResult& result) { 123 void RespondToDownload(const AttachmentId& id, const DownloadResult& result) {
126 ASSERT_TRUE(download_requests.find(id) != download_requests.end()); 124 ASSERT_TRUE(download_requests.find(id) != download_requests.end());
127 scoped_ptr<Attachment> attachment; 125 scoped_ptr<Attachment> attachment;
128 if (result == DOWNLOAD_SUCCESS) { 126 if (result == DOWNLOAD_SUCCESS) {
129 scoped_refptr<base::RefCountedString> data = new base::RefCountedString(); 127 scoped_refptr<base::RefCountedString> data = new base::RefCountedString();
130 uint32_t crc32c = ComputeCrc32c(data); 128 attachment.reset(new Attachment(Attachment::CreateFromParts(id, data)));
131 attachment.reset(
132 new Attachment(Attachment::CreateFromParts(id, data, crc32c)));
133 } 129 }
134 base::MessageLoop::current()->PostTask( 130 base::MessageLoop::current()->PostTask(
135 FROM_HERE, 131 FROM_HERE,
136 base::Bind(download_requests[id], result, base::Passed(&attachment))); 132 base::Bind(download_requests[id], result, base::Passed(&attachment)));
137 133
138 download_requests.erase(id); 134 download_requests.erase(id);
139 } 135 }
140 136
141 std::map<AttachmentId, DownloadCallback> download_requests; 137 std::map<AttachmentId, DownloadCallback> download_requests;
142 138
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 download_callback()); 298 download_callback());
303 store()->RespondToRead(AttachmentIdSet()); 299 store()->RespondToRead(AttachmentIdSet());
304 300
305 RunLoop(); 301 RunLoop();
306 EXPECT_EQ(1U, download_results().size()); 302 EXPECT_EQ(1U, download_results().size());
307 EXPECT_EQ(0U, last_download_attachments().size()); 303 EXPECT_EQ(0U, last_download_attachments().size());
308 } 304 }
309 305
310 TEST_F(AttachmentServiceImplTest, GetOrDownload_Local) { 306 TEST_F(AttachmentServiceImplTest, GetOrDownload_Local) {
311 AttachmentIdList attachment_ids; 307 AttachmentIdList attachment_ids;
312 attachment_ids.push_back(AttachmentId::Create()); 308 attachment_ids.push_back(AttachmentId::Create(0, 0));
313 attachment_service()->GetOrDownloadAttachments(attachment_ids, 309 attachment_service()->GetOrDownloadAttachments(attachment_ids,
314 download_callback()); 310 download_callback());
315 AttachmentIdSet local_attachments; 311 AttachmentIdSet local_attachments;
316 local_attachments.insert(attachment_ids[0]); 312 local_attachments.insert(attachment_ids[0]);
317 store()->RespondToRead(local_attachments); 313 store()->RespondToRead(local_attachments);
318 314
319 RunLoop(); 315 RunLoop();
320 EXPECT_EQ(1U, download_results().size()); 316 EXPECT_EQ(1U, download_results().size());
321 EXPECT_EQ(1U, last_download_attachments().size()); 317 EXPECT_EQ(1U, last_download_attachments().size());
322 EXPECT_TRUE(last_download_attachments().find(attachment_ids[0]) != 318 EXPECT_TRUE(last_download_attachments().find(attachment_ids[0]) !=
323 last_download_attachments().end()); 319 last_download_attachments().end());
324 } 320 }
325 321
326 TEST_F(AttachmentServiceImplTest, GetOrDownload_LocalRemoteUnavailable) { 322 TEST_F(AttachmentServiceImplTest, GetOrDownload_LocalRemoteUnavailable) {
327 // Create attachment list with 4 ids. 323 // Create attachment list with 4 ids.
328 AttachmentIdList attachment_ids; 324 AttachmentIdList attachment_ids;
329 attachment_ids.push_back(AttachmentId::Create()); 325 attachment_ids.push_back(AttachmentId::Create(0, 0));
330 attachment_ids.push_back(AttachmentId::Create()); 326 attachment_ids.push_back(AttachmentId::Create(0, 0));
331 attachment_ids.push_back(AttachmentId::Create()); 327 attachment_ids.push_back(AttachmentId::Create(0, 0));
332 attachment_ids.push_back(AttachmentId::Create()); 328 attachment_ids.push_back(AttachmentId::Create(0, 0));
333 // Call attachment service. 329 // Call attachment service.
334 attachment_service()->GetOrDownloadAttachments(attachment_ids, 330 attachment_service()->GetOrDownloadAttachments(attachment_ids,
335 download_callback()); 331 download_callback());
336 // Ensure AttachmentStore is called. 332 // Ensure AttachmentStore is called.
337 EXPECT_FALSE(store()->read_ids.empty()); 333 EXPECT_FALSE(store()->read_ids.empty());
338 334
339 // Make AttachmentStore return only attachment 0. 335 // Make AttachmentStore return only attachment 0.
340 AttachmentIdSet local_attachments; 336 AttachmentIdSet local_attachments;
341 local_attachments.insert(attachment_ids[0]); 337 local_attachments.insert(attachment_ids[0]);
342 store()->RespondToRead(local_attachments); 338 store()->RespondToRead(local_attachments);
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
388 } 384 }
389 385
390 TEST_F(AttachmentServiceImplTest, GetOrDownload_NoDownloader) { 386 TEST_F(AttachmentServiceImplTest, GetOrDownload_NoDownloader) {
391 // No downloader. 387 // No downloader.
392 InitializeAttachmentService( 388 InitializeAttachmentService(
393 make_scoped_ptr<MockAttachmentUploader>(new MockAttachmentUploader()), 389 make_scoped_ptr<MockAttachmentUploader>(new MockAttachmentUploader()),
394 make_scoped_ptr<MockAttachmentDownloader>(NULL), 390 make_scoped_ptr<MockAttachmentDownloader>(NULL),
395 this); 391 this);
396 392
397 AttachmentIdList attachment_ids; 393 AttachmentIdList attachment_ids;
398 attachment_ids.push_back(AttachmentId::Create()); 394 attachment_ids.push_back(AttachmentId::Create(0, 0));
399 attachment_service()->GetOrDownloadAttachments(attachment_ids, 395 attachment_service()->GetOrDownloadAttachments(attachment_ids,
400 download_callback()); 396 download_callback());
401 EXPECT_FALSE(store()->read_ids.empty()); 397 EXPECT_FALSE(store()->read_ids.empty());
402 398
403 AttachmentIdSet local_attachments; 399 AttachmentIdSet local_attachments;
404 store()->RespondToRead(local_attachments); 400 store()->RespondToRead(local_attachments);
405 RunLoop(); 401 RunLoop();
406 ASSERT_EQ(1U, download_results().size()); 402 ASSERT_EQ(1U, download_results().size());
407 EXPECT_EQ(AttachmentService::GET_UNSPECIFIED_ERROR, download_results()[0]); 403 EXPECT_EQ(AttachmentService::GET_UNSPECIFIED_ERROR, download_results()[0]);
408 EXPECT_TRUE(last_download_attachments().empty()); 404 EXPECT_TRUE(last_download_attachments().empty());
409 } 405 }
410 406
411 TEST_F(AttachmentServiceImplTest, UploadAttachments_Success) { 407 TEST_F(AttachmentServiceImplTest, UploadAttachments_Success) {
412 AttachmentIdSet attachment_ids; 408 AttachmentIdSet attachment_ids;
413 const unsigned num_attachments = 3; 409 const unsigned num_attachments = 3;
414 for (unsigned i = 0; i < num_attachments; ++i) { 410 for (unsigned i = 0; i < num_attachments; ++i) {
415 attachment_ids.insert(AttachmentId::Create()); 411 attachment_ids.insert(AttachmentId::Create(0, 0));
416 } 412 }
417 attachment_service()->UploadAttachments(attachment_ids); 413 attachment_service()->UploadAttachments(attachment_ids);
418 414
419 for (unsigned i = 0; i < num_attachments; ++i) { 415 for (unsigned i = 0; i < num_attachments; ++i) {
420 RunLoopAndFireTimer(); 416 RunLoopAndFireTimer();
421 // See that the service has issued a read for at least one of the 417 // See that the service has issued a read for at least one of the
422 // attachments. 418 // attachments.
423 ASSERT_GE(store()->read_ids.size(), 1U); 419 ASSERT_GE(store()->read_ids.size(), 1U);
424 store()->RespondToRead(attachment_ids); 420 store()->RespondToRead(attachment_ids);
425 RunLoop(); 421 RunLoop();
(...skipping 13 matching lines...) Expand all
439 EXPECT_THAT(on_attachment_uploaded_list(), testing::Contains(*iter)); 435 EXPECT_THAT(on_attachment_uploaded_list(), testing::Contains(*iter));
440 } 436 }
441 } 437 }
442 438
443 TEST_F(AttachmentServiceImplTest, UploadAttachments_Success_NoDelegate) { 439 TEST_F(AttachmentServiceImplTest, UploadAttachments_Success_NoDelegate) {
444 InitializeAttachmentService(make_scoped_ptr(new MockAttachmentUploader()), 440 InitializeAttachmentService(make_scoped_ptr(new MockAttachmentUploader()),
445 make_scoped_ptr(new MockAttachmentDownloader()), 441 make_scoped_ptr(new MockAttachmentDownloader()),
446 NULL); // No delegate. 442 NULL); // No delegate.
447 443
448 AttachmentIdSet attachment_ids; 444 AttachmentIdSet attachment_ids;
449 attachment_ids.insert(AttachmentId::Create()); 445 attachment_ids.insert(AttachmentId::Create(0, 0));
450 attachment_service()->UploadAttachments(attachment_ids); 446 attachment_service()->UploadAttachments(attachment_ids);
451 RunLoopAndFireTimer(); 447 RunLoopAndFireTimer();
452 ASSERT_EQ(1U, store()->read_ids.size()); 448 ASSERT_EQ(1U, store()->read_ids.size());
453 ASSERT_EQ(0U, uploader()->upload_requests.size()); 449 ASSERT_EQ(0U, uploader()->upload_requests.size());
454 store()->RespondToRead(attachment_ids); 450 store()->RespondToRead(attachment_ids);
455 RunLoop(); 451 RunLoop();
456 ASSERT_EQ(0U, store()->read_ids.size()); 452 ASSERT_EQ(0U, store()->read_ids.size());
457 ASSERT_EQ(1U, uploader()->upload_requests.size()); 453 ASSERT_EQ(1U, uploader()->upload_requests.size());
458 uploader()->RespondToUpload(*attachment_ids.begin(), 454 uploader()->RespondToUpload(*attachment_ids.begin(),
459 AttachmentUploader::UPLOAD_SUCCESS); 455 AttachmentUploader::UPLOAD_SUCCESS);
460 RunLoop(); 456 RunLoop();
461 ASSERT_TRUE(on_attachment_uploaded_list().empty()); 457 ASSERT_TRUE(on_attachment_uploaded_list().empty());
462 } 458 }
463 459
464 TEST_F(AttachmentServiceImplTest, UploadAttachments_SomeMissingFromStore) { 460 TEST_F(AttachmentServiceImplTest, UploadAttachments_SomeMissingFromStore) {
465 AttachmentIdSet attachment_ids; 461 AttachmentIdSet attachment_ids;
466 attachment_ids.insert(AttachmentId::Create()); 462 attachment_ids.insert(AttachmentId::Create(0, 0));
467 attachment_ids.insert(AttachmentId::Create()); 463 attachment_ids.insert(AttachmentId::Create(0, 0));
468 attachment_service()->UploadAttachments(attachment_ids); 464 attachment_service()->UploadAttachments(attachment_ids);
469 RunLoopAndFireTimer(); 465 RunLoopAndFireTimer();
470 ASSERT_GE(store()->read_ids.size(), 1U); 466 ASSERT_GE(store()->read_ids.size(), 1U);
471 467
472 ASSERT_EQ(0U, uploader()->upload_requests.size()); 468 ASSERT_EQ(0U, uploader()->upload_requests.size());
473 store()->RespondToRead(attachment_ids); 469 store()->RespondToRead(attachment_ids);
474 RunLoop(); 470 RunLoop();
475 ASSERT_EQ(1U, uploader()->upload_requests.size()); 471 ASSERT_EQ(1U, uploader()->upload_requests.size());
476 472
477 uploader()->RespondToUpload(uploader()->upload_requests.begin()->first, 473 uploader()->RespondToUpload(uploader()->upload_requests.begin()->first,
478 AttachmentUploader::UPLOAD_SUCCESS); 474 AttachmentUploader::UPLOAD_SUCCESS);
479 RunLoopAndFireTimer(); 475 RunLoopAndFireTimer();
480 ASSERT_EQ(1U, on_attachment_uploaded_list().size()); 476 ASSERT_EQ(1U, on_attachment_uploaded_list().size());
481 ASSERT_GE(store()->read_ids.size(), 1U); 477 ASSERT_GE(store()->read_ids.size(), 1U);
482 // Not found! 478 // Not found!
483 store()->RespondToRead(AttachmentIdSet()); 479 store()->RespondToRead(AttachmentIdSet());
484 RunLoop(); 480 RunLoop();
485 // No upload requests since the read failed. 481 // No upload requests since the read failed.
486 ASSERT_EQ(0U, uploader()->upload_requests.size()); 482 ASSERT_EQ(0U, uploader()->upload_requests.size());
487 } 483 }
488 484
489 TEST_F(AttachmentServiceImplTest, UploadAttachments_AllMissingFromStore) { 485 TEST_F(AttachmentServiceImplTest, UploadAttachments_AllMissingFromStore) {
490 AttachmentIdSet attachment_ids; 486 AttachmentIdSet attachment_ids;
491 const unsigned num_attachments = 2; 487 const unsigned num_attachments = 2;
492 for (unsigned i = 0; i < num_attachments; ++i) { 488 for (unsigned i = 0; i < num_attachments; ++i) {
493 attachment_ids.insert(AttachmentId::Create()); 489 attachment_ids.insert(AttachmentId::Create(0, 0));
494 } 490 }
495 attachment_service()->UploadAttachments(attachment_ids); 491 attachment_service()->UploadAttachments(attachment_ids);
496 492
497 for (unsigned i = 0; i < num_attachments; ++i) { 493 for (unsigned i = 0; i < num_attachments; ++i) {
498 RunLoopAndFireTimer(); 494 RunLoopAndFireTimer();
499 ASSERT_GE(store()->read_ids.size(), 1U); 495 ASSERT_GE(store()->read_ids.size(), 1U);
500 // None found! 496 // None found!
501 store()->RespondToRead(AttachmentIdSet()); 497 store()->RespondToRead(AttachmentIdSet());
502 } 498 }
503 RunLoop(); 499 RunLoop();
504 500
505 // Nothing uploaded. 501 // Nothing uploaded.
506 EXPECT_EQ(0U, uploader()->upload_requests.size()); 502 EXPECT_EQ(0U, uploader()->upload_requests.size());
507 // See that the delegate was never called. 503 // See that the delegate was never called.
508 ASSERT_EQ(0U, on_attachment_uploaded_list().size()); 504 ASSERT_EQ(0U, on_attachment_uploaded_list().size());
509 } 505 }
510 506
511 TEST_F(AttachmentServiceImplTest, UploadAttachments_NoUploader) { 507 TEST_F(AttachmentServiceImplTest, UploadAttachments_NoUploader) {
512 InitializeAttachmentService(make_scoped_ptr<MockAttachmentUploader>(NULL), 508 InitializeAttachmentService(make_scoped_ptr<MockAttachmentUploader>(NULL),
513 make_scoped_ptr(new MockAttachmentDownloader()), 509 make_scoped_ptr(new MockAttachmentDownloader()),
514 this); 510 this);
515 511
516 AttachmentIdSet attachment_ids; 512 AttachmentIdSet attachment_ids;
517 attachment_ids.insert(AttachmentId::Create()); 513 attachment_ids.insert(AttachmentId::Create(0, 0));
518 attachment_service()->UploadAttachments(attachment_ids); 514 attachment_service()->UploadAttachments(attachment_ids);
519 RunLoop(); 515 RunLoop();
520 EXPECT_EQ(0U, store()->read_ids.size()); 516 EXPECT_EQ(0U, store()->read_ids.size());
521 ASSERT_EQ(0U, on_attachment_uploaded_list().size()); 517 ASSERT_EQ(0U, on_attachment_uploaded_list().size());
522 } 518 }
523 519
524 // Upload three attachments. For one of them, server responds with error. 520 // Upload three attachments. For one of them, server responds with error.
525 TEST_F(AttachmentServiceImplTest, UploadAttachments_OneUploadFails) { 521 TEST_F(AttachmentServiceImplTest, UploadAttachments_OneUploadFails) {
526 AttachmentIdSet attachment_ids; 522 AttachmentIdSet attachment_ids;
527 const unsigned num_attachments = 3; 523 const unsigned num_attachments = 3;
528 for (unsigned i = 0; i < num_attachments; ++i) { 524 for (unsigned i = 0; i < num_attachments; ++i) {
529 attachment_ids.insert(AttachmentId::Create()); 525 attachment_ids.insert(AttachmentId::Create(0, 0));
530 } 526 }
531 attachment_service()->UploadAttachments(attachment_ids); 527 attachment_service()->UploadAttachments(attachment_ids);
532 528
533 for (unsigned i = 0; i < 3; ++i) { 529 for (unsigned i = 0; i < 3; ++i) {
534 RunLoopAndFireTimer(); 530 RunLoopAndFireTimer();
535 ASSERT_GE(store()->read_ids.size(), 1U); 531 ASSERT_GE(store()->read_ids.size(), 1U);
536 store()->RespondToRead(attachment_ids); 532 store()->RespondToRead(attachment_ids);
537 RunLoop(); 533 RunLoop();
538 ASSERT_EQ(1U, uploader()->upload_requests.size()); 534 ASSERT_EQ(1U, uploader()->upload_requests.size());
539 AttachmentUploader::UploadResult result = 535 AttachmentUploader::UploadResult result =
540 AttachmentUploader::UPLOAD_SUCCESS; 536 AttachmentUploader::UPLOAD_SUCCESS;
541 // Fail the 2nd one. 537 // Fail the 2nd one.
542 if (i == 2U) { 538 if (i == 2U) {
543 result = AttachmentUploader::UPLOAD_UNSPECIFIED_ERROR; 539 result = AttachmentUploader::UPLOAD_UNSPECIFIED_ERROR;
544 } else { 540 } else {
545 result = AttachmentUploader::UPLOAD_SUCCESS; 541 result = AttachmentUploader::UPLOAD_SUCCESS;
546 } 542 }
547 uploader()->RespondToUpload(uploader()->upload_requests.begin()->first, 543 uploader()->RespondToUpload(uploader()->upload_requests.begin()->first,
548 result); 544 result);
549 RunLoop(); 545 RunLoop();
550 } 546 }
551 ASSERT_EQ(2U, on_attachment_uploaded_list().size()); 547 ASSERT_EQ(2U, on_attachment_uploaded_list().size());
552 } 548 }
553 549
554 // Attempt an upload, respond with transient error to trigger backoff, issue 550 // Attempt an upload, respond with transient error to trigger backoff, issue
555 // network disconnect/connect events and see that backoff is cleared. 551 // network disconnect/connect events and see that backoff is cleared.
556 TEST_F(AttachmentServiceImplTest, 552 TEST_F(AttachmentServiceImplTest,
557 UploadAttachments_ResetBackoffAfterNetworkChange) { 553 UploadAttachments_ResetBackoffAfterNetworkChange) {
558 AttachmentIdSet attachment_ids; 554 AttachmentIdSet attachment_ids;
559 attachment_ids.insert(AttachmentId::Create()); 555 attachment_ids.insert(AttachmentId::Create(0, 0));
560 attachment_service()->UploadAttachments(attachment_ids); 556 attachment_service()->UploadAttachments(attachment_ids);
561 557
562 RunLoopAndFireTimer(); 558 RunLoopAndFireTimer();
563 ASSERT_EQ(1U, store()->read_ids.size()); 559 ASSERT_EQ(1U, store()->read_ids.size());
564 store()->RespondToRead(attachment_ids); 560 store()->RespondToRead(attachment_ids);
565 RunLoop(); 561 RunLoop();
566 ASSERT_EQ(1U, uploader()->upload_requests.size()); 562 ASSERT_EQ(1U, uploader()->upload_requests.size());
567 563
568 uploader()->RespondToUpload(uploader()->upload_requests.begin()->first, 564 uploader()->RespondToUpload(uploader()->upload_requests.begin()->first,
569 AttachmentUploader::UPLOAD_TRANSIENT_ERROR); 565 AttachmentUploader::UPLOAD_TRANSIENT_ERROR);
(...skipping 16 matching lines...) Expand all
586 net::NetworkChangeNotifier::NotifyObserversOfNetworkChangeForTests( 582 net::NetworkChangeNotifier::NotifyObserversOfNetworkChangeForTests(
587 net::NetworkChangeNotifier::CONNECTION_WIFI); 583 net::NetworkChangeNotifier::CONNECTION_WIFI);
588 RunLoop(); 584 RunLoop();
589 585
590 // No longer in backoff. 586 // No longer in backoff.
591 ASSERT_TRUE(mock_timer()->IsRunning()); 587 ASSERT_TRUE(mock_timer()->IsRunning());
592 ASSERT_EQ(base::TimeDelta(), mock_timer()->GetCurrentDelay()); 588 ASSERT_EQ(base::TimeDelta(), mock_timer()->GetCurrentDelay());
593 } 589 }
594 590
595 } // namespace syncer 591 } // namespace syncer
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698