• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2021 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 /*
18  * Generated mock file from original source file
19  *   Functions generated:8
20  */
21 
22 #include <map>
23 #include <string>
24 
25 extern std::map<std::string, int> mock_function_count_map;
26 
27 #include "common/message_loop_thread.h"
28 #include "common/repeating_timer.h"
29 #include "common/time_util.h"
30 
31 #ifndef UNUSED_ATTR
32 #define UNUSED_ATTR
33 #endif
34 
35 using namespace bluetooth::common;
36 
~RepeatingTimer()37 RepeatingTimer::~RepeatingTimer() { mock_function_count_map[__func__]++; }
IsScheduled() const38 bool RepeatingTimer::IsScheduled() const {
39   mock_function_count_map[__func__]++;
40   return false;
41 }
SchedulePeriodic(const base::WeakPtr<MessageLoopThread> & thread,const base::Location & from_here,base::Closure task,base::TimeDelta period)42 bool RepeatingTimer::SchedulePeriodic(
43     const base::WeakPtr<MessageLoopThread>& thread,
44     const base::Location& from_here, base::Closure task,
45     base::TimeDelta period) {
46   mock_function_count_map[__func__]++;
47   return false;
48 }
Cancel()49 void RepeatingTimer::Cancel() {
50   mock_function_count_map[__func__]++;
51   expected_time_next_task_us_ = 0;
52 }
CancelAndWait()53 void RepeatingTimer::CancelAndWait() { mock_function_count_map[__func__]++; }
CancelClosure(std::promise<void> promise)54 void RepeatingTimer::CancelClosure(std::promise<void> promise) {
55   mock_function_count_map[__func__]++;
56 }
CancelHelper(std::promise<void> promise)57 void RepeatingTimer::CancelHelper(std::promise<void> promise) {
58   mock_function_count_map[__func__]++;
59 }
RunTask()60 void RepeatingTimer::RunTask() { mock_function_count_map[__func__]++; }
61