Commit fee75a0f authored by zea's avatar zea Committed by Commit bot

[Sync] Remove special cased sessions default commit

The session commit delay is always overridden in production. As such, the
default only affects test, where it makes it much more likely to time out.
Remove it and re-enable the disabled sessions integration tests.

BUG=263369, 232313

Review-Url: https://codereview.chromium.org/2389443003
Cr-Commit-Position: refs/heads/master@{#422668}
parent d1d59d93
......@@ -41,22 +41,9 @@ static const char* kURL2 = "http://127.0.0.1/bubba2";
// (as well as multi-window). We're currently only checking basic single-window/
// single-tab functionality.
// Fails on Win, see http://crbug.com/232313
#if defined(OS_WIN)
#define MAYBE_SingleClientChanged DISABLED_SingleClientChanged
#define MAYBE_BothChanged DISABLED_BothChanged
#define MAYBE_DeleteIdleSession DISABLED_DeleteIdleSession
#define MAYBE_AllChanged DISABLED_AllChanged
#else
#define MAYBE_SingleClientChanged SingleClientChanged
#define MAYBE_BothChanged BothChanged
#define MAYBE_DeleteIdleSession DeleteIdleSession
#define MAYBE_AllChanged AllChanged
#endif
IN_PROC_BROWSER_TEST_F(TwoClientSessionsSyncTest,
E2E_ENABLED(MAYBE_SingleClientChanged)) {
E2E_ENABLED(SingleClientChanged)) {
ASSERT_TRUE(SetupSync()) << "SetupSync() failed.";
// Open tab and access a url on client 0
......@@ -74,7 +61,7 @@ IN_PROC_BROWSER_TEST_F(TwoClientSessionsSyncTest,
}
IN_PROC_BROWSER_TEST_F(TwoClientSessionsSyncTest,
E2E_ENABLED(MAYBE_AllChanged)) {
E2E_ENABLED(AllChanged)) {
ASSERT_TRUE(SetupSync()) << "SetupSync() failed.";
// Open tabs on all clients and retain window information.
......@@ -146,7 +133,7 @@ IN_PROC_BROWSER_TEST_F(TwoClientSessionsSyncTest,
ASSERT_TRUE(IsEncryptionComplete(1));
}
IN_PROC_BROWSER_TEST_F(TwoClientSessionsSyncTest, MAYBE_BothChanged) {
IN_PROC_BROWSER_TEST_F(TwoClientSessionsSyncTest, BothChanged) {
ASSERT_TRUE(SetupSync()) << "SetupSync() failed.";
ASSERT_TRUE(CheckInitialState(0));
......@@ -175,7 +162,7 @@ IN_PROC_BROWSER_TEST_F(TwoClientSessionsSyncTest, MAYBE_BothChanged) {
ASSERT_TRUE(WindowsMatch(sessions0[0]->windows, client1_windows));
}
IN_PROC_BROWSER_TEST_F(TwoClientSessionsSyncTest, MAYBE_DeleteIdleSession) {
IN_PROC_BROWSER_TEST_F(TwoClientSessionsSyncTest, DeleteIdleSession) {
ASSERT_TRUE(SetupSync()) << "SetupSync() failed.";
ASSERT_TRUE(CheckInitialState(0));
......@@ -203,7 +190,7 @@ IN_PROC_BROWSER_TEST_F(TwoClientSessionsSyncTest, MAYBE_DeleteIdleSession) {
// Fails all release trybots. crbug.com/263369.
IN_PROC_BROWSER_TEST_F(TwoClientSessionsSyncTest,
DISABLED_DeleteActiveSession) {
DeleteActiveSession) {
ASSERT_TRUE(SetupSync()) << "SetupSync() failed.";
ASSERT_TRUE(CheckInitialState(0));
......
......@@ -16,7 +16,6 @@ namespace {
// Delays for syncer nudges.
const int kDefaultNudgeDelayMilliseconds = 200;
const int kSlowNudgeDelayMilliseconds = 2000;
const int kDefaultSessionsCommitDelaySeconds = 10;
const int kSyncRefreshDelayMilliseconds = 500;
const int kSyncSchedulerDelayMilliseconds = 250;
......@@ -29,15 +28,12 @@ base::TimeDelta GetDefaultDelayForType(ModelType model_type,
return base::TimeDelta::FromSeconds(kDefaultShortPollIntervalSeconds);
case BOOKMARKS:
case PREFERENCES:
// Types with sometimes automatic changes get longer delays to allow more
// coalescing.
return base::TimeDelta::FromMilliseconds(kSlowNudgeDelayMilliseconds);
case SESSIONS:
case FAVICON_IMAGES:
case FAVICON_TRACKING:
// Types with navigation triggered changes get longer delays to allow more
// Types with sometimes automatic changes get longer delays to allow more
// coalescing.
return base::TimeDelta::FromSeconds(kDefaultSessionsCommitDelaySeconds);
return base::TimeDelta::FromMilliseconds(kSlowNudgeDelayMilliseconds);
default:
return minimum_delay;
}
......
......@@ -745,8 +745,8 @@ TEST_F(NudgeTrackerTest, NudgeDelayTest) {
EXPECT_GT(nudge_tracker_.RecordLocalChange(ModelTypeSet(BOOKMARKS)),
base::TimeDelta());
// Sessions is longer than "slow nudge".
EXPECT_GT(nudge_tracker_.RecordLocalChange(ModelTypeSet(SESSIONS)),
// Sessions has a "slow nudge".
EXPECT_EQ(nudge_tracker_.RecordLocalChange(ModelTypeSet(SESSIONS)),
nudge_tracker_.RecordLocalChange(ModelTypeSet(BOOKMARKS)));
// Favicons have the same delay as sessions.
......
......@@ -423,6 +423,10 @@ SyncerError SyncerProtoUtil::PostClientToServerMessage(
std::map<ModelType, base::TimeDelta> delay_map;
delay_map[SESSIONS] =
base::TimeDelta::FromSeconds(command.sessions_commit_delay_seconds());
delay_map[FAVICON_TRACKING] =
base::TimeDelta::FromSeconds(command.sessions_commit_delay_seconds());
delay_map[FAVICON_IMAGES] =
base::TimeDelta::FromSeconds(command.sessions_commit_delay_seconds());
cycle->delegate()->OnReceivedCustomNudgeDelays(delay_map);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment