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

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

Issue 10020014: Update uses of TimeDelta in chrome/installer. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rebase onto master Created 8 years, 8 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
« no previous file with comments | « chrome/installer/setup/setup_util_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 454 matching lines...) Expand 10 before | Expand all | Expand 10 after
465 EXPECT_TRUE(WaitForSingleObject(pi.hProcess, 10000) == WAIT_OBJECT_0); 465 EXPECT_TRUE(WaitForSingleObject(pi.hProcess, 10000) == WAIT_OBJECT_0);
466 CloseHandle(pi.hProcess); 466 CloseHandle(pi.hProcess);
467 CloseHandle(pi.hThread); 467 CloseHandle(pi.hThread);
468 468
469 // Now the process has terminated, lets try overwriting the file again 469 // Now the process has terminated, lets try overwriting the file again
470 work_item.reset(WorkItem::CreateCopyTreeWorkItem( 470 work_item.reset(WorkItem::CreateCopyTreeWorkItem(
471 file_name_from, file_name_to, 471 file_name_from, file_name_to,
472 temp_dir_.path(), WorkItem::NEW_NAME_IF_IN_USE, 472 temp_dir_.path(), WorkItem::NEW_NAME_IF_IN_USE,
473 alternate_to)); 473 alternate_to));
474 if (IsFileInUse(file_name_to)) 474 if (IsFileInUse(file_name_to))
475 base::PlatformThread::Sleep(2000); 475 base::PlatformThread::Sleep(base::TimeDelta::FromSeconds(2));
476 // If file is still in use, the rest of the test will fail. 476 // If file is still in use, the rest of the test will fail.
477 ASSERT_FALSE(IsFileInUse(file_name_to)); 477 ASSERT_FALSE(IsFileInUse(file_name_to));
478 EXPECT_TRUE(work_item->Do()); 478 EXPECT_TRUE(work_item->Do());
479 479
480 // Get the path of backup file 480 // Get the path of backup file
481 FilePath backup_file(work_item->backup_path_.path()); 481 FilePath backup_file(work_item->backup_path_.path());
482 EXPECT_FALSE(backup_file.empty()); 482 EXPECT_FALSE(backup_file.empty());
483 backup_file = backup_file.AppendASCII("File_To"); 483 backup_file = backup_file.AppendASCII("File_To");
484 484
485 EXPECT_TRUE(file_util::PathExists(file_name_from)); 485 EXPECT_TRUE(file_util::PathExists(file_name_from));
(...skipping 228 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
« no previous file with comments | « chrome/installer/setup/setup_util_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698