summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkinaba@chromium.org <kinaba@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-16 19:55:09 +0000
committerkinaba@chromium.org <kinaba@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-16 19:55:09 +0000
commit5720f8919b1b227086858f23544eaa073b3d84e3 (patch)
tree47894a7c0a6c1929512da086a80f4f56ca710aa4
parent6d44de1f576515e771f1de4217b1c50e72b376f0 (diff)
downloadchromium_src-5720f8919b1b227086858f23544eaa073b3d84e3.zip
chromium_src-5720f8919b1b227086858f23544eaa073b3d84e3.tar.gz
chromium_src-5720f8919b1b227086858f23544eaa073b3d84e3.tar.bz2
drive: Apps.delete returns HTTP_NO_CONTENT on success.
The status code is consistent with other methods like Files.delete, so we should better align to it. This CL fixes the return code assumption in DriveAppRegistry that previously expected HTTP_SUCCESS. BUG=324166 Review URL: https://codereview.chromium.org/140533002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@245295 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/drive/drive_app_registry.cc2
-rw-r--r--chrome/browser/drive/drive_app_registry.h3
-rw-r--r--chrome/browser/drive/drive_app_registry_unittest.cc2
-rw-r--r--chrome/browser/drive/fake_drive_service.cc2
4 files changed, 5 insertions, 4 deletions
diff --git a/chrome/browser/drive/drive_app_registry.cc b/chrome/browser/drive/drive_app_registry.cc
index aed8ab1..903cbd8 100644
--- a/chrome/browser/drive/drive_app_registry.cc
+++ b/chrome/browser/drive/drive_app_registry.cc
@@ -195,7 +195,7 @@ void DriveAppRegistry::UninstallApp(const std::string& app_id,
void DriveAppRegistry::OnAppUninstalled(const std::string& app_id,
const UninstallCallback& callback,
google_apis::GDataErrorCode error) {
- if (error == google_apis::HTTP_SUCCESS) {
+ if (error == google_apis::HTTP_NO_CONTENT) {
all_apps_.erase(app_id);
RemoveAppFromSelector(app_id, &mimetype_map_);
RemoveAppFromSelector(app_id, &extension_map_);
diff --git a/chrome/browser/drive/drive_app_registry.h b/chrome/browser/drive/drive_app_registry.h
index dd53bae..26bf3c1 100644
--- a/chrome/browser/drive/drive_app_registry.h
+++ b/chrome/browser/drive/drive_app_registry.h
@@ -71,7 +71,8 @@ class DriveAppRegistry {
void GetAppList(std::vector<DriveAppInfo>* apps) const;
// Uninstalls the app specified by |app_id|. This method sends requests to the
- // remote server, and returns the result to |callback| asynchronously.
+ // remote server, and returns the result to |callback| asynchronously. When
+ // succeeded, the callback receives HTTP_NO_CONTENT, and error code otherwise.
// |callback| must not be null.
void UninstallApp(const std::string& app_id,
const UninstallCallback& callback);
diff --git a/chrome/browser/drive/drive_app_registry_unittest.cc b/chrome/browser/drive/drive_app_registry_unittest.cc
index 77d828f..6e04fd0 100644
--- a/chrome/browser/drive/drive_app_registry_unittest.cc
+++ b/chrome/browser/drive/drive_app_registry_unittest.cc
@@ -151,7 +151,7 @@ TEST_F(DriveAppRegistryTest, UninstallDriveApp) {
"123456788192",
google_apis::test_util::CreateCopyResultCallback(&error));
base::RunLoop().RunUntilIdle();
- EXPECT_EQ(error, google_apis::HTTP_SUCCESS);
+ EXPECT_EQ(error, google_apis::HTTP_NO_CONTENT);
// Check that the number of apps is decreased by one.
apps_registry_->GetAppList(&apps);
diff --git a/chrome/browser/drive/fake_drive_service.cc b/chrome/browser/drive/fake_drive_service.cc
index 6ea4bf8..6995f28 100644
--- a/chrome/browser/drive/fake_drive_service.cc
+++ b/chrome/browser/drive/fake_drive_service.cc
@@ -1280,7 +1280,7 @@ CancelCallback FakeDriveService::UninstallApp(
if (items->GetDictionary(i, &item) && item->GetString("id", &id) &&
id == app_id) {
if (items->Remove(i, NULL))
- error = google_apis::HTTP_SUCCESS;
+ error = google_apis::HTTP_NO_CONTENT;
break;
}
}