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

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

Issue 11280140: Pass calls to GetApplicationInfo through the scheduler (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix unit test Created 8 years 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_scheduler.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_scheduler_unittest.cc
diff --git a/chrome/browser/chromeos/drive/drive_scheduler_unittest.cc b/chrome/browser/chromeos/drive/drive_scheduler_unittest.cc
index 531f3491d1df92d3a79f33c54685a64d81ff7a21..b8db649c3c399128ff679fbb96506fcff91d4cdb 100644
--- a/chrome/browser/chromeos/drive/drive_scheduler_unittest.cc
+++ b/chrome/browser/chromeos/drive/drive_scheduler_unittest.cc
@@ -99,6 +99,17 @@ class FakeDriveService : public DriveServiceInterface {
}
virtual void GetApplicationInfo(const GetDataCallback& callback) {
+ // Make some sample data.
+ const FilePath account_metadata =
+ test_util::GetTestFilePath("gdata/account_metadata.json");
+ std::string contents;
+ file_util::ReadFileToString(account_metadata, &contents);
+ scoped_ptr<base::Value> data(base::JSONReader::Read(contents));
+
+ base::MessageLoopProxy::current()->PostTask(FROM_HERE,
+ base::Bind(callback,
+ HTTP_SUCCESS,
+ base::Passed(&data)));
}
virtual void DeleteDocument(const GURL& document_url,
@@ -380,6 +391,22 @@ TEST_F(DriveSchedulerTest, TransferRegularFileFile) {
ASSERT_EQ(DRIVE_FILE_OK, error);
}
+TEST_F(DriveSchedulerTest, GetApplicationInfo) {
+ ConnectToWifi();
+
+ google_apis::GDataErrorCode error = google_apis::GDATA_OTHER_ERROR;
+ scoped_ptr<base::Value> value;
+
+ scheduler_->GetApplicationInfo(
+ base::Bind(&google_apis::test_util::CopyResultsFromGetDataCallback,
+ &error,
+ &value));
+ google_apis::test_util::RunBlockingPoolTask();
+
+ ASSERT_EQ(google_apis::HTTP_SUCCESS, error);
+ ASSERT_TRUE(value);
+}
+
TEST_F(DriveSchedulerTest, GetDocuments) {
ConnectToWifi();
« no previous file with comments | « chrome/browser/chromeos/drive/drive_scheduler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698