Make Wire tests more strict w.r.t. expectations

This changes Wire tests to produces errors on "uninteresting calls" and
flushes mock expectations on client/server flushes so that we control
100% of the order of calls.

BUG=941543

Change-Id: I6eabc79dde2abb564e54df90c5c0e615fd4496c6
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/6040
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
This commit is contained in:
Corentin Wallez
2019-03-28 10:44:41 +00:00
committed by Commit Bot service account
parent 1ba2cb8589
commit d754fb2034
10 changed files with 68 additions and 55 deletions

View File

@@ -14,6 +14,8 @@
#include "mock_dawn.h"
using namespace testing;
namespace {
{% for type in by_category["object"] %}
{% for method in native_methods(type) if len(method.arguments) < 10 %}
@@ -128,3 +130,9 @@ void ProcTableAsClass::CallFenceOnCompletionCallback(DawnFence fence,
MockProcTable::MockProcTable() {
}
void MockProcTable::IgnoreAllReleaseCalls() {
{% for type in by_category["object"] %}
EXPECT_CALL(*this, {{as_MethodSuffix(type.name, Name("release"))}}(_)).Times(AnyNumber());
{% endfor %}
}