| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "components/sync/engine_impl/cycle/nudge_tracker.h" | 5 #include "components/sync/engine_impl/cycle/nudge_tracker.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 423 EXPECT_FALSE(nudge_tracker_.IsGetUpdatesRequired()); | 423 EXPECT_FALSE(nudge_tracker_.IsGetUpdatesRequired()); |
| 424 | 424 |
| 425 // Invalidations. | 425 // Invalidations. |
| 426 nudge_tracker_.RecordRemoteInvalidation(PREFERENCES, | 426 nudge_tracker_.RecordRemoteInvalidation(PREFERENCES, |
| 427 BuildInvalidation(1, "hint")); | 427 BuildInvalidation(1, "hint")); |
| 428 EXPECT_TRUE(nudge_tracker_.IsGetUpdatesRequired()); | 428 EXPECT_TRUE(nudge_tracker_.IsGetUpdatesRequired()); |
| 429 nudge_tracker_.RecordSuccessfulSyncCycle(); | 429 nudge_tracker_.RecordSuccessfulSyncCycle(); |
| 430 EXPECT_FALSE(nudge_tracker_.IsGetUpdatesRequired()); | 430 EXPECT_FALSE(nudge_tracker_.IsGetUpdatesRequired()); |
| 431 } | 431 } |
| 432 | 432 |
| 433 // Test IsSyncRequired() responds correctly to data type throttling. | 433 // Test IsSyncRequired() responds correctly to data type throttling and backoff. |
| 434 TEST_F(NudgeTrackerTest, IsSyncRequired_Throttling) { | 434 TEST_F(NudgeTrackerTest, IsSyncRequired_Throttling_Backoff) { |
| 435 const base::TimeTicks t0 = base::TimeTicks::FromInternalValue(1234); | 435 const base::TimeTicks now = base::TimeTicks::Now(); |
| 436 const base::TimeDelta throttle_length = base::TimeDelta::FromMinutes(10); | 436 const base::TimeDelta throttle_length = base::TimeDelta::FromMinutes(0); |
| 437 const base::TimeTicks t1 = t0 + throttle_length; | |
| 438 | 437 |
| 439 EXPECT_FALSE(nudge_tracker_.IsSyncRequired()); | 438 EXPECT_FALSE(nudge_tracker_.IsSyncRequired()); |
| 440 | 439 |
| 441 // A local change to sessions enables the flag. | 440 // A local change to sessions enables the flag. |
| 442 nudge_tracker_.RecordLocalChange(ModelTypeSet(SESSIONS)); | 441 nudge_tracker_.RecordLocalChange(ModelTypeSet(SESSIONS)); |
| 443 EXPECT_TRUE(nudge_tracker_.IsSyncRequired()); | 442 EXPECT_TRUE(nudge_tracker_.IsSyncRequired()); |
| 444 | 443 |
| 445 // But the throttling of sessions unsets it. | 444 // But the throttling of sessions unsets it. |
| 446 nudge_tracker_.SetTypesThrottledUntil(ModelTypeSet(SESSIONS), throttle_length, | 445 nudge_tracker_.SetTypesThrottledUntil(ModelTypeSet(SESSIONS), throttle_length, |
| 447 t0); | 446 now); |
| 447 EXPECT_TRUE(nudge_tracker_.IsTypeThrottled(SESSIONS)); |
| 448 EXPECT_FALSE(nudge_tracker_.IsSyncRequired()); | 448 EXPECT_FALSE(nudge_tracker_.IsSyncRequired()); |
| 449 | 449 |
| 450 // A refresh request for bookmarks means we have reason to sync again. | 450 // A refresh request for bookmarks means we have reason to sync again. |
| 451 nudge_tracker_.RecordLocalRefreshRequest(ModelTypeSet(BOOKMARKS)); | 451 nudge_tracker_.RecordLocalRefreshRequest(ModelTypeSet(BOOKMARKS)); |
| 452 EXPECT_TRUE(nudge_tracker_.IsSyncRequired()); | 452 EXPECT_TRUE(nudge_tracker_.IsSyncRequired()); |
| 453 | 453 |
| 454 // A successful sync cycle means we took care of bookmarks. | 454 // But the backoff of bookmarks unsets it. |
| 455 nudge_tracker_.SetTypeBackedOff(BOOKMARKS, throttle_length, now); |
| 456 EXPECT_TRUE(nudge_tracker_.IsTypeThrottled(SESSIONS)); |
| 457 EXPECT_TRUE(nudge_tracker_.IsTypeBackedOff(BOOKMARKS)); |
| 458 EXPECT_FALSE(nudge_tracker_.IsSyncRequired()); |
| 459 |
| 460 // A refresh request for preferences means we have reason to sync again. |
| 461 nudge_tracker_.RecordLocalRefreshRequest(ModelTypeSet(PREFERENCES)); |
| 462 EXPECT_TRUE(nudge_tracker_.IsSyncRequired()); |
| 463 |
| 464 // A successful sync cycle means we took care of preferences. |
| 455 nudge_tracker_.RecordSuccessfulSyncCycle(); | 465 nudge_tracker_.RecordSuccessfulSyncCycle(); |
| 456 EXPECT_FALSE(nudge_tracker_.IsSyncRequired()); | 466 EXPECT_FALSE(nudge_tracker_.IsSyncRequired()); |
| 457 | 467 |
| 458 // But we still haven't dealt with sessions. We'll need to remember | 468 // But we still haven't dealt with sessions and bookmarks. We'll need to |
| 459 // that sessions are out of sync and re-enable the flag when their | 469 // remember that sessions and bookmarks are out of sync and re-enable the flag |
| 460 // throttling interval expires. | 470 // when their throttling and backoff interval expires. |
| 461 nudge_tracker_.UpdateTypeThrottlingState(t1); | 471 nudge_tracker_.UpdateTypeThrottlingAndBackoffState(); |
| 462 EXPECT_FALSE(nudge_tracker_.IsTypeThrottled(SESSIONS)); | 472 EXPECT_FALSE(nudge_tracker_.IsTypeThrottled(SESSIONS)); |
| 473 EXPECT_FALSE(nudge_tracker_.IsTypeBackedOff(BOOKMARKS)); |
| 463 EXPECT_TRUE(nudge_tracker_.IsSyncRequired()); | 474 EXPECT_TRUE(nudge_tracker_.IsSyncRequired()); |
| 464 } | 475 } |
| 465 | 476 |
| 466 // Test IsGetUpdatesRequired() responds correctly to data type throttling. | 477 // Test IsGetUpdatesRequired() responds correctly to data type throttling and |
| 467 TEST_F(NudgeTrackerTest, IsGetUpdatesRequired_Throttling) { | 478 // backoff. |
| 468 const base::TimeTicks t0 = base::TimeTicks::FromInternalValue(1234); | 479 TEST_F(NudgeTrackerTest, IsGetUpdatesRequired_Throttling_Backoff) { |
| 469 const base::TimeDelta throttle_length = base::TimeDelta::FromMinutes(10); | 480 const base::TimeTicks now = base::TimeTicks::Now(); |
| 470 const base::TimeTicks t1 = t0 + throttle_length; | 481 const base::TimeDelta throttle_length = base::TimeDelta::FromMinutes(0); |
| 471 | 482 |
| 472 EXPECT_FALSE(nudge_tracker_.IsGetUpdatesRequired()); | 483 EXPECT_FALSE(nudge_tracker_.IsGetUpdatesRequired()); |
| 473 | 484 |
| 474 // A refresh request to sessions enables the flag. | 485 // A refresh request to sessions enables the flag. |
| 475 nudge_tracker_.RecordLocalRefreshRequest(ModelTypeSet(SESSIONS)); | 486 nudge_tracker_.RecordLocalRefreshRequest(ModelTypeSet(SESSIONS)); |
| 476 EXPECT_TRUE(nudge_tracker_.IsGetUpdatesRequired()); | 487 EXPECT_TRUE(nudge_tracker_.IsGetUpdatesRequired()); |
| 477 | 488 |
| 478 // But the throttling of sessions unsets it. | 489 // But the throttling of sessions unsets it. |
| 479 nudge_tracker_.SetTypesThrottledUntil(ModelTypeSet(SESSIONS), throttle_length, | 490 nudge_tracker_.SetTypesThrottledUntil(ModelTypeSet(SESSIONS), throttle_length, |
| 480 t0); | 491 now); |
| 481 EXPECT_FALSE(nudge_tracker_.IsGetUpdatesRequired()); | 492 EXPECT_FALSE(nudge_tracker_.IsGetUpdatesRequired()); |
| 482 | 493 |
| 483 // A refresh request for bookmarks means we have reason to sync again. | 494 // A refresh request for bookmarks means we have reason to sync again. |
| 484 nudge_tracker_.RecordLocalRefreshRequest(ModelTypeSet(BOOKMARKS)); | 495 nudge_tracker_.RecordLocalRefreshRequest(ModelTypeSet(BOOKMARKS)); |
| 485 EXPECT_TRUE(nudge_tracker_.IsGetUpdatesRequired()); | 496 EXPECT_TRUE(nudge_tracker_.IsGetUpdatesRequired()); |
| 486 | 497 |
| 487 // A successful sync cycle means we took care of bookmarks. | 498 // But the backoff of bookmarks unsets it. |
| 499 nudge_tracker_.SetTypeBackedOff(BOOKMARKS, throttle_length, now); |
| 500 EXPECT_TRUE(nudge_tracker_.IsTypeThrottled(SESSIONS)); |
| 501 EXPECT_TRUE(nudge_tracker_.IsTypeBackedOff(BOOKMARKS)); |
| 502 EXPECT_FALSE(nudge_tracker_.IsGetUpdatesRequired()); |
| 503 |
| 504 // A refresh request for preferences means we have reason to sync again. |
| 505 nudge_tracker_.RecordLocalRefreshRequest(ModelTypeSet(PREFERENCES)); |
| 506 EXPECT_TRUE(nudge_tracker_.IsGetUpdatesRequired()); |
| 507 |
| 508 // A successful sync cycle means we took care of preferences. |
| 488 nudge_tracker_.RecordSuccessfulSyncCycle(); | 509 nudge_tracker_.RecordSuccessfulSyncCycle(); |
| 489 EXPECT_FALSE(nudge_tracker_.IsGetUpdatesRequired()); | 510 EXPECT_FALSE(nudge_tracker_.IsGetUpdatesRequired()); |
| 490 | 511 |
| 491 // But we still haven't dealt with sessions. We'll need to remember | 512 // But we still haven't dealt with sessions and bookmarks. We'll need to |
| 492 // that sessions are out of sync and re-enable the flag when their | 513 // remember that sessions and bookmarks are out of sync and re-enable the flag |
| 493 // throttling interval expires. | 514 // when their throttling and backoff interval expires. |
| 494 nudge_tracker_.UpdateTypeThrottlingState(t1); | 515 nudge_tracker_.UpdateTypeThrottlingAndBackoffState(); |
| 495 EXPECT_FALSE(nudge_tracker_.IsTypeThrottled(SESSIONS)); | 516 EXPECT_FALSE(nudge_tracker_.IsTypeThrottled(SESSIONS)); |
| 517 EXPECT_FALSE(nudge_tracker_.IsTypeBackedOff(BOOKMARKS)); |
| 496 EXPECT_TRUE(nudge_tracker_.IsGetUpdatesRequired()); | 518 EXPECT_TRUE(nudge_tracker_.IsGetUpdatesRequired()); |
| 497 } | 519 } |
| 498 | 520 |
| 499 // Tests throttling-related getter functions when no types are throttled. | 521 // Tests throttling-related getter functions when no types are throttled. |
| 500 TEST_F(NudgeTrackerTest, NoTypesThrottled) { | 522 TEST_F(NudgeTrackerTest, NoTypesThrottled) { |
| 501 EXPECT_FALSE(nudge_tracker_.IsAnyTypeThrottled()); | 523 EXPECT_FALSE(nudge_tracker_.IsAnyTypeThrottled()); |
| 502 EXPECT_FALSE(nudge_tracker_.IsTypeThrottled(SESSIONS)); | 524 EXPECT_FALSE(nudge_tracker_.IsTypeThrottled(SESSIONS)); |
| 503 EXPECT_TRUE(nudge_tracker_.GetThrottledTypes().Empty()); | 525 EXPECT_TRUE(nudge_tracker_.GetThrottledTypes().Empty()); |
| 504 } | 526 } |
| 505 | 527 |
| 528 // Tests backoff-related getter functions when no types are backed off. |
| 529 TEST_F(NudgeTrackerTest, NoTypesBackedOff) { |
| 530 EXPECT_FALSE(nudge_tracker_.IsAnyTypeBackedOff()); |
| 531 EXPECT_FALSE(nudge_tracker_.IsTypeBackedOff(SESSIONS)); |
| 532 EXPECT_TRUE(nudge_tracker_.GetBackedOffTypes().Empty()); |
| 533 } |
| 534 |
| 506 // Tests throttling-related getter functions when some types are throttled. | 535 // Tests throttling-related getter functions when some types are throttled. |
| 507 TEST_F(NudgeTrackerTest, ThrottleAndUnthrottle) { | 536 TEST_F(NudgeTrackerTest, ThrottleAndUnthrottle) { |
| 508 const base::TimeTicks t0 = base::TimeTicks::FromInternalValue(1234); | 537 const base::TimeTicks now = base::TimeTicks::Now(); |
| 509 const base::TimeDelta throttle_length = base::TimeDelta::FromMinutes(10); | 538 const base::TimeDelta throttle_length = base::TimeDelta::FromMinutes(0); |
| 510 const base::TimeTicks t1 = t0 + throttle_length; | |
| 511 | 539 |
| 512 nudge_tracker_.SetTypesThrottledUntil(ModelTypeSet(SESSIONS, PREFERENCES), | 540 nudge_tracker_.SetTypesThrottledUntil(ModelTypeSet(SESSIONS, PREFERENCES), |
| 513 throttle_length, t0); | 541 throttle_length, now); |
| 514 | 542 |
| 515 EXPECT_TRUE(nudge_tracker_.IsAnyTypeThrottled()); | 543 EXPECT_TRUE(nudge_tracker_.IsAnyTypeThrottled()); |
| 516 EXPECT_TRUE(nudge_tracker_.IsTypeThrottled(SESSIONS)); | 544 EXPECT_TRUE(nudge_tracker_.IsTypeThrottled(SESSIONS)); |
| 517 EXPECT_TRUE(nudge_tracker_.IsTypeThrottled(PREFERENCES)); | 545 EXPECT_TRUE(nudge_tracker_.IsTypeThrottled(PREFERENCES)); |
| 518 EXPECT_FALSE(nudge_tracker_.GetThrottledTypes().Empty()); | 546 EXPECT_FALSE(nudge_tracker_.GetThrottledTypes().Empty()); |
| 519 EXPECT_EQ(throttle_length, nudge_tracker_.GetTimeUntilNextUnthrottle(t0)); | 547 EXPECT_EQ(throttle_length, nudge_tracker_.GetTimeUntilNextUnblock()); |
| 520 | 548 |
| 521 nudge_tracker_.UpdateTypeThrottlingState(t1); | 549 nudge_tracker_.UpdateTypeThrottlingAndBackoffState(); |
| 522 | 550 |
| 523 EXPECT_FALSE(nudge_tracker_.IsAnyTypeThrottled()); | 551 EXPECT_FALSE(nudge_tracker_.IsAnyTypeThrottled()); |
| 524 EXPECT_FALSE(nudge_tracker_.IsTypeThrottled(SESSIONS)); | 552 EXPECT_FALSE(nudge_tracker_.IsTypeThrottled(SESSIONS)); |
| 525 EXPECT_TRUE(nudge_tracker_.GetThrottledTypes().Empty()); | 553 EXPECT_TRUE(nudge_tracker_.GetThrottledTypes().Empty()); |
| 526 } | 554 } |
| 527 | 555 |
| 556 // Tests backoff-related getter functions when some types are backed off. |
| 557 TEST_F(NudgeTrackerTest, BackoffAndUnbackoff) { |
| 558 const base::TimeTicks now = base::TimeTicks::Now(); |
| 559 const base::TimeDelta backoff_length = base::TimeDelta::FromMinutes(0); |
| 560 |
| 561 nudge_tracker_.SetTypeBackedOff(SESSIONS, backoff_length, now); |
| 562 nudge_tracker_.SetTypeBackedOff(PREFERENCES, backoff_length, now); |
| 563 |
| 564 EXPECT_TRUE(nudge_tracker_.IsAnyTypeBackedOff()); |
| 565 EXPECT_TRUE(nudge_tracker_.IsTypeBackedOff(SESSIONS)); |
| 566 EXPECT_TRUE(nudge_tracker_.IsTypeBackedOff(PREFERENCES)); |
| 567 EXPECT_FALSE(nudge_tracker_.GetBackedOffTypes().Empty()); |
| 568 EXPECT_EQ(backoff_length, nudge_tracker_.GetTimeUntilNextUnblock()); |
| 569 |
| 570 nudge_tracker_.UpdateTypeThrottlingAndBackoffState(); |
| 571 |
| 572 EXPECT_FALSE(nudge_tracker_.IsAnyTypeBackedOff()); |
| 573 EXPECT_FALSE(nudge_tracker_.IsTypeBackedOff(SESSIONS)); |
| 574 EXPECT_TRUE(nudge_tracker_.GetBackedOffTypes().Empty()); |
| 575 } |
| 576 |
| 528 TEST_F(NudgeTrackerTest, OverlappingThrottleIntervals) { | 577 TEST_F(NudgeTrackerTest, OverlappingThrottleIntervals) { |
| 529 const base::TimeTicks t0 = base::TimeTicks::FromInternalValue(1234); | 578 const base::TimeTicks now = base::TimeTicks::Now(); |
| 530 const base::TimeDelta throttle1_length = base::TimeDelta::FromMinutes(10); | 579 const base::TimeDelta throttle1_length = base::TimeDelta::FromMinutes(0); |
| 531 const base::TimeDelta throttle2_length = base::TimeDelta::FromMinutes(20); | 580 const base::TimeDelta throttle2_length = base::TimeDelta::FromMinutes(20); |
| 532 const base::TimeTicks t1 = t0 + throttle1_length; | |
| 533 const base::TimeTicks t2 = t0 + throttle2_length; | |
| 534 | 581 |
| 535 // Setup the longer of two intervals. | 582 // Setup the longer of two intervals. |
| 536 nudge_tracker_.SetTypesThrottledUntil(ModelTypeSet(SESSIONS, PREFERENCES), | 583 nudge_tracker_.SetTypesThrottledUntil(ModelTypeSet(SESSIONS, PREFERENCES), |
| 537 throttle2_length, t0); | 584 throttle2_length, now); |
| 538 EXPECT_TRUE(ModelTypeSetEquals(ModelTypeSet(SESSIONS, PREFERENCES), | 585 EXPECT_TRUE(ModelTypeSetEquals(ModelTypeSet(SESSIONS, PREFERENCES), |
| 539 nudge_tracker_.GetThrottledTypes())); | 586 nudge_tracker_.GetThrottledTypes())); |
| 540 EXPECT_EQ(throttle2_length, nudge_tracker_.GetTimeUntilNextUnthrottle(t0)); | 587 EXPECT_GE(throttle2_length, nudge_tracker_.GetTimeUntilNextUnblock()); |
| 541 | 588 |
| 542 // Setup the shorter interval. | 589 // Setup the shorter interval. |
| 543 nudge_tracker_.SetTypesThrottledUntil(ModelTypeSet(SESSIONS, BOOKMARKS), | 590 nudge_tracker_.SetTypesThrottledUntil(ModelTypeSet(SESSIONS, BOOKMARKS), |
| 544 throttle1_length, t0); | 591 throttle1_length, now); |
| 545 EXPECT_TRUE(ModelTypeSetEquals(ModelTypeSet(SESSIONS, PREFERENCES, BOOKMARKS), | 592 EXPECT_TRUE(ModelTypeSetEquals(ModelTypeSet(SESSIONS, PREFERENCES, BOOKMARKS), |
| 546 nudge_tracker_.GetThrottledTypes())); | 593 nudge_tracker_.GetThrottledTypes())); |
| 547 EXPECT_EQ(throttle1_length, nudge_tracker_.GetTimeUntilNextUnthrottle(t0)); | 594 EXPECT_GE(throttle1_length, nudge_tracker_.GetTimeUntilNextUnblock()); |
| 548 | 595 |
| 549 // Expire the first interval. | 596 // Expire the first interval. |
| 550 nudge_tracker_.UpdateTypeThrottlingState(t1); | 597 nudge_tracker_.UpdateTypeThrottlingAndBackoffState(); |
| 551 | 598 |
| 552 // SESSIONS appeared in both intervals. We expect it will be throttled for | 599 // SESSIONS appeared in both intervals. We expect it will be throttled for |
| 553 // the longer of the two, so it's still throttled at time t1. | 600 // the longer of the two, so it's still throttled at time t1. |
| 554 EXPECT_TRUE(ModelTypeSetEquals(ModelTypeSet(SESSIONS, PREFERENCES), | 601 EXPECT_TRUE(ModelTypeSetEquals(ModelTypeSet(SESSIONS, PREFERENCES), |
| 555 nudge_tracker_.GetThrottledTypes())); | 602 nudge_tracker_.GetThrottledTypes())); |
| 556 EXPECT_EQ(throttle2_length - throttle1_length, | 603 EXPECT_GE(throttle2_length - throttle1_length, |
| 557 nudge_tracker_.GetTimeUntilNextUnthrottle(t1)); | 604 nudge_tracker_.GetTimeUntilNextUnblock()); |
| 605 } |
| 558 | 606 |
| 559 // Expire the second interval. | 607 TEST_F(NudgeTrackerTest, OverlappingBackoffIntervals) { |
| 560 nudge_tracker_.UpdateTypeThrottlingState(t2); | 608 const base::TimeTicks now = base::TimeTicks::Now(); |
| 561 EXPECT_TRUE(nudge_tracker_.GetThrottledTypes().Empty()); | 609 const base::TimeDelta backoff1_length = base::TimeDelta::FromMinutes(0); |
| 610 const base::TimeDelta backoff2_length = base::TimeDelta::FromMinutes(20); |
| 611 |
| 612 // Setup the longer of two intervals. |
| 613 nudge_tracker_.SetTypeBackedOff(SESSIONS, backoff2_length, now); |
| 614 nudge_tracker_.SetTypeBackedOff(PREFERENCES, backoff2_length, now); |
| 615 EXPECT_TRUE(ModelTypeSetEquals(ModelTypeSet(SESSIONS, PREFERENCES), |
| 616 nudge_tracker_.GetBackedOffTypes())); |
| 617 EXPECT_GE(backoff2_length, nudge_tracker_.GetTimeUntilNextUnblock()); |
| 618 |
| 619 // Setup the shorter interval. |
| 620 nudge_tracker_.SetTypeBackedOff(SESSIONS, backoff1_length, now); |
| 621 nudge_tracker_.SetTypeBackedOff(BOOKMARKS, backoff1_length, now); |
| 622 EXPECT_TRUE(ModelTypeSetEquals(ModelTypeSet(SESSIONS, PREFERENCES, BOOKMARKS), |
| 623 nudge_tracker_.GetBackedOffTypes())); |
| 624 EXPECT_GE(backoff1_length, nudge_tracker_.GetTimeUntilNextUnblock()); |
| 625 |
| 626 // Expire the first interval. |
| 627 nudge_tracker_.UpdateTypeThrottlingAndBackoffState(); |
| 628 |
| 629 // SESSIONS appeared in both intervals. We expect it will be backed off for |
| 630 // the longer of the two, so it's still backed off at time t1. |
| 631 EXPECT_TRUE(ModelTypeSetEquals(ModelTypeSet(SESSIONS, PREFERENCES), |
| 632 nudge_tracker_.GetBackedOffTypes())); |
| 633 EXPECT_GE(backoff2_length - backoff1_length, |
| 634 nudge_tracker_.GetTimeUntilNextUnblock()); |
| 562 } | 635 } |
| 563 | 636 |
| 564 TEST_F(NudgeTrackerTest, Retry) { | 637 TEST_F(NudgeTrackerTest, Retry) { |
| 565 const base::TimeTicks t0 = base::TimeTicks::FromInternalValue(12345); | 638 const base::TimeTicks t0 = base::TimeTicks::FromInternalValue(12345); |
| 566 const base::TimeTicks t3 = t0 + base::TimeDelta::FromSeconds(3); | 639 const base::TimeTicks t3 = t0 + base::TimeDelta::FromSeconds(3); |
| 567 const base::TimeTicks t4 = t0 + base::TimeDelta::FromSeconds(4); | 640 const base::TimeTicks t4 = t0 + base::TimeDelta::FromSeconds(4); |
| 568 | 641 |
| 569 // Set retry for t3. | 642 // Set retry for t3. |
| 570 nudge_tracker_.SetNextRetryTime(t3); | 643 nudge_tracker_.SetNextRetryTime(t3); |
| 571 | 644 |
| (...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 957 EXPECT_TRUE(IsInvalidationAcknowledged(inv1_id)); | 1030 EXPECT_TRUE(IsInvalidationAcknowledged(inv1_id)); |
| 958 EXPECT_TRUE(IsInvalidationAcknowledged(inv2_id)); | 1031 EXPECT_TRUE(IsInvalidationAcknowledged(inv2_id)); |
| 959 EXPECT_TRUE(IsInvalidationAcknowledged(inv3_id)); | 1032 EXPECT_TRUE(IsInvalidationAcknowledged(inv3_id)); |
| 960 EXPECT_TRUE(IsInvalidationAcknowledged(inv4_id)); | 1033 EXPECT_TRUE(IsInvalidationAcknowledged(inv4_id)); |
| 961 EXPECT_TRUE(IsInvalidationAcknowledged(inv5_id)); | 1034 EXPECT_TRUE(IsInvalidationAcknowledged(inv5_id)); |
| 962 | 1035 |
| 963 EXPECT_TRUE(AllInvalidationsAccountedFor()); | 1036 EXPECT_TRUE(AllInvalidationsAccountedFor()); |
| 964 } | 1037 } |
| 965 | 1038 |
| 966 } // namespace syncer | 1039 } // namespace syncer |
| OLD | NEW |