chrome/browser/chromeos/drive/drive_cache_unittest.cc
// Test is disabled because it is flaky (http://crbug.com/134146)
Test is disabled because it is flaky
Test is disabled because it is flaky
TEST_F(DriveCacheTest, PinAndUnpinDirtyCache) {
  fake_free_disk_space_getter_->set_fake_free_disk_space(kLotsOfSpace);
  std::string resource_id("pdf:1a2b");
  std::string md5("abcdef0123456789");
  EXPECT_CALL(*mock_cache_observer_, OnCachePinned(resource_id, md5)).Times(1);
  EXPECT_CALL(*mock_cache_observer_, OnCacheUnpinned(resource_id, md5))
      .Times(1);
  TestStoreToCache(
      resource_id, md5,
      google_apis::test_util::GetTestFilePath("gdata/root_feed.json"),
      DRIVE_FILE_OK, test_util::TEST_CACHE_STATE_PRESENT,
      DriveCache::CACHE_TYPE_TMP);
  TestMarkDirty(resource_id, md5, DRIVE_FILE_OK,
                test_util::TEST_CACHE_STATE_PRESENT |
                test_util::TEST_CACHE_STATE_DIRTY |
                test_util::TEST_CACHE_STATE_PERSISTENT,
                DriveCache::CACHE_TYPE_PERSISTENT);
  FilePath dirty_path = GetCacheFilePath(
      resource_id,
      md5,
      DriveCache::CACHE_TYPE_PERSISTENT,
      DriveCache::CACHED_FILE_LOCALLY_MODIFIED);
  EXPECT_TRUE(file_util::PathExists(dirty_path));
  TestPin(resource_id, md5, DRIVE_FILE_OK,
          test_util::TEST_CACHE_STATE_PRESENT |
          test_util::TEST_CACHE_STATE_DIRTY |
          test_util::TEST_CACHE_STATE_PINNED |
          test_util::TEST_CACHE_STATE_PERSISTENT,
          DriveCache::CACHE_TYPE_PERSISTENT);
  EXPECT_TRUE(file_util::PathExists(dirty_path));
  TestUnpin(resource_id, md5, DRIVE_FILE_OK,
            test_util::TEST_CACHE_STATE_PRESENT |
            test_util::TEST_CACHE_STATE_DIRTY |
            test_util::TEST_CACHE_STATE_PERSISTENT,
            DriveCache::CACHE_TYPE_PERSISTENT);
  EXPECT_TRUE(file_util::PathExists(dirty_path));
}
TEST_F ( DriveCacheTest , PinAndUnpinDirtyCache ) { fake_free_disk_space_getter_ -> set_fake_free_disk_space ( kLotsOfSpace ) ; std :: string resource_id ( " " ) ; std :: string md5 ( " " ) ; EXPECT_CALL ( * mock_cache_observer_ , OnCachePinned ( resource_id , md5 ) ) . Times ( 1 ) ; EXPECT_CALL ( * mock_cache_observer_ , OnCacheUnpinned ( resource_id , md5 ) ) . Times ( 1 ) ; TestStoreToCache ( resource_id , md5 , google_apis :: test_util :: GetTestFilePath ( " " ) , DRIVE_FILE_OK , test_util :: TEST_CACHE_STATE_PRESENT , DriveCache :: CACHE_TYPE_TMP ) ; TestMarkDirty ( resource_id , md5 , DRIVE_FILE_OK , test_util :: TEST_CACHE_STATE_PRESENT | test_util :: TEST_CACHE_STATE_DIRTY | test_util :: TEST_CACHE_STATE_PERSISTENT , DriveCache :: CACHE_TYPE_PERSISTENT ) ; FilePath dirty_path = GetCacheFilePath ( resource_id , md5 , DriveCache :: CACHE_TYPE_PERSISTENT , DriveCache :: CACHED_FILE_LOCALLY_MODIFIED ) ; EXPECT_TRUE ( file_util :: PathExists ( dirty_path ) ) ; TestPin ( resource_id , md5 , DRIVE_FILE_OK , test_util :: TEST_CACHE_STATE_PRESENT | test_util :: TEST_CACHE_STATE_DIRTY | test_util :: TEST_CACHE_STATE_PINNED | test_util :: TEST_CACHE_STATE_PERSISTENT , DriveCache :: CACHE_TYPE_PERSISTENT ) ; EXPECT_TRUE ( file_util :: PathExists ( dirty_path ) ) ; TestUnpin ( resource_id , md5 , DRIVE_FILE_OK , test_util :: TEST_CACHE_STATE_PRESENT | test_util :: TEST_CACHE_STATE_DIRTY | test_util :: TEST_CACHE_STATE_PERSISTENT , DriveCache :: CACHE_TYPE_PERSISTENT ) ; EXPECT_TRUE ( file_util :: PathExists ( dirty_path ) ) ; }
Test is disabled because it is flaky (http://crbug.com/134146)
Test is disabled because it is flaky ( http : // crbug . com / 134146 )
// First store a file to cache and mark it as dirty. // Verifies dirty file exists. // Pin the dirty file. // Verify dirty file still exist at the same pathname. // Unpin the dirty file. // Verify dirty file still exist at the same pathname.