| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "chrome/installer/util/conditional_work_item_list.h" | 5 #include "chrome/installer/util/conditional_work_item_list.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
| 10 #include "base/files/scoped_temp_dir.h" | 10 #include "base/files/scoped_temp_dir.h" |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 | 115 |
| 116 std::unique_ptr<StrictMockCondition> condition_false(new StrictMockCondition); | 116 std::unique_ptr<StrictMockCondition> condition_false(new StrictMockCondition); |
| 117 EXPECT_CALL(*condition_false, ShouldRun()).WillOnce(Return(false)); | 117 EXPECT_CALL(*condition_false, ShouldRun()).WillOnce(Return(false)); |
| 118 EXPECT_TRUE(Not(condition_false.release()).ShouldRun()); | 118 EXPECT_TRUE(Not(condition_false.release()).ShouldRun()); |
| 119 } | 119 } |
| 120 | 120 |
| 121 TEST(ConditionalWorkItemListTest, ConditionRunIfFileExists) { | 121 TEST(ConditionalWorkItemListTest, ConditionRunIfFileExists) { |
| 122 base::ScopedTempDir temp_dir; | 122 base::ScopedTempDir temp_dir; |
| 123 ASSERT_TRUE(temp_dir.CreateUniqueTempDir()); | 123 ASSERT_TRUE(temp_dir.CreateUniqueTempDir()); |
| 124 | 124 |
| 125 EXPECT_TRUE(ConditionRunIfFileExists(temp_dir.path()).ShouldRun()); | 125 EXPECT_TRUE(ConditionRunIfFileExists(temp_dir.GetPath()).ShouldRun()); |
| 126 EXPECT_FALSE(ConditionRunIfFileExists( | 126 EXPECT_FALSE(ConditionRunIfFileExists( |
| 127 temp_dir.path().Append(FILE_PATH_LITERAL("DoesNotExist"))) | 127 temp_dir.GetPath().Append(FILE_PATH_LITERAL("DoesNotExist"))) |
| 128 .ShouldRun()); | 128 .ShouldRun()); |
| 129 } | 129 } |
| OLD | NEW |