From da78e6c75cab23d837cb4768efa3838ddb2286e7 Mon Sep 17 00:00:00 2001 From: Xavi Garcia Mena Date: Wed, 23 Dec 2015 14:22:35 +0100 Subject: restore OSD notifications --- include/unity/gmenuharness/MenuMatcher.h | 95 ++++++++++++++++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 include/unity/gmenuharness/MenuMatcher.h (limited to 'include/unity/gmenuharness/MenuMatcher.h') diff --git a/include/unity/gmenuharness/MenuMatcher.h b/include/unity/gmenuharness/MenuMatcher.h new file mode 100644 index 0000000..c2eb65e --- /dev/null +++ b/include/unity/gmenuharness/MenuMatcher.h @@ -0,0 +1,95 @@ +/* + * Copyright © 2014 Canonical Ltd. + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License version 3, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + * + * Authored by: Pete Woods + */ + +#pragma once + +#define EXPECT_MATCHRESULT(statement) \ +do {\ + auto result = (statement);\ + GTEST_TEST_BOOLEAN_(result.success(), #statement, false, true, \ + GTEST_NONFATAL_FAILURE_) << result.concat_failures().c_str(); \ +} while (0) + +#include +#include + +#include +#include + +namespace unity +{ + +namespace gmenuharness +{ + +class MenuMatcher +{ +public: + class Parameters + { + public: + Parameters( + const std::string& busName, + const std::vector>& actions, + const std::string& menuObjectPath); + + ~Parameters(); + + Parameters(const Parameters& other); + + Parameters(Parameters&& other); + + Parameters& operator=(const Parameters& other); + + Parameters& operator=(Parameters&& other); + + protected: + friend MenuMatcher; + + struct Priv; + + std::shared_ptr p; + }; + + MenuMatcher(const Parameters& parameters); + + ~MenuMatcher(); + + MenuMatcher(const MenuMatcher& other) = delete; + + MenuMatcher(MenuMatcher&& other) = delete; + + MenuMatcher& operator=(const MenuMatcher& other) = delete; + + MenuMatcher& operator=(MenuMatcher&& other) = delete; + + MenuMatcher& item(const MenuItemMatcher& item); + + MatchResult match() const; + + void match(MatchResult& matchResult) const; + +protected: + struct Priv; + + std::shared_ptr p; +}; + +} // gmenuharness + +} // unity -- cgit v1.2.3