Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(64)

Unified Diff: chrome/browser/chromeos/drive/drive_app_registry_unittest.cc

Issue 23503008: file_manager: Add DriveAppRegistry::UpdateFromAppList() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/chromeos/drive/drive_app_registry.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/drive/drive_app_registry_unittest.cc
diff --git a/chrome/browser/chromeos/drive/drive_app_registry_unittest.cc b/chrome/browser/chromeos/drive/drive_app_registry_unittest.cc
index c12cde0d55763f80fc0e7f125ce43b102e41fd66..64dc25da2303d4b0945e2518ee64d434f6e38a92 100644
--- a/chrome/browser/chromeos/drive/drive_app_registry_unittest.cc
+++ b/chrome/browser/chromeos/drive/drive_app_registry_unittest.cc
@@ -10,7 +10,9 @@
#include "chrome/browser/chromeos/drive/job_scheduler.h"
#include "chrome/browser/chromeos/drive/test_util.h"
#include "chrome/browser/drive/fake_drive_service.h"
+#include "chrome/browser/google_apis/drive_api_parser.h"
#include "chrome/browser/google_apis/gdata_wapi_parser.h"
+#include "chrome/browser/google_apis/test_util.h"
#include "content/public/test/test_browser_thread_bundle.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -92,6 +94,21 @@ TEST_F(DriveAppRegistryTest, LoadAndFindDriveApps) {
"Drive app 1", "", false);
}
+TEST_F(DriveAppRegistryTest, UpdateFromAppList) {
+ scoped_ptr<base::Value> app_info_value =
+ google_apis::test_util::LoadJSONFile("drive/applist.json");
+ scoped_ptr<google_apis::AppList> app_list(
+ google_apis::AppList::CreateFrom(*app_info_value));
+
+ web_apps_registry_->UpdateFromAppList(*app_list);
+
+ // Confirm that something was loaded from applist.json.
+ ScopedVector<DriveAppInfo> ext_results;
+ base::FilePath ext_file(FILE_PATH_LITERAL("drive/file.exe"));
+ web_apps_registry_->GetAppsForFile(ext_file, std::string(), &ext_results);
+ ASSERT_EQ(1U, ext_results.size());
+}
+
TEST_F(DriveAppRegistryTest, MultipleUpdate) {
// Call Update().
web_apps_registry_->Update();
« no previous file with comments | « chrome/browser/chromeos/drive/drive_app_registry.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698