blob: e29257afbd96c7efbb38e3fdca76fe9d0ae9b598 [file] [log] [blame]
commit-bot@chromium.org99589af2013-12-10 14:53:16 +00001#include "DMExpectationsTask.h"
2#include "DMUtil.h"
3
4namespace DM {
5
6ExpectationsTask::ExpectationsTask(const Task& parent,
7 const Expectations& expectations,
8 SkBitmap bitmap)
commit-bot@chromium.orgef57b7e2014-02-28 20:31:31 +00009 : CpuTask(parent)
commit-bot@chromium.org99589af2013-12-10 14:53:16 +000010 , fName(parent.name()) // Masquerade as parent so failures are attributed to it.
11 , fExpectations(expectations)
12 , fBitmap(bitmap)
13 {}
14
15void ExpectationsTask::draw() {
16 if (!fExpectations.check(*this, fBitmap)) {
17 this->fail();
18 }
19}
20
21} // namespace DM