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

Unified Diff: third_party/libaddressinput/chromium/chrome_storage_impl_test.cc

Issue 98623005: rAc i18n: implement storage interface for libaddressinput (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add forgotten file Created 7 years 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
Index: third_party/libaddressinput/chromium/chrome_storage_impl_test.cc
diff --git a/third_party/libaddressinput/chromium/cpp/test/fake_storage.cc b/third_party/libaddressinput/chromium/chrome_storage_impl_test.cc
similarity index 51%
copy from third_party/libaddressinput/chromium/cpp/test/fake_storage.cc
copy to third_party/libaddressinput/chromium/chrome_storage_impl_test.cc
index 531b23d14718a6738e0635404e8bc89b06e7a8ee..157c52f53a840709dcb26e7123f0d70e54ab4720 100644
--- a/third_party/libaddressinput/chromium/cpp/test/fake_storage.cc
+++ b/third_party/libaddressinput/chromium/chrome_storage_impl_test.cc
@@ -12,29 +12,40 @@
// See the License for the specific language governing permissions and
// limitations under the License.
please use gerrit instead 2013/12/20 02:04:40 Use Chrome's license/copyright header, please.
Evan Stade 2013/12/20 03:21:56 Done.
-#include "fake_storage.h"
+#include "chrome_storage_impl.h"
-#include <map>
#include <string>
+#include <gtest/gtest.h>
please use gerrit instead 2013/12/20 02:04:40 Since this code is not part of libaddressinput, th
Evan Stade 2013/12/20 03:21:56 Done. also changed the name of this file to match
+
+#include "base/prefs/value_map_pref_store.h"
+#include "cpp/test/storage_test_runner.h"
+
namespace i18n {
namespace addressinput {
-FakeStorage::FakeStorage() {}
+namespace {
-FakeStorage::~FakeStorage() {}
+// Tests for ChromeStorageImpl object.
+class ChromeStorageImplTest : public testing::Test {
+ protected:
+ ChromeStorageImplTest()
+ : store_(new ValueMapPrefStore()),
+ storage_(store_.get()),
+ runner_(&storage_) {}
-void FakeStorage::Put(const std::string& key, const std::string& data) {
- data_[key] = data;
-}
+ virtual ~ChromeStorageImplTest() {}
-void FakeStorage::Get(const std::string& key,
- scoped_ptr<Callback> data_ready) const {
- std::map<std::string, std::string>::const_iterator data_it = data_.find(key);
- bool success = data_it != data_.end();
- std::string data = success ? data_it->second : std::string();
- (*data_ready)(success, key, data);
+ scoped_refptr<ValueMapPrefStore> store_;
+ ChromeStorageImpl storage_;
+ StorageTestRunner runner_;
+};
+
+TEST_F(ChromeStorageImplTest, StandardStorageTests) {
+ EXPECT_NO_FATAL_FAILURE(runner_.RunAllTests());
}
+} // namespace
+
} // namespace addressinput
} // namespace i18n

Powered by Google App Engine
This is Rietveld 408576698