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

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

Issue 11411280: Sync FileSystem: Use app id part of the URL for its directory title. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: testfix 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..0d3a5c2fa743fddb95181c62d378814df316d79c 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
@@ -151,6 +151,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 +357,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 +366,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 +388,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 +404,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 +417,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)));
« no previous file with comments | « chrome/browser/sync_file_system/drive_file_sync_client.cc ('k') | chrome/browser/sync_file_system/drive_file_sync_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698