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

Side by Side Diff: chrome/browser/chromeos/gdata/gdata_file_system_unittest.cc

Issue 9742002: Wired GDataFileSystem::GetFile() method with internal cache. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review updates Created 8 years, 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <errno.h> 5 #include <errno.h>
6 #include <string> 6 #include <string>
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 1479 matching lines...) Expand 10 before | Expand all | Expand 10 after
1490 } 1490 }
1491 1491
1492 TEST_F(GDataFileSystemTest, GetFile) { 1492 TEST_F(GDataFileSystemTest, GetFile) {
1493 LoadRootFeedDocument("root_feed.json"); 1493 LoadRootFeedDocument("root_feed.json");
1494 1494
1495 GetFileCallback callback = 1495 GetFileCallback callback =
1496 base::Bind(&CallbackHelper::GetFileCallback, 1496 base::Bind(&CallbackHelper::GetFileCallback,
1497 callback_helper_.get()); 1497 callback_helper_.get());
1498 1498
1499 EXPECT_CALL(*mock_doc_service_, 1499 EXPECT_CALL(*mock_doc_service_,
1500 DownloadFile(_, GURL("https://file_content_url/"), _)); 1500 DownloadFile(_, _, GURL("https://file_content_url/"), _));
1501 1501
1502 FilePath file_in_root(FILE_PATH_LITERAL("gdata/File 1.txt")); 1502 FilePath file_in_root(FILE_PATH_LITERAL("gdata/File 1.txt"));
1503 file_system_->GetFile(file_in_root, callback); 1503 file_system_->GetFile(file_in_root, callback);
1504 message_loop_.RunAllPending(); // Wait to get our result. 1504 message_loop_.RunAllPending(); // Wait to get our result.
1505 EXPECT_STREQ("file_content_url/", 1505 EXPECT_STREQ("file_content_url/",
1506 callback_helper_->download_path_.value().c_str()); 1506 callback_helper_->download_path_.value().c_str());
1507 } 1507 }
1508 1508
1509 TEST_F(GDataFileSystemTest, GetAvailableSpace) { 1509 TEST_F(GDataFileSystemTest, GetAvailableSpace) {
1510 GetAvailableSpaceCallback callback = 1510 GetAvailableSpaceCallback callback =
1511 base::Bind(&CallbackHelper::GetAvailableSpaceCallback, 1511 base::Bind(&CallbackHelper::GetAvailableSpaceCallback,
1512 callback_helper_.get()); 1512 callback_helper_.get());
1513 1513
1514 EXPECT_CALL(*mock_doc_service_, GetAccountMetadata(_)); 1514 EXPECT_CALL(*mock_doc_service_, GetAccountMetadata(_));
1515 1515
1516 file_system_->GetAvailableSpace(callback); 1516 file_system_->GetAvailableSpace(callback);
1517 message_loop_.RunAllPending(); // Wait to get our result. 1517 message_loop_.RunAllPending(); // Wait to get our result.
1518 EXPECT_EQ(1234, callback_helper_->quota_bytes_used_); 1518 EXPECT_EQ(1234, callback_helper_->quota_bytes_used_);
1519 EXPECT_EQ(12345, callback_helper_->quota_bytes_total_); 1519 EXPECT_EQ(12345, callback_helper_->quota_bytes_total_);
1520 } 1520 }
1521 1521
1522 } // namespace gdata 1522 } // namespace gdata
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698