Index: ui/app_list/presenter/test/test_app_list_presenter.h |
diff --git a/ui/app_list/presenter/test/test_app_list_presenter.h b/ui/app_list/presenter/test/test_app_list_presenter.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..db7fab3287e8c3c5d65b19fb17c12b6c7b4f414b |
--- /dev/null |
+++ b/ui/app_list/presenter/test/test_app_list_presenter.h |
@@ -0,0 +1,44 @@ |
+// Copyright 2016 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 UI_APP_LIST_PRESENTER_TEST_TEST_APP_LIST_PRESENTER_H_ |
+#define UI_APP_LIST_PRESENTER_TEST_TEST_APP_LIST_PRESENTER_H_ |
+ |
+#include "base/macros.h" |
+#include "mojo/public/cpp/bindings/binding.h" |
+#include "ui/app_list/presenter/app_list_presenter.mojom.h" |
+ |
+namespace app_list { |
+ |
+// A test implementation of AppListPresenter that records function call counts. |
+// Registers itself as the presenter for the app list on construction. |
+class TestAppListPresenter : public app_list::mojom::AppListPresenter { |
mfomitchev
2016/12/22 03:17:45
This and other test classes should probably be in
msw
2016/12/22 16:31:52
Done.
|
+ public: |
+ TestAppListPresenter(); |
+ ~TestAppListPresenter() override; |
+ |
+ app_list::mojom::AppListPresenterPtr CreateInterfacePtrAndBind(); |
+ |
+ // app_list::mojom::AppListPresenter: |
+ void Show(int64_t display_id) override; |
+ void Dismiss() override; |
+ void ToggleAppList(int64_t display_id) override; |
+ |
+ size_t show_count() const { return show_count_; } |
+ size_t dismiss_count() const { return dismiss_count_; } |
+ size_t toggle_count() const { return toggle_count_; } |
+ |
+ private: |
+ size_t show_count_ = 0u; |
+ size_t dismiss_count_ = 0u; |
+ size_t toggle_count_ = 0u; |
+ |
+ mojo::Binding<app_list::mojom::AppListPresenter> binding_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(TestAppListPresenter); |
+}; |
+ |
+} // namespace app_list |
+ |
+#endif // UI_APP_LIST_PRESENTER_TEST_TEST_APP_LIST_PRESENTER_H_ |