summaryrefslogtreecommitdiffstats
path: root/chrome/browser/automation/testing_automation_provider.cc
diff options
context:
space:
mode:
authorrlarocque@chromium.org <rlarocque@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-06 19:20:29 +0000
committerrlarocque@chromium.org <rlarocque@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-06 19:20:29 +0000
commit98acd3ac8060ad1f7e46170189040a1db2c42a3f (patch)
tree8d9565116b652b1242538850af260ab9c224292d /chrome/browser/automation/testing_automation_provider.cc
parentfb10ca02ba9a76aaf8d59816fdcd9c9c7c1d2793 (diff)
downloadchromium_src-98acd3ac8060ad1f7e46170189040a1db2c42a3f.zip
chromium_src-98acd3ac8060ad1f7e46170189040a1db2c42a3f.tar.gz
chromium_src-98acd3ac8060ad1f7e46170189040a1db2c42a3f.tar.bz2
Add "data synced" concept to sync integration test
The documentation for AwaitSyncCycleCompletion claimed it could be used to wait for a single sync cycle. In reality, it would wait for many cycles until snap->unsynced_handles == 0. Although you'd never guess this by looking at it, this condition implies that the client has done at least one update since it committed items to the server. This means that its progress marker is likely to be up to date, which is a very useful property. See the comments in crbug.com/48989 for more info. When issue 94670 is fixed it will no longer be guaranteed that a commit will be followed by an update. So the snap->unsynced_handles == 0 condition might never evaluate to true. However, even though a client's progress marker is stale, it might have its data be fully up to date and committed to the server. That's the state that the newly introduced WaitForDataSynced function looks for. This commit renames AwaitSyncCycleCompletion to AwaitFullSyncCompletion, which more accurately reflects what the function actually does. This commit should not change the integration test behaviour in any way. The new AwaitDataSyncCompletion and related functions are not used. The AwaitFullSyncCompletion should behave exactly the same as the old AwaitSyncCycleCompletion did. BUG=94990 TEST=sync_integration_tests Review URL: http://codereview.chromium.org/8139015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@104343 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/automation/testing_automation_provider.cc')
-rw-r--r--chrome/browser/automation/testing_automation_provider.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/chrome/browser/automation/testing_automation_provider.cc b/chrome/browser/automation/testing_automation_provider.cc
index d5f5675..a81f581 100644
--- a/chrome/browser/automation/testing_automation_provider.cc
+++ b/chrome/browser/automation/testing_automation_provider.cc
@@ -2504,8 +2504,8 @@ void TestingAutomationProvider::SendJSONRequest(int handle,
browser_handler_map["SignInToSync"] =
&TestingAutomationProvider::SignInToSync;
browser_handler_map["GetSyncInfo"] = &TestingAutomationProvider::GetSyncInfo;
- browser_handler_map["AwaitSyncCycleCompletion"] =
- &TestingAutomationProvider::AwaitSyncCycleCompletion;
+ browser_handler_map["AwaitFullSyncCompletion"] =
+ &TestingAutomationProvider::AwaitFullSyncCompletion;
browser_handler_map["AwaitSyncRestart"] =
&TestingAutomationProvider::AwaitSyncRestart;
browser_handler_map["EnableSyncForDatatypes"] =
@@ -4792,7 +4792,7 @@ void TestingAutomationProvider::GetSyncInfo(Browser* browser,
}
// Sample json output: { "success": true }
-void TestingAutomationProvider::AwaitSyncCycleCompletion(
+void TestingAutomationProvider::AwaitFullSyncCompletion(
Browser* browser,
DictionaryValue* args,
IPC::Message* reply_message) {
@@ -4817,7 +4817,7 @@ void TestingAutomationProvider::AwaitSyncCycleCompletion(
reply.SendError("Sync backend host initialization failed.");
return;
}
- if (!sync_waiter_->AwaitSyncCycleCompletion("Waiting for sync cycle")) {
+ if (!sync_waiter_->AwaitFullSyncCompletion("Waiting for sync cycle")) {
reply.SendError("Sync cycle did not complete.");
return;
}
@@ -4908,7 +4908,7 @@ void TestingAutomationProvider::EnableSyncForDatatypes(
return;
}
sync_waiter_->EnableSyncForDatatype(datatype);
- sync_waiter_->AwaitSyncCycleCompletion(StringPrintf(
+ sync_waiter_->AwaitFullSyncCompletion(StringPrintf(
"Enabling datatype: %s", datatype_string.c_str()));
}
}
@@ -4972,7 +4972,7 @@ void TestingAutomationProvider::DisableSyncForDatatypes(
return;
}
sync_waiter_->DisableSyncForDatatype(datatype);
- sync_waiter_->AwaitSyncCycleCompletion(StringPrintf(
+ sync_waiter_->AwaitFullSyncCompletion(StringPrintf(
"Disabling datatype: %s", datatype_string.c_str()));
}
ProfileSyncService::Status status = sync_waiter_->GetStatus();