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

Side by Side Diff: chrome/installer/util/copy_tree_work_item_unittest.cc

Issue 9406017: Flakiness cleanup: disable flaky tests under chrome/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 10 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) 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 490 matching lines...) Expand 10 before | Expand all | Expand 10 after
501 EXPECT_FALSE(file_util::PathExists(backup_file)); 501 EXPECT_FALSE(file_util::PathExists(backup_file));
502 EXPECT_FALSE(file_util::PathExists(alternate_to)); 502 EXPECT_FALSE(file_util::PathExists(alternate_to));
503 } 503 }
504 504
505 // Test overwrite option IF_NOT_PRESENT: 505 // Test overwrite option IF_NOT_PRESENT:
506 // 1. If destination file/directory exist, the source should not be copied 506 // 1. If destination file/directory exist, the source should not be copied
507 // 2. If destination file/directory do not exist, the source should be copied 507 // 2. If destination file/directory do not exist, the source should be copied
508 // in the destination folder after Do() and should be rolled back after 508 // in the destination folder after Do() and should be rolled back after
509 // Rollback(). 509 // Rollback().
510 // Flaky, http://crbug.com/59785. 510 // Flaky, http://crbug.com/59785.
511 TEST_F(CopyTreeWorkItemTest, FLAKY_IfNotPresentTest) { 511 TEST_F(CopyTreeWorkItemTest, DISABLED_IfNotPresentTest) {
512 // Create source file 512 // Create source file
513 FilePath file_name_from(test_dir_.path()); 513 FilePath file_name_from(test_dir_.path());
514 file_name_from = file_name_from.AppendASCII("File_From"); 514 file_name_from = file_name_from.AppendASCII("File_From");
515 CreateTextFile(file_name_from.value(), text_content_1); 515 CreateTextFile(file_name_from.value(), text_content_1);
516 ASSERT_TRUE(file_util::PathExists(file_name_from)); 516 ASSERT_TRUE(file_util::PathExists(file_name_from));
517 517
518 // Create an executable in destination path by copying ourself to it. 518 // Create an executable in destination path by copying ourself to it.
519 wchar_t exe_full_path_str[MAX_PATH]; 519 wchar_t exe_full_path_str[MAX_PATH];
520 ::GetModuleFileName(NULL, exe_full_path_str, MAX_PATH); 520 ::GetModuleFileName(NULL, exe_full_path_str, MAX_PATH);
521 FilePath exe_full_path(exe_full_path_str); 521 FilePath exe_full_path(exe_full_path_str);
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
583 // verify that the destination does not exist anymore 583 // verify that the destination does not exist anymore
584 EXPECT_TRUE(file_util::PathExists(file_name_from)); 584 EXPECT_TRUE(file_util::PathExists(file_name_from));
585 EXPECT_FALSE(file_util::PathExists(file_name_to)); 585 EXPECT_FALSE(file_util::PathExists(file_name_to));
586 EXPECT_EQ(0, ReadTextFile(file_name_from.value()).compare(text_content_1)); 586 EXPECT_EQ(0, ReadTextFile(file_name_from.value()).compare(text_content_1));
587 EXPECT_FALSE(file_util::PathExists(backup_file)); 587 EXPECT_FALSE(file_util::PathExists(backup_file));
588 } 588 }
589 589
590 // Copy one file without rollback. The existing one in destination is in use. 590 // Copy one file without rollback. The existing one in destination is in use.
591 // Verify it is moved to backup location and stays there. 591 // Verify it is moved to backup location and stays there.
592 // Flaky, http://crbug.com/59783. 592 // Flaky, http://crbug.com/59783.
593 TEST_F(CopyTreeWorkItemTest, FLAKY_CopyFileInUseAndCleanup) { 593 TEST_F(CopyTreeWorkItemTest, DISABLED_CopyFileInUseAndCleanup) {
594 // Create source file 594 // Create source file
595 FilePath file_name_from(test_dir_.path()); 595 FilePath file_name_from(test_dir_.path());
596 file_name_from = file_name_from.AppendASCII("File_From"); 596 file_name_from = file_name_from.AppendASCII("File_From");
597 CreateTextFile(file_name_from.value(), text_content_1); 597 CreateTextFile(file_name_from.value(), text_content_1);
598 ASSERT_TRUE(file_util::PathExists(file_name_from)); 598 ASSERT_TRUE(file_util::PathExists(file_name_from));
599 599
600 // Create an executable in destination path by copying ourself to it. 600 // Create an executable in destination path by copying ourself to it.
601 wchar_t exe_full_path_str[MAX_PATH]; 601 wchar_t exe_full_path_str[MAX_PATH];
602 ::GetModuleFileName(NULL, exe_full_path_str, MAX_PATH); 602 ::GetModuleFileName(NULL, exe_full_path_str, MAX_PATH);
603 FilePath exe_full_path(exe_full_path_str); 603 FilePath exe_full_path(exe_full_path_str);
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
656 656
657 TerminateProcess(pi.hProcess, 0); 657 TerminateProcess(pi.hProcess, 0);
658 // make sure the handle is closed. 658 // make sure the handle is closed.
659 EXPECT_TRUE(WaitForSingleObject(pi.hProcess, 10000) == WAIT_OBJECT_0); 659 EXPECT_TRUE(WaitForSingleObject(pi.hProcess, 10000) == WAIT_OBJECT_0);
660 CloseHandle(pi.hProcess); 660 CloseHandle(pi.hProcess);
661 CloseHandle(pi.hThread); 661 CloseHandle(pi.hThread);
662 } 662 }
663 663
664 // Copy a tree from source to destination. 664 // Copy a tree from source to destination.
665 // Flaky, http://crbug.com/59784. 665 // Flaky, http://crbug.com/59784.
666 TEST_F(CopyTreeWorkItemTest, FLAKY_CopyTree) { 666 TEST_F(CopyTreeWorkItemTest, DISABLED_CopyTree) {
667 // Create source tree 667 // Create source tree
668 FilePath dir_name_from(test_dir_.path()); 668 FilePath dir_name_from(test_dir_.path());
669 dir_name_from = dir_name_from.AppendASCII("from"); 669 dir_name_from = dir_name_from.AppendASCII("from");
670 file_util::CreateDirectory(dir_name_from); 670 file_util::CreateDirectory(dir_name_from);
671 ASSERT_TRUE(file_util::PathExists(dir_name_from)); 671 ASSERT_TRUE(file_util::PathExists(dir_name_from));
672 672
673 FilePath dir_name_from_1(dir_name_from); 673 FilePath dir_name_from_1(dir_name_from);
674 dir_name_from_1 = dir_name_from_1.AppendASCII("1"); 674 dir_name_from_1 = dir_name_from_1.AppendASCII("1");
675 file_util::CreateDirectory(dir_name_from_1); 675 file_util::CreateDirectory(dir_name_from_1);
676 ASSERT_TRUE(file_util::PathExists(dir_name_from_1)); 676 ASSERT_TRUE(file_util::PathExists(dir_name_from_1));
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
714 EXPECT_TRUE(file_util::ContentsEqual(file_name_from_1, file_name_to_1)); 714 EXPECT_TRUE(file_util::ContentsEqual(file_name_from_1, file_name_to_1));
715 715
716 FilePath file_name_to_2(dir_name_to); 716 FilePath file_name_to_2(dir_name_to);
717 file_name_to_2 = file_name_to_2.AppendASCII("2"); 717 file_name_to_2 = file_name_to_2.AppendASCII("2");
718 file_name_to_2 = file_name_to_2.AppendASCII("File_2.txt"); 718 file_name_to_2 = file_name_to_2.AppendASCII("File_2.txt");
719 EXPECT_TRUE(file_util::PathExists(file_name_to_2)); 719 EXPECT_TRUE(file_util::PathExists(file_name_to_2));
720 VLOG(1) << "compare " << file_name_from_2.value() 720 VLOG(1) << "compare " << file_name_from_2.value()
721 << " and " << file_name_to_2.value(); 721 << " and " << file_name_to_2.value();
722 EXPECT_TRUE(file_util::ContentsEqual(file_name_from_2, file_name_to_2)); 722 EXPECT_TRUE(file_util::ContentsEqual(file_name_from_2, file_name_to_2));
723 } 723 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698