summaryrefslogtreecommitdiff
path: root/chromium/components/autofill/core/browser/mock_autocomplete_history_manager.h
blob: 9a87d7fa745558ce80733cf734083d365e997fea (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// Copyright 2018 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 COMPONENTS_AUTOFILL_CORE_BROWSER_MOCK_AUTOCOMPLETE_HISTORY_MANAGER_H_
#define COMPONENTS_AUTOFILL_CORE_BROWSER_MOCK_AUTOCOMPLETE_HISTORY_MANAGER_H_

#include "base/memory/weak_ptr.h"
#include "components/autofill/core/browser/autocomplete_history_manager.h"
#include "testing/gmock/include/gmock/gmock.h"

namespace autofill {

class MockAutocompleteHistoryManager : public AutocompleteHistoryManager {
 public:
  MockAutocompleteHistoryManager();
  ~MockAutocompleteHistoryManager();

  MOCK_METHOD2(Init, void(scoped_refptr<AutofillWebDataService>, bool));
  MOCK_METHOD7(
      OnGetAutocompleteSuggestions,
      void(int query_id,
           bool is_autocomplete_enabled,
           bool autoselect_first_suggestion,
           const base::string16& name,
           const base::string16& prefix,
           const std::string& form_control_type,
           base::WeakPtr<AutocompleteHistoryManager::SuggestionsHandler>
               handler));
  MOCK_METHOD2(OnWillSubmitForm,
               void(const FormData& form, bool is_autocomplete_enabled));
  MOCK_METHOD2(OnWebDataServiceRequestDone,
               void(WebDataServiceBase::Handle,
                    std::unique_ptr<WDTypedResult>));
  MOCK_METHOD1(CancelPendingQueries,
               void(const AutocompleteHistoryManager::SuggestionsHandler*));
  MOCK_METHOD2(OnRemoveAutocompleteEntry,
               void(const base::string16&, const base::string16&));
  MOCK_METHOD1(OnAutocompleteEntrySelected, void(const base::string16&));
};

}  // namespace autofill

#endif  // COMPONENTS_AUTOFILL_CORE_BROWSER_MOCK_AUTOCOMPLETE_HISTORY_MANAGER_H_