Index: third_party/libaddressinput/chromium/storage_test_runner.h |
diff --git a/third_party/libaddressinput/chromium/storage_test_runner.h b/third_party/libaddressinput/chromium/storage_test_runner.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..113587dd6499cbf7e9e2bf6f0fc0d08d3c7f3507 |
--- /dev/null |
+++ b/third_party/libaddressinput/chromium/storage_test_runner.h |
@@ -0,0 +1,47 @@ |
+// Copyright 2014 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef THIRD_PARTY_LIBADDRESSINPUT_CHROMIUM_STORAGE_TEST_RUNNER_H_ |
+#define THIRD_PARTY_LIBADDRESSINPUT_CHROMIUM_STORAGE_TEST_RUNNER_H_ |
+ |
+#include "third_party/libaddressinput/src/cpp/include/libaddressinput/storage.h" |
+ |
+#include <string> |
+ |
+#include "base/basictypes.h" |
+#include "base/memory/scoped_ptr.h" |
+ |
+namespace autofill { |
+ |
+// A test sutie for ::i18n::addressinput::Storage. |
+class StorageTestRunner { |
+ public: |
+ // Does not take ownership of |storage|. |
+ explicit StorageTestRunner(::i18n::addressinput::Storage* storage); |
+ ~StorageTestRunner(); |
+ |
+ // Runs all the tests from the standard test suite. |
+ void RunAllTests(); |
+ |
+ private: |
+ void ClearValues(); |
+ scoped_ptr< ::i18n::addressinput::Storage::Callback> BuildCallback(); |
+ void OnDataReady(bool success, const std::string& key, std::string* data); |
+ |
+ // Test suite. |
+ void GetWithoutPutReturnsEmptyData(); |
+ void GetReturnsWhatWasPut(); |
+ void SecondPutOverwritesData(); |
+ |
+ ::i18n::addressinput::Storage* storage_; // weak |
+ bool success_; |
+ std::string key_; |
+ std::string data_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(StorageTestRunner); |
+}; |
+ |
+} // namespace autofill |
+ |
+#endif // THIRD_PARTY_LIBADDRESSINPUT_CHROMIUM_STORAGE_TEST_RUNNER_H_ |