forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathfake_ranker_model_loader.h
38 lines (27 loc) · 1.18 KB
/
fake_ranker_model_loader.h
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
// Copyright 2017 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_ASSIST_RANKER_FAKE_RANKER_MODEL_LOADER_H_
#define COMPONENTS_ASSIST_RANKER_FAKE_RANKER_MODEL_LOADER_H_
#include <memory>
#include "components/assist_ranker/proto/ranker_model.pb.h"
#include "components/assist_ranker/ranker_model_loader.h"
namespace assist_ranker {
namespace testing {
// Simplified RankerModelLoader for testing.
class FakeRankerModelLoader : public RankerModelLoader {
public:
FakeRankerModelLoader(ValidateModelCallback validate_model_cb,
OnModelAvailableCallback on_model_available_cb,
std::unique_ptr<RankerModel> ranker_model);
~FakeRankerModelLoader() override;
void NotifyOfRankerActivity() override;
private:
std::unique_ptr<RankerModel> ranker_model_;
const ValidateModelCallback validate_model_cb_;
const OnModelAvailableCallback on_model_available_cb_;
DISALLOW_COPY_AND_ASSIGN(FakeRankerModelLoader);
};
} // namespace testing
} // namespace assist_ranker
#endif // COMPONENTS_ASSIST_RANKER_FAKE_RANKER_MODEL_LOADER_H_