OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef UI_APP_LIST_PRESENTER_TEST_TEST_APP_LIST_PRESENTER_H_ |
| 6 #define UI_APP_LIST_PRESENTER_TEST_TEST_APP_LIST_PRESENTER_H_ |
| 7 |
| 8 #include "base/macros.h" |
| 9 #include "mojo/public/cpp/bindings/binding.h" |
| 10 #include "ui/app_list/presenter/app_list_presenter.mojom.h" |
| 11 |
| 12 namespace app_list { |
| 13 namespace test { |
| 14 |
| 15 // A test implementation of AppListPresenter that records function call counts. |
| 16 // Registers itself as the presenter for the app list on construction. |
| 17 class TestAppListPresenter : public app_list::mojom::AppListPresenter { |
| 18 public: |
| 19 TestAppListPresenter(); |
| 20 ~TestAppListPresenter() override; |
| 21 |
| 22 app_list::mojom::AppListPresenterPtr CreateInterfacePtrAndBind(); |
| 23 |
| 24 // app_list::mojom::AppListPresenter: |
| 25 void Show(int64_t display_id) override; |
| 26 void Dismiss() override; |
| 27 void ToggleAppList(int64_t display_id) override; |
| 28 |
| 29 size_t show_count() const { return show_count_; } |
| 30 size_t dismiss_count() const { return dismiss_count_; } |
| 31 size_t toggle_count() const { return toggle_count_; } |
| 32 |
| 33 private: |
| 34 size_t show_count_ = 0u; |
| 35 size_t dismiss_count_ = 0u; |
| 36 size_t toggle_count_ = 0u; |
| 37 |
| 38 mojo::Binding<app_list::mojom::AppListPresenter> binding_; |
| 39 |
| 40 DISALLOW_COPY_AND_ASSIGN(TestAppListPresenter); |
| 41 }; |
| 42 |
| 43 } // namespace test |
| 44 } // namespace app_list |
| 45 |
| 46 #endif // UI_APP_LIST_PRESENTER_TEST_TEST_APP_LIST_PRESENTER_H_ |
OLD | NEW |