update_engine: Move test-only utils to test_utils.{h,cc}.
utils.{h,cc} contains a collections of basic or small functions used
in different parts of the codebase. The test_utils.{h,cc} instead
contains functions only required during testing split out to a
separated file to be reused in different tests.
This CL moves without changes some functions defined in utils.h that
were only used during unittests. Two other basic functions were replaced
by the same function already present in base/ (StringHasSuffix and
StringHasPrefix). The functions in test_utils.h now have their own
namespace chromeos_update_engine::test_utils so is clear they come
from the test_utils file, in the same way the ones from utils are
in their own namespace.
Some othe minor linter fixes included here.
BUG=chromium:351429
TEST=Unittest still pass.
Change-Id: I73ab72a14158cb21c8e1f404cbc728423bc8f34f
Reviewed-on: https://chromium-review.googlesource.com/229021
Reviewed-by: Alex Deymo <deymo@chromium.org>
Commit-Queue: Alex Deymo <deymo@chromium.org>
Tested-by: Alex Deymo <deymo@chromium.org>
diff --git a/omaha_request_action_unittest.cc b/omaha_request_action_unittest.cc
index bcdee84..227dde7 100644
--- a/omaha_request_action_unittest.cc
+++ b/omaha_request_action_unittest.cc
@@ -30,6 +30,8 @@
using base::Time;
using base::TimeDelta;
+using chromeos_update_engine::test_utils::System;
+using chromeos_update_engine::test_utils::WriteFileString;
using std::string;
using std::vector;
using testing::AllOf;
@@ -1832,7 +1834,7 @@
"version=\"0.0.0.0\" from_version=\"1.2.3.4\" "
"track=\"stable-channel\" from_track=\"canary-channel\" "));
- ASSERT_TRUE(utils::RecursiveUnlinkDir(test_dir));
+ ASSERT_TRUE(test_utils::RecursiveUnlinkDir(test_dir));
}
TEST_F(OmahaRequestActionTest, TestChangingToLessStableChannel) {