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

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

Issue 10765020: gdata: Simplify semantics of sub_dir_type in CacheEntry. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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 2345 matching lines...) Expand 10 before | Expand all | Expand 10 after
2356 const FilePath kFilePath(FILE_PATH_LITERAL("drive/File 1.txt")); 2356 const FilePath kFilePath(FILE_PATH_LITERAL("drive/File 1.txt"));
2357 const std::string kResourceId("file:2_file_resource_id"); 2357 const std::string kResourceId("file:2_file_resource_id");
2358 const std::string kMd5("3b4382ebefec6e743578c76bbd0575ce"); 2358 const std::string kMd5("3b4382ebefec6e743578c76bbd0575ce");
2359 2359
2360 // Pin the file so it'll be store in "persistent" directory. 2360 // Pin the file so it'll be store in "persistent" directory.
2361 EXPECT_CALL(*mock_sync_client_, OnCachePinned(kResourceId, kMd5)).Times(1); 2361 EXPECT_CALL(*mock_sync_client_, OnCachePinned(kResourceId, kMd5)).Times(1);
2362 TestPin(kResourceId, 2362 TestPin(kResourceId,
2363 kMd5, 2363 kMd5,
2364 base::PLATFORM_FILE_OK, 2364 base::PLATFORM_FILE_OK,
2365 GDataCache::CACHE_STATE_PINNED, 2365 GDataCache::CACHE_STATE_PINNED,
2366 GDataCache::CACHE_TYPE_PINNED); 2366 GDataCache::CACHE_TYPE_TMP);
2367 2367
2368 // First store a file to cache. A cache file will be created at: 2368 // First store a file to cache. A cache file will be created at:
2369 // GCache/v1/persistent/<kResourceId>.<kMd5> 2369 // GCache/v1/persistent/<kResourceId>.<kMd5>
2370 const FilePath original_cache_file_path = 2370 const FilePath original_cache_file_path =
2371 GDataCache::GetCacheRootPath(profile_.get()) 2371 GDataCache::GetCacheRootPath(profile_.get())
2372 .AppendASCII("persistent") 2372 .AppendASCII("persistent")
2373 .AppendASCII(kResourceId + "." + kMd5); 2373 .AppendASCII(kResourceId + "." + kMd5);
2374 TestStoreToCache(kResourceId, 2374 TestStoreToCache(kResourceId,
2375 kMd5, 2375 kMd5,
2376 GetTestFilePath("root_feed.json"), // Anything works. 2376 GetTestFilePath("root_feed.json"), // Anything works.
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
2621 2621
2622 // Try to close the same file twice. 2622 // Try to close the same file twice.
2623 file_system_->CloseFile(kFileInRoot, close_file_callback); 2623 file_system_->CloseFile(kFileInRoot, close_file_callback);
2624 message_loop_.Run(); 2624 message_loop_.Run();
2625 2625
2626 // It must fail. 2626 // It must fail.
2627 EXPECT_EQ(base::PLATFORM_FILE_ERROR_NOT_FOUND, callback_helper_->last_error_); 2627 EXPECT_EQ(base::PLATFORM_FILE_ERROR_NOT_FOUND, callback_helper_->last_error_);
2628 } 2628 }
2629 2629
2630 } // namespace gdata 2630 } // namespace gdata
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698