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

Unified Diff: chrome/browser/sync_file_system/drive_file_sync_client_unittest.cc

Issue 11421125: Implement polling part of DriveFileSyncService (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase 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
Index: chrome/browser/sync_file_system/drive_file_sync_client_unittest.cc
diff --git a/chrome/browser/sync_file_system/drive_file_sync_client_unittest.cc b/chrome/browser/sync_file_system/drive_file_sync_client_unittest.cc
index f42bc49be9984faa4d12f968b7d9560228da6f2f..ecc1c2bdccf297eb7f620a9481b36c4aaeb12cc0 100644
--- a/chrome/browser/sync_file_system/drive_file_sync_client_unittest.cc
+++ b/chrome/browser/sync_file_system/drive_file_sync_client_unittest.cc
@@ -139,6 +139,7 @@ class DriveFileSyncClientTest : public testing::Test {
sync_client_ = DriveFileSyncClient::CreateForTesting(
&profile_,
+ GURL(google_apis::GDataWapiUrlGenerator::kBaseUrlForProduction),
scoped_ptr<DriveServiceInterface>(mock_drive_service_),
scoped_ptr<DriveUploaderInterface>(fake_drive_uploader_)).Pass();
}
@@ -151,6 +152,11 @@ class DriveFileSyncClientTest : public testing::Test {
protected:
DriveFileSyncClient* sync_client() { return sync_client_.get(); }
+ std::string FormatOriginQuery(const GURL& origin) {
+ return FormatTitleQuery(
+ DriveFileSyncClient::OriginToDirectoryTitle(origin));
+ }
+
std::string FormatTitleQuery(const std::string& title) {
return DriveFileSyncClient::FormatTitleQuery(title);
}
@@ -352,7 +358,7 @@ TEST_F(DriveFileSyncClientTest, GetOriginDirectory) {
const std::string kParentResourceId("folder:sync_root_resource_id");
const std::string kOriginDirectoryResourceId(
"folder:origin_directory_resource_id");
- const GURL kOrigin("http://example.com");
+ const GURL kOrigin("chrome-extension://example");
scoped_ptr<base::Value> found_result(google_apis::test_util::LoadJSONFile(
"sync_file_system/origin_directory_found.json").Pass());
@@ -361,7 +367,7 @@ TEST_F(DriveFileSyncClientTest, GetOriginDirectory) {
EXPECT_CALL(*mock_drive_service(),
GetDocuments(GURL(), // feed_url
0, // start_changestamp
- FormatTitleQuery(kOrigin.spec()),
+ FormatOriginQuery(kOrigin),
false, // shared_with_me
kParentResourceId,
_))
@@ -383,7 +389,7 @@ TEST_F(DriveFileSyncClientTest, GetOriginDirectory) {
TEST_F(DriveFileSyncClientTest, CreateOriginDirectory) {
const std::string kParentResourceId("folder:sync_root_resource_id");
- const GURL kOrigin("http://example.com");
+ const GURL kOrigin("chrome-extension://example");
scoped_ptr<base::Value> not_found_result(google_apis::test_util::LoadJSONFile(
"sync_file_system/origin_directory_not_found.json").Pass());
@@ -399,7 +405,7 @@ TEST_F(DriveFileSyncClientTest, CreateOriginDirectory) {
EXPECT_CALL(*mock_drive_service(),
GetDocuments(GURL(), // feed_url
0, // start_changestamp
- FormatTitleQuery(kOrigin.spec()),
+ FormatOriginQuery(kOrigin),
false, // shared_with_me
kParentResourceId, // directory_resource_id
_))
@@ -412,10 +418,11 @@ TEST_F(DriveFileSyncClientTest, CreateOriginDirectory) {
.WillOnce(InvokeGetDataCallback1(google_apis::HTTP_SUCCESS,
base::Passed(&got_parent_result)));
+ std::string dir_title(DriveFileSyncClient::OriginToDirectoryTitle(kOrigin));
// Expected to call AddNewDirectory from GetDriveDirectoryForOrigin.
EXPECT_CALL(*mock_drive_service(),
AddNewDirectory(GURL("https://sync_root_content_url"),
- FilePath().AppendASCII(kOrigin.spec()).value(),
+ FilePath().AppendASCII(dir_title).value(),
_))
.WillOnce(InvokeGetDataCallback2(google_apis::HTTP_CREATED,
base::Passed(&created_result)));

Powered by Google App Engine
This is Rietveld 408576698