mock_category_ranker.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334
  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. #ifndef COMPONENTS_NTP_SNIPPETS_CATEGORY_RANKERS_MOCK_CATEGORY_RANKER_H_
  5. #define COMPONENTS_NTP_SNIPPETS_CATEGORY_RANKERS_MOCK_CATEGORY_RANKER_H_
  6. #include "base/time/time.h"
  7. #include "components/ntp_snippets/category.h"
  8. #include "components/ntp_snippets/category_rankers/category_ranker.h"
  9. #include "testing/gmock/include/gmock/gmock.h"
  10. namespace ntp_snippets {
  11. class MockCategoryRanker : public CategoryRanker {
  12. public:
  13. MockCategoryRanker();
  14. ~MockCategoryRanker() override;
  15. MOCK_CONST_METHOD2(Compare, bool(Category left, Category right));
  16. MOCK_METHOD2(ClearHistory, void(base::Time begin, base::Time end));
  17. MOCK_METHOD1(AppendCategoryIfNecessary, void(Category category));
  18. MOCK_METHOD2(InsertCategoryBeforeIfNecessary,
  19. void(Category category_to_insert, Category anchor));
  20. MOCK_METHOD2(InsertCategoryAfterIfNecessary,
  21. void(Category category_to_insert, Category anchor));
  22. MOCK_METHOD0(GetDebugData, std::vector<CategoryRanker::DebugDataItem>());
  23. MOCK_METHOD1(OnSuggestionOpened, void(Category category));
  24. MOCK_METHOD1(OnCategoryDismissed, void(Category Category));
  25. };
  26. } // namespace ntp_snippets
  27. #endif // COMPONENTS_NTP_SNIPPETS_CATEGORY_RANKERS_MOCK_CATEGORY_RANKER_H_