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 <windows.h> | 5 #include <windows.h> |
6 | 6 |
7 #include <fstream> | 7 #include <fstream> |
8 | 8 |
9 #include "base/base_paths.h" | 9 #include "base/base_paths.h" |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
379 work_item->Rollback(); | 379 work_item->Rollback(); |
380 | 380 |
381 EXPECT_TRUE(file_util::PathExists(from_dir)); | 381 EXPECT_TRUE(file_util::PathExists(from_dir)); |
382 EXPECT_TRUE(file_util::ContentsEqual(exe_full_path, from_file)); | 382 EXPECT_TRUE(file_util::ContentsEqual(exe_full_path, from_file)); |
383 EXPECT_TRUE(file_util::PathExists(to_dir)); | 383 EXPECT_TRUE(file_util::PathExists(to_dir)); |
384 EXPECT_EQ(0, ReadTextFile(to_file).compare(kTextContent1)); | 384 EXPECT_EQ(0, ReadTextFile(to_file).compare(kTextContent1)); |
385 } | 385 } |
386 | 386 |
387 // Move one directory from source to destination when destination already | 387 // Move one directory from source to destination when destination already |
388 // exists. | 388 // exists. |
389 TEST_F(MoveTreeWorkItemTest, MoveDirectoryDestExistsCheckForDuplicatesFull) { | 389 TEST_F(MoveTreeWorkItemTest, |
| 390 FLAKY_MoveDirectoryDestExistsCheckForDuplicatesFull) { |
390 // Create two level deep source dir | 391 // Create two level deep source dir |
391 FilePath from_dir1(temp_from_dir_.path()); | 392 FilePath from_dir1(temp_from_dir_.path()); |
392 from_dir1 = from_dir1.AppendASCII("From_Dir1"); | 393 from_dir1 = from_dir1.AppendASCII("From_Dir1"); |
393 file_util::CreateDirectory(from_dir1); | 394 file_util::CreateDirectory(from_dir1); |
394 ASSERT_TRUE(file_util::PathExists(from_dir1)); | 395 ASSERT_TRUE(file_util::PathExists(from_dir1)); |
395 | 396 |
396 FilePath from_dir2(from_dir1); | 397 FilePath from_dir2(from_dir1); |
397 from_dir2 = from_dir2.AppendASCII("From_Dir2"); | 398 from_dir2 = from_dir2.AppendASCII("From_Dir2"); |
398 file_util::CreateDirectory(from_dir2); | 399 file_util::CreateDirectory(from_dir2); |
399 ASSERT_TRUE(file_util::PathExists(from_dir2)); | 400 ASSERT_TRUE(file_util::PathExists(from_dir2)); |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
543 // the source files. | 544 // the source files. |
544 EXPECT_TRUE(file_util::PathExists(from_dir1)); | 545 EXPECT_TRUE(file_util::PathExists(from_dir1)); |
545 EXPECT_TRUE(file_util::PathExists(to_dir)); | 546 EXPECT_TRUE(file_util::PathExists(to_dir)); |
546 EXPECT_TRUE(file_util::PathExists(orig_to_file)); | 547 EXPECT_TRUE(file_util::PathExists(orig_to_file)); |
547 EXPECT_EQ(0, ReadTextFile(orig_to_file).compare(kTextContent1)); | 548 EXPECT_EQ(0, ReadTextFile(orig_to_file).compare(kTextContent1)); |
548 EXPECT_EQ(0, ReadTextFile(from_file).compare(kTextContent1)); | 549 EXPECT_EQ(0, ReadTextFile(from_file).compare(kTextContent1)); |
549 | 550 |
550 // Also, after rollback the new "to" file should be gone. | 551 // Also, after rollback the new "to" file should be gone. |
551 EXPECT_FALSE(file_util::PathExists(new_to_file2)); | 552 EXPECT_FALSE(file_util::PathExists(new_to_file2)); |
552 } | 553 } |
OLD | NEW |