#include "components/performance_manager/execution_context_priority/max_vote_aggregator.h"
#include "base/rand_util.h"
#include "components/performance_manager/test_support/voting.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace performance_manager {
namespace execution_context_priority {
class MaxVoteAggregatorTestAccess { … };
VoteData;
StampedVote;
namespace {
DummyVoteObserver;
const ExecutionContext* kExecutionContext0 = …;
const ExecutionContext* kExecutionContext1 = …;
static const Vote kLowPriorityVote0(base::TaskPriority::LOWEST, "low reason 0");
static const Vote kLowPriorityVote1(base::TaskPriority::LOWEST, "low reason 1");
static const Vote kMediumPriorityVote0(base::TaskPriority::USER_VISIBLE,
"medium reason 0");
static const Vote kMediumPriorityVote1(base::TaskPriority::USER_VISIBLE,
"medium reason 1");
static const Vote kHighPriorityVote0(base::TaskPriority::HIGHEST,
"high reason 0");
static const Vote kHighPriorityVote1(base::TaskPriority::HIGHEST,
"high reason 1");
}
class MaxVoteAggregatorTest : public testing::Test { … };
TEST_F(MaxVoteAggregatorTest, SingleVoter) { … }
TEST_F(MaxVoteAggregatorTest, TwoVotersOneContext) { … }
TEST_F(MaxVoteAggregatorTest, TwoVotersMultipleContext) { … }
TEST_F(MaxVoteAggregatorTest, LotsOfVoters) { … }
}
}