1*5225e6b1SAndroid Build Coastguard Worker // Copyright 2024, The Android Open Source Project 2*5225e6b1SAndroid Build Coastguard Worker // 3*5225e6b1SAndroid Build Coastguard Worker // Licensed under the Apache License, Version 2.0 (the "License"); 4*5225e6b1SAndroid Build Coastguard Worker // you may not use this file except in compliance with the License. 5*5225e6b1SAndroid Build Coastguard Worker // You may obtain a copy of the License at 6*5225e6b1SAndroid Build Coastguard Worker // 7*5225e6b1SAndroid Build Coastguard Worker // http://www.apache.org/licenses/LICENSE-2.0 8*5225e6b1SAndroid Build Coastguard Worker // 9*5225e6b1SAndroid Build Coastguard Worker // Unless required by applicable law or agreed to in writing, software 10*5225e6b1SAndroid Build Coastguard Worker // distributed under the License is distributed on an "AS IS" BASIS, 11*5225e6b1SAndroid Build Coastguard Worker // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12*5225e6b1SAndroid Build Coastguard Worker // See the License for the specific language governing permissions and 13*5225e6b1SAndroid Build Coastguard Worker // limitations under the License. 14*5225e6b1SAndroid Build Coastguard Worker 15*5225e6b1SAndroid Build Coastguard Worker //! Mock utils. 16*5225e6b1SAndroid Build Coastguard Worker 17*5225e6b1SAndroid Build Coastguard Worker use crate::MockEfiEntry; 18*5225e6b1SAndroid Build Coastguard Worker use liberror::Result; 19*5225e6b1SAndroid Build Coastguard Worker use mockall::mock; 20*5225e6b1SAndroid Build Coastguard Worker 21*5225e6b1SAndroid Build Coastguard Worker mock! { 22*5225e6b1SAndroid Build Coastguard Worker /// Mock [efi::utils::Timeout]. 23*5225e6b1SAndroid Build Coastguard Worker pub Timeout { 24*5225e6b1SAndroid Build Coastguard Worker /// Creates a new [MockTimeout]. 25*5225e6b1SAndroid Build Coastguard Worker pub fn new(efi_entry: &MockEfiEntry, timeout_ms: u64) -> Result<Self>; 26*5225e6b1SAndroid Build Coastguard Worker /// Checks the timeout. 27*5225e6b1SAndroid Build Coastguard Worker pub fn check(&self) -> Result<bool>; 28*5225e6b1SAndroid Build Coastguard Worker /// Resets the timeout. 29*5225e6b1SAndroid Build Coastguard Worker pub fn reset(&self, timeout_ms: u64) -> Result<()>; 30*5225e6b1SAndroid Build Coastguard Worker } 31*5225e6b1SAndroid Build Coastguard Worker } 32*5225e6b1SAndroid Build Coastguard Worker /// Map to the libefi name so code under test can just use one name. 33*5225e6b1SAndroid Build Coastguard Worker pub type Timeout = MockTimeout; 34