OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/file_util.h" | 5 #include "base/file_util.h" |
6 #include "base/platform_file.h" | 6 #include "base/platform_file.h" |
7 #include "base/scoped_temp_dir.h" | 7 #include "base/scoped_temp_dir.h" |
8 #include "base/time.h" | 8 #include "base/time.h" |
9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
10 | 10 |
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 bytes_read = ReadFully(file, 0, data_read, kTestDataSize); | 253 bytes_read = ReadFully(file, 0, data_read, kTestDataSize); |
254 EXPECT_EQ(file_size, bytes_read); | 254 EXPECT_EQ(file_size, bytes_read); |
255 for (int i = 0; i < file_size; i++) | 255 for (int i = 0; i < file_size; i++) |
256 EXPECT_EQ(data_to_write[i], data_read[i]); | 256 EXPECT_EQ(data_to_write[i], data_read[i]); |
257 | 257 |
258 // Close the file handle to allow the temp directory to be deleted. | 258 // Close the file handle to allow the temp directory to be deleted. |
259 base::ClosePlatformFile(file); | 259 base::ClosePlatformFile(file); |
260 } | 260 } |
261 | 261 |
262 // Flakily fails: http://crbug.com/86494 | 262 // Flakily fails: http://crbug.com/86494 |
263 TEST(PlatformFile, FLAKY_TouchGetInfoPlatformFile) { | 263 TEST(PlatformFile, DISABLED_TouchGetInfoPlatformFile) { |
264 ScopedTempDir temp_dir; | 264 ScopedTempDir temp_dir; |
265 ASSERT_TRUE(temp_dir.CreateUniqueTempDir()); | 265 ASSERT_TRUE(temp_dir.CreateUniqueTempDir()); |
266 base::PlatformFile file = base::CreatePlatformFile( | 266 base::PlatformFile file = base::CreatePlatformFile( |
267 temp_dir.path().AppendASCII("touch_get_info_file"), | 267 temp_dir.path().AppendASCII("touch_get_info_file"), |
268 base::PLATFORM_FILE_CREATE | | 268 base::PLATFORM_FILE_CREATE | |
269 base::PLATFORM_FILE_WRITE | | 269 base::PLATFORM_FILE_WRITE | |
270 base::PLATFORM_FILE_WRITE_ATTRIBUTES, | 270 base::PLATFORM_FILE_WRITE_ATTRIBUTES, |
271 NULL, NULL); | 271 NULL, NULL); |
272 EXPECT_NE(base::kInvalidPlatformFileValue, file); | 272 EXPECT_NE(base::kInvalidPlatformFileValue, file); |
273 | 273 |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
322 EXPECT_EQ(info.last_modified.ToInternalValue(), | 322 EXPECT_EQ(info.last_modified.ToInternalValue(), |
323 new_last_modified.ToInternalValue()); | 323 new_last_modified.ToInternalValue()); |
324 #endif | 324 #endif |
325 | 325 |
326 EXPECT_EQ(info.creation_time.ToInternalValue(), | 326 EXPECT_EQ(info.creation_time.ToInternalValue(), |
327 creation_time.ToInternalValue()); | 327 creation_time.ToInternalValue()); |
328 | 328 |
329 // Close the file handle to allow the temp directory to be deleted. | 329 // Close the file handle to allow the temp directory to be deleted. |
330 base::ClosePlatformFile(file); | 330 base::ClosePlatformFile(file); |
331 } | 331 } |
OLD | NEW |