Home | History | Annotate | Download | only in shill
      1 //
      2 // Copyright (C) 2013 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 #ifndef SHILL_MOCK_EXTERNAL_TASK_H_
     18 #define SHILL_MOCK_EXTERNAL_TASK_H_
     19 
     20 #include <map>
     21 #include <string>
     22 #include <vector>
     23 
     24 #include <gmock/gmock.h>
     25 
     26 #include "shill/external_task.h"
     27 
     28 namespace shill {
     29 
     30 class MockExternalTask : public ExternalTask {
     31  public:
     32   MockExternalTask(ControlInterface* control,
     33                    ProcessManager* process_manager,
     34                    const base::WeakPtr<RPCTaskDelegate>& task_delegate,
     35                    const base::Callback<void(pid_t, int)>& death_callback);
     36   ~MockExternalTask() override;
     37 
     38   MOCK_METHOD5(Start,
     39                bool(const base::FilePath& file,
     40                     const std::vector<std::string>& arguments,
     41                     const std::map<std::string, std::string>& environment,
     42                     bool terminate_with_parent,
     43                     Error* error));
     44   MOCK_METHOD0(Stop, void());
     45   MOCK_METHOD0(OnDelete, void());
     46 
     47  private:
     48   DISALLOW_COPY_AND_ASSIGN(MockExternalTask);
     49 };
     50 
     51 }  // namespace shill
     52 
     53 #endif  // SHILL_MOCK_EXTERNAL_TASK_H_
     54