shill: add FakeStore
Some unit tests (e.g. ProfileTests) need to use a
StoreInterface implementation. For tests which verify
the interaction between the class-under-test and the
StoreInterface, we've used MockStore.
For tests which don't care about the interaction, we've
used KeyFileStore. Unfortunately, that will not be
viable on some new platforms.
We could resolve this problem by moving such tests to
JsonStore. But that makes the code hard to understand.
In a quick glance, it would be confusing to see a test
use both KeyFileStore and JsonStore.
Instead, add a FakeStore. This fake provides the
functionality needed by the class under test (namely:
in-memory storage and retrieval). The fake, however,
omits serialization and persistence.
BUG=chromium:23387120
TEST=compile
Change-Id: I7852870fc957d5c123f317e8c2e2c4ae69aa33a7
Reviewed-on: https://chromium-review.googlesource.com/295259
Trybot-Ready: mukesh agrawal <quiche@chromium.org>
Tested-by: mukesh agrawal <quiche@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: mukesh agrawal <quiche@chromium.org>
diff --git a/shill.gyp b/shill.gyp
index f9f9ab2..2762d77 100644
--- a/shill.gyp
+++ b/shill.gyp
@@ -763,6 +763,7 @@
'ethernet/mock_ethernet.cc',
'ethernet/mock_ethernet_service.cc',
'external_task_unittest.cc',
+ 'fake_store.cc',
'file_reader_unittest.cc',
'hook_table_unittest.cc',
'http_proxy_unittest.cc',