aboutsummaryrefslogtreecommitdiffhomepage
path: root/dm/DMExpectationsTask.cpp
blob: e29257afbd96c7efbb38e3fdca76fe9d0ae9b598 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include "DMExpectationsTask.h"
#include "DMUtil.h"

namespace DM {

ExpectationsTask::ExpectationsTask(const Task& parent,
                                   const Expectations& expectations,
                                   SkBitmap bitmap)
    : CpuTask(parent)
    , fName(parent.name())  // Masquerade as parent so failures are attributed to it.
    , fExpectations(expectations)
    , fBitmap(bitmap)
    {}

void ExpectationsTask::draw() {
    if (!fExpectations.check(*this, fBitmap)) {
        this->fail();
    }
}

}  // namespace DM