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>2012-03-21 02:39:43 +0000
committerrlarocque@chromium.org <rlarocque@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-21 02:39:43 +0000
commitd550ce0e73f31f84efd7be83309e913a97ca60e5 (patch)
tree81b25fd9c4f5d49d8a44c7d40b7187fd70ed180f /chrome/browser/automation/testing_automation_provider.cc
parent6652074712f84591150721953f6ed8049145256e (diff)
downloadchromium_src-d550ce0e73f31f84efd7be83309e913a97ca60e5.zip
chromium_src-d550ce0e73f31f84efd7be83309e913a97ca60e5.tar.gz
chromium_src-d550ce0e73f31f84efd7be83309e913a97ca60e5.tar.bz2
Change definition of about:sync summary
The old syner status definition has outlived its usefulness. After a series of refactorings in the status summary reporting classes, it provides practically no useful and non-redundant information. The new syncer status is based on the information available to the ProfileSyncService. It attempts to indicate what level of initialization the sync service has reached, and therefore what sort of service a user ought to expect from it. This has a significant impact on some tests, which have come to rely on the summary as a means of inspecting internal state. I consider this to be a bad idea, since most of these tests should be testing behaviour, not internal state. In an attempt to discourage tests from relying on this summary in the future, the summary is now available only as an std::string. This change breaks the python functional sync tests. However, these test were already broken prior to this change. Fixing and re-enabling these tests is a job best left ot a future CL. BUG=112229,98346 TEST= Review URL: http://codereview.chromium.org/9724012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@127886 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/automation/testing_automation_provider.cc')
-rw-r--r--chrome/browser/automation/testing_automation_provider.cc66
1 files changed, 12 insertions, 54 deletions
diff --git a/chrome/browser/automation/testing_automation_provider.cc b/chrome/browser/automation/testing_automation_provider.cc
index 2b6240a..d2dfbdb 100644
--- a/chrome/browser/automation/testing_automation_provider.cc
+++ b/chrome/browser/automation/testing_automation_provider.cc
@@ -5125,7 +5125,6 @@ void TestingAutomationProvider::SignInToSync(Browser* browser,
// {u'summary': u'SYNC DISABLED'}
//
// { u'last synced': u'Just now',
-// u'summary': u'READY',
// u'sync url': u'clients4.google.com',
// u'updates received': 42,
// u'synced datatypes': [ u'Bookmarks',
@@ -5150,8 +5149,6 @@ void TestingAutomationProvider::GetSyncInfo(Browser* browser,
} else {
ProfileSyncService* service = sync_waiter_->service();
ProfileSyncService::Status status = sync_waiter_->GetStatus();
- sync_info->SetString("summary",
- ProfileSyncService::BuildSyncStatusSummaryText(status.summary));
sync_info->SetString("sync url", service->sync_service_url().host());
sync_info->SetString("last synced", service->GetLastSyncedTimeString());
sync_info->SetInteger("updates received", status.updates_received);
@@ -5200,18 +5197,9 @@ void TestingAutomationProvider::AwaitFullSyncCompletion(
reply.SendError("Sync cycle did not complete.");
return;
}
- ProfileSyncService::Status status = sync_waiter_->GetStatus();
- if (status.summary == ProfileSyncService::Status::READY) {
- scoped_ptr<DictionaryValue> return_value(new DictionaryValue);
- return_value->SetBoolean("success", true);
- reply.SendSuccess(return_value.get());
- } else {
- std::string error_msg = "Wait for sync cycle was unsuccessful. "
- "Sync status: ";
- error_msg.append(
- ProfileSyncService::BuildSyncStatusSummaryText(status.summary));
- reply.SendError(error_msg);
- }
+ scoped_ptr<DictionaryValue> return_value(new DictionaryValue);
+ return_value->SetBoolean("success", true);
+ reply.SendSuccess(return_value.get());
}
// Sample json output: { "success": true }
@@ -5237,18 +5225,9 @@ void TestingAutomationProvider::AwaitSyncRestart(
reply.SendError("Sync did not successfully restart.");
return;
}
- ProfileSyncService::Status status = sync_waiter_->GetStatus();
- if (status.summary == ProfileSyncService::Status::READY) {
- scoped_ptr<DictionaryValue> return_value(new DictionaryValue);
- return_value->SetBoolean("success", true);
- reply.SendSuccess(return_value.get());
- } else {
- std::string error_msg = "Wait for sync restart was unsuccessful. "
- "Sync status: ";
- error_msg.append(
- ProfileSyncService::BuildSyncStatusSummaryText(status.summary));
- reply.SendError(error_msg);
- }
+ scoped_ptr<DictionaryValue> return_value(new DictionaryValue);
+ return_value->SetBoolean("success", true);
+ reply.SendSuccess(return_value.get());
}
// Refer to EnableSyncForDatatypes() in chrome/test/pyautolib/pyauto.py for
@@ -5292,15 +5271,9 @@ void TestingAutomationProvider::EnableSyncForDatatypes(
"Enabling datatype: %s", datatype_string.c_str()));
}
}
- ProfileSyncService::Status status = sync_waiter_->GetStatus();
- if (status.summary == ProfileSyncService::Status::READY ||
- status.summary == ProfileSyncService::Status::SYNCING) {
- scoped_ptr<DictionaryValue> return_value(new DictionaryValue);
- return_value->SetBoolean("success", true);
- reply.SendSuccess(return_value.get());
- } else {
- reply.SendError("Enabling sync for given datatypes was unsuccessful");
- }
+ scoped_ptr<DictionaryValue> return_value(new DictionaryValue);
+ return_value->SetBoolean("success", true);
+ reply.SendSuccess(return_value.get());
}
// Refer to DisableSyncForDatatypes() in chrome/test/pyautolib/pyauto.py for
@@ -5330,15 +5303,6 @@ void TestingAutomationProvider::DisableSyncForDatatypes(
}
if (first_datatype == "All") {
sync_waiter_->DisableSyncForAllDatatypes();
- ProfileSyncService::Status status = sync_waiter_->GetStatus();
- if (status.summary != ProfileSyncService::Status::READY &&
- status.summary != ProfileSyncService::Status::SYNCING) {
- scoped_ptr<DictionaryValue> return_value(new DictionaryValue);
- return_value->SetBoolean("success", true);
- reply.SendSuccess(return_value.get());
- } else {
- reply.SendError("Disabling all sync datatypes was unsuccessful");
- }
} else {
int num_datatypes = datatypes->GetSize();
for (int i = 0; i < num_datatypes; i++) {
@@ -5355,15 +5319,9 @@ void TestingAutomationProvider::DisableSyncForDatatypes(
sync_waiter_->AwaitFullSyncCompletion(StringPrintf(
"Disabling datatype: %s", datatype_string.c_str()));
}
- ProfileSyncService::Status status = sync_waiter_->GetStatus();
- if (status.summary == ProfileSyncService::Status::READY ||
- status.summary == ProfileSyncService::Status::SYNCING) {
- scoped_ptr<DictionaryValue> return_value(new DictionaryValue);
- return_value->SetBoolean("success", true);
- reply.SendSuccess(return_value.get());
- } else {
- reply.SendError("Disabling sync for given datatypes was unsuccessful");
- }
+ scoped_ptr<DictionaryValue> return_value(new DictionaryValue);
+ return_value->SetBoolean("success", true);
+ reply.SendSuccess(return_value.get());
}
}