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>
36 files changed
tree: 97effd2a6cce73cbb6f131df93284d4fb5efc345
  1. init/
  2. payload_generator/
  3. update_manager/
  4. .gitignore
  5. action.h
  6. action_pipe.h
  7. action_pipe_unittest.cc
  8. action_processor.cc
  9. action_processor.h
  10. action_processor_unittest.cc
  11. action_unittest.cc
  12. bzip.cc
  13. bzip.h
  14. bzip_extent_writer.cc
  15. bzip_extent_writer.h
  16. bzip_extent_writer_unittest.cc
  17. certificate_checker.cc
  18. certificate_checker.h
  19. certificate_checker_unittest.cc
  20. chrome_browser_proxy_resolver.cc
  21. chrome_browser_proxy_resolver.h
  22. chrome_browser_proxy_resolver_unittest.cc
  23. clock.cc
  24. clock.h
  25. clock_interface.h
  26. connection_manager.cc
  27. connection_manager.h
  28. connection_manager_unittest.cc
  29. constants.cc
  30. constants.h
  31. dbus_constants.h
  32. dbus_service.cc
  33. dbus_service.h
  34. dbus_wrapper_interface.h
  35. delta_performer.cc
  36. delta_performer.h
  37. delta_performer_unittest.cc
  38. download_action.cc
  39. download_action.h
  40. download_action_unittest.cc
  41. error_code.h
  42. extent_ranges.cc
  43. extent_ranges.h
  44. extent_ranges_unittest.cc
  45. extent_writer.cc
  46. extent_writer.h
  47. extent_writer_unittest.cc
  48. fake_clock.h
  49. fake_file_writer.h
  50. fake_hardware.h
  51. fake_p2p_manager.h
  52. fake_p2p_manager_configuration.h
  53. fake_prefs.cc
  54. fake_prefs.h
  55. fake_system_state.cc
  56. fake_system_state.h
  57. file_descriptor.cc
  58. file_descriptor.h
  59. file_writer.cc
  60. file_writer.h
  61. file_writer_unittest.cc
  62. filesystem_copier_action.cc
  63. filesystem_copier_action.h
  64. filesystem_copier_action_unittest.cc
  65. glib_utils.cc
  66. glib_utils.h
  67. hardware.cc
  68. hardware.h
  69. hardware_interface.h
  70. http_common.cc
  71. http_common.h
  72. http_fetcher.cc
  73. http_fetcher.h
  74. http_fetcher_unittest.cc
  75. hwid_override.cc
  76. hwid_override.h
  77. hwid_override_unittest.cc
  78. install_plan.cc
  79. install_plan.h
  80. libcurl_http_fetcher.cc
  81. libcurl_http_fetcher.h
  82. local_coverage_rate
  83. main.cc
  84. metrics.cc
  85. metrics.h
  86. mock_action.h
  87. mock_action_processor.h
  88. mock_certificate_checker.h
  89. mock_connection_manager.h
  90. mock_dbus_wrapper.h
  91. mock_file_writer.h
  92. mock_hardware.h
  93. mock_http_fetcher.cc
  94. mock_http_fetcher.h
  95. mock_omaha_request_params.h
  96. mock_p2p_manager.h
  97. mock_payload_state.h
  98. mock_prefs.h
  99. mock_update_attempter.h
  100. multi_range_http_fetcher.cc
  101. multi_range_http_fetcher.h
  102. omaha_hash_calculator.cc
  103. omaha_hash_calculator.h
  104. omaha_hash_calculator_unittest.cc
  105. omaha_request_action.cc
  106. omaha_request_action.h
  107. omaha_request_action_unittest.cc
  108. omaha_request_params.cc
  109. omaha_request_params.h
  110. omaha_request_params_unittest.cc
  111. omaha_response.h
  112. omaha_response_handler_action.cc
  113. omaha_response_handler_action.h
  114. omaha_response_handler_action_unittest.cc
  115. OWNERS
  116. p2p_manager.cc
  117. p2p_manager.h
  118. p2p_manager_unittest.cc
  119. payload_constants.cc
  120. payload_constants.h
  121. payload_state.cc
  122. payload_state.h
  123. payload_state_interface.h
  124. payload_state_unittest.cc
  125. payload_verifier.cc
  126. payload_verifier.h
  127. postinstall_runner_action.cc
  128. postinstall_runner_action.h
  129. postinstall_runner_action_unittest.cc
  130. prefs.cc
  131. prefs.h
  132. prefs_interface.h
  133. prefs_unittest.cc
  134. proxy_resolver.cc
  135. proxy_resolver.h
  136. real_dbus_wrapper.h
  137. real_system_state.cc
  138. real_system_state.h
  139. run_unittests
  140. sample_omaha_v3_response.xml
  141. subprocess.cc
  142. subprocess.h
  143. subprocess_unittest.cc
  144. system_state.h
  145. terminator.cc
  146. terminator.h
  147. terminator_unittest.cc
  148. test_http_server.cc
  149. test_utils.cc
  150. test_utils.h
  151. test_utils_unittest.cc
  152. testrunner.cc
  153. unittest_key.pem
  154. unittest_key2.pem
  155. update_attempter.cc
  156. update_attempter.h
  157. update_attempter_unittest.cc
  158. update_engine.gyp
  159. update_engine.xml
  160. update_engine_client.cc
  161. update_metadata.proto
  162. UpdateEngine.conf
  163. utils.cc
  164. utils.h
  165. utils_unittest.cc
  166. WATCHLISTS
  167. zip_unittest.cc