Index: dm/DMExpectationsTask.cpp |
diff --git a/dm/DMExpectationsTask.cpp b/dm/DMExpectationsTask.cpp |
new file mode 100644 |
index 0000000000000000000000000000000000000000..cb92486269890d8c2567ac4a660b8deb59468605 |
--- /dev/null |
+++ b/dm/DMExpectationsTask.cpp |
@@ -0,0 +1,21 @@ |
+#include "DMExpectationsTask.h" |
+#include "DMUtil.h" |
+ |
+namespace DM { |
+ |
+ExpectationsTask::ExpectationsTask(const Task& parent, |
+ const Expectations& expectations, |
+ SkBitmap bitmap) |
+ : Task(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 |