blob: 54f160f2382f06567e57a72860c628591c2f9cb6 [file] [log] [blame]
// Copyright 2018 The Chromium OS 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 SHILL_TEST_EVENT_DISPATCHER_H_
#define SHILL_TEST_EVENT_DISPATCHER_H_
#include <base/macros.h>
#include <base/message_loop/message_loop.h>
#include <brillo/message_loops/base_message_loop.h>
#include "shill/event_dispatcher.h"
namespace shill {
// Event dispatcher with message loop for testing.
class EventDispatcherForTest : public EventDispatcher {
public:
EventDispatcherForTest() {
chromeos_message_loop_.SetAsCurrent();
}
~EventDispatcherForTest() override {}
private:
// Message loop for testing.
base::MessageLoopForIO message_loop_;
// The chromeos wrapper for the main message loop.
brillo::BaseMessageLoop chromeos_message_loop_{&message_loop_};
DISALLOW_COPY_AND_ASSIGN(EventDispatcherForTest);
};
} // namespace shill
#endif // SHILL_TEST_EVENT_DISPATCHER_H_