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

Unified Diff: chrome/installer/util/copy_tree_work_item_unittest.cc

Issue 6377011: wstring: use a few more FilePaths to remove Hack functions (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix2 Created 9 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/installer/util/copy_tree_work_item.cc ('k') | chrome/installer/util/work_item.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/installer/util/copy_tree_work_item_unittest.cc
diff --git a/chrome/installer/util/copy_tree_work_item_unittest.cc b/chrome/installer/util/copy_tree_work_item_unittest.cc
index 9314799f3cd547ef14e8806cc44ff4b5e48a28bd..931dff8d28552d6ccf6ed238a6155081c0a34853 100644
--- a/chrome/installer/util/copy_tree_work_item_unittest.cc
+++ b/chrome/installer/util/copy_tree_work_item_unittest.cc
@@ -107,10 +107,11 @@ TEST_F(CopyTreeWorkItemTest, CopyFile) {
// test Do()
scoped_ptr<CopyTreeWorkItem> work_item(
- WorkItem::CreateCopyTreeWorkItem(file_name_from.ToWStringHack(),
- file_name_to.ToWStringHack(),
- temp_dir_.ToWStringHack(),
- WorkItem::ALWAYS));
+ WorkItem::CreateCopyTreeWorkItem(file_name_from,
+ file_name_to,
+ temp_dir_,
+ WorkItem::ALWAYS,
+ FilePath()));
EXPECT_TRUE(work_item->Do());
@@ -148,10 +149,11 @@ TEST_F(CopyTreeWorkItemTest, CopyFileOverwrite) {
// test Do() with always_overwrite being true.
scoped_ptr<CopyTreeWorkItem> work_item(
- WorkItem::CreateCopyTreeWorkItem(file_name_from.ToWStringHack(),
- file_name_to.ToWStringHack(),
- temp_dir_.ToWStringHack(),
- WorkItem::ALWAYS));
+ WorkItem::CreateCopyTreeWorkItem(file_name_from,
+ file_name_to,
+ temp_dir_,
+ WorkItem::ALWAYS,
+ FilePath()));
EXPECT_TRUE(work_item->Do());
@@ -171,10 +173,11 @@ TEST_F(CopyTreeWorkItemTest, CopyFileOverwrite) {
// test Do() with always_overwrite being false.
// the file is still overwritten since the content is different.
work_item.reset(
- WorkItem::CreateCopyTreeWorkItem(file_name_from.ToWStringHack(),
- file_name_to.ToWStringHack(),
- temp_dir_.ToWStringHack(),
- WorkItem::IF_DIFFERENT));
+ WorkItem::CreateCopyTreeWorkItem(file_name_from,
+ file_name_to,
+ temp_dir_,
+ WorkItem::IF_DIFFERENT,
+ FilePath()));
EXPECT_TRUE(work_item->Do());
@@ -220,10 +223,11 @@ TEST_F(CopyTreeWorkItemTest, CopyFileSameContent) {
// test Do() with always_overwrite being true.
scoped_ptr<CopyTreeWorkItem> work_item(
- WorkItem::CreateCopyTreeWorkItem(file_name_from.ToWStringHack(),
- file_name_to.ToWStringHack(),
- temp_dir_.ToWStringHack(),
- WorkItem::ALWAYS));
+ WorkItem::CreateCopyTreeWorkItem(file_name_from,
+ file_name_to,
+ temp_dir_,
+ WorkItem::ALWAYS,
+ FilePath()));
EXPECT_TRUE(work_item->Do());
@@ -248,10 +252,11 @@ TEST_F(CopyTreeWorkItemTest, CopyFileSameContent) {
// test Do() with always_overwrite being false. nothing should change.
work_item.reset(
- WorkItem::CreateCopyTreeWorkItem(file_name_from.ToWStringHack(),
- file_name_to.ToWStringHack(),
- temp_dir_.ToWStringHack(),
- WorkItem::IF_DIFFERENT));
+ WorkItem::CreateCopyTreeWorkItem(file_name_from,
+ file_name_to,
+ temp_dir_,
+ WorkItem::IF_DIFFERENT,
+ FilePath()));
EXPECT_TRUE(work_item->Do());
@@ -299,10 +304,11 @@ TEST_F(CopyTreeWorkItemTest, CopyFileAndCleanup) {
{
// test Do().
scoped_ptr<CopyTreeWorkItem> work_item(
- WorkItem::CreateCopyTreeWorkItem(file_name_from.ToWStringHack(),
- file_name_to.ToWStringHack(),
- temp_dir_.ToWStringHack(),
- WorkItem::IF_DIFFERENT));
+ WorkItem::CreateCopyTreeWorkItem(file_name_from,
+ file_name_to,
+ temp_dir_,
+ WorkItem::IF_DIFFERENT,
+ FilePath()));
EXPECT_TRUE(work_item->Do());
@@ -361,10 +367,11 @@ TEST_F(CopyTreeWorkItemTest, CopyFileInUse) {
// test Do().
scoped_ptr<CopyTreeWorkItem> work_item(
- WorkItem::CreateCopyTreeWorkItem(file_name_from.ToWStringHack(),
- file_name_to.ToWStringHack(),
- temp_dir_.ToWStringHack(),
- WorkItem::IF_DIFFERENT));
+ WorkItem::CreateCopyTreeWorkItem(file_name_from,
+ file_name_to,
+ temp_dir_,
+ WorkItem::IF_DIFFERENT,
+ FilePath()));
EXPECT_TRUE(work_item->Do());
@@ -439,11 +446,11 @@ TEST_F(CopyTreeWorkItemTest, NewNameAndCopyTest) {
// test Do().
scoped_ptr<CopyTreeWorkItem> work_item(
- WorkItem::CreateCopyTreeWorkItem(file_name_from.ToWStringHack(),
- file_name_to.ToWStringHack(),
- temp_dir_.ToWStringHack(),
+ WorkItem::CreateCopyTreeWorkItem(file_name_from,
+ file_name_to,
+ temp_dir_,
WorkItem::NEW_NAME_IF_IN_USE,
- alternate_to.ToWStringHack()));
+ alternate_to));
EXPECT_TRUE(work_item->Do());
@@ -474,9 +481,9 @@ TEST_F(CopyTreeWorkItemTest, NewNameAndCopyTest) {
// Now the process has terminated, lets try overwriting the file again
work_item.reset(WorkItem::CreateCopyTreeWorkItem(
- file_name_from.ToWStringHack(), file_name_to.ToWStringHack(),
- temp_dir_.ToWStringHack(), WorkItem::NEW_NAME_IF_IN_USE,
- alternate_to.ToWStringHack()));
+ file_name_from, file_name_to,
+ temp_dir_, WorkItem::NEW_NAME_IF_IN_USE,
+ alternate_to));
if (IsFileInUse(file_name_to))
base::PlatformThread::Sleep(2000);
// If file is still in use, the rest of the test will fail.
@@ -536,9 +543,11 @@ TEST_F(CopyTreeWorkItemTest, FLAKY_IfNotPresentTest) {
// test Do().
scoped_ptr<CopyTreeWorkItem> work_item(
- WorkItem::CreateCopyTreeWorkItem(file_name_from.ToWStringHack(),
- file_name_to.ToWStringHack(), temp_dir_.ToWStringHack(),
- WorkItem::IF_NOT_PRESENT, L""));
+ WorkItem::CreateCopyTreeWorkItem(
+ file_name_from,
+ file_name_to, temp_dir_,
+ WorkItem::IF_NOT_PRESENT,
+ FilePath()));
EXPECT_TRUE(work_item->Do());
// verify that the source, destination have not changed and backup path
@@ -563,8 +572,9 @@ TEST_F(CopyTreeWorkItemTest, FLAKY_IfNotPresentTest) {
// Now delete the destination and try copying the file again.
file_util::Delete(file_name_to, true);
work_item.reset(WorkItem::CreateCopyTreeWorkItem(
- file_name_from.ToWStringHack(), file_name_to.ToWStringHack(),
- temp_dir_.ToWStringHack(), WorkItem::IF_NOT_PRESENT, L""));
+ file_name_from, file_name_to,
+ temp_dir_, WorkItem::IF_NOT_PRESENT,
+ FilePath()));
EXPECT_TRUE(work_item->Do());
// verify that the source, destination are the same and backup path
@@ -628,10 +638,11 @@ TEST_F(CopyTreeWorkItemTest, FLAKY_CopyFileInUseAndCleanup) {
// test Do().
{
scoped_ptr<CopyTreeWorkItem> work_item(
- WorkItem::CreateCopyTreeWorkItem(file_name_from.ToWStringHack(),
- file_name_to.ToWStringHack(),
- temp_dir_.ToWStringHack(),
- WorkItem::IF_DIFFERENT));
+ WorkItem::CreateCopyTreeWorkItem(file_name_from,
+ file_name_to,
+ temp_dir_,
+ WorkItem::IF_DIFFERENT,
+ FilePath()));
EXPECT_TRUE(work_item->Do());
@@ -690,10 +701,11 @@ TEST_F(CopyTreeWorkItemTest, FLAKY_CopyTree) {
// test Do()
{
scoped_ptr<CopyTreeWorkItem> work_item(
- WorkItem::CreateCopyTreeWorkItem(dir_name_from.ToWStringHack(),
- dir_name_to.ToWStringHack(),
- temp_dir_.ToWStringHack(),
- WorkItem::ALWAYS));
+ WorkItem::CreateCopyTreeWorkItem(dir_name_from,
+ dir_name_to,
+ temp_dir_,
+ WorkItem::ALWAYS,
+ FilePath()));
EXPECT_TRUE(work_item->Do());
}
« no previous file with comments | « chrome/installer/util/copy_tree_work_item.cc ('k') | chrome/installer/util/work_item.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698