1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "base/threading/thread.h"
6 #include "base/time/time.h"
7 #include "gpu/command_buffer/service/gpu_scheduler.h"
8 #include "gpu/command_buffer/service/mocks.h"
10 using testing::Invoke
;
15 AsyncAPIMock::AsyncAPIMock(bool default_do_commands
) {
16 testing::DefaultValue
<error::Error
>::Set(
19 if (default_do_commands
) {
20 ON_CALL(*this, DoCommands(_
, _
, _
, _
))
21 .WillByDefault(Invoke(this, &AsyncAPIMock::FakeDoCommands
));
25 AsyncAPIMock::~AsyncAPIMock() {}
27 error::Error
AsyncAPIMock::FakeDoCommands(unsigned int num_commands
,
30 int* entries_processed
) {
31 return AsyncAPIInterface::DoCommands(
32 num_commands
, buffer
, num_entries
, entries_processed
);
35 void AsyncAPIMock::SetToken(unsigned int command
,
36 unsigned int arg_count
,
39 DCHECK_EQ(1u, command
);
40 DCHECK_EQ(1u, arg_count
);
41 const cmd::SetToken
* args
=
42 static_cast<const cmd::SetToken
*>(_args
);
43 engine_
->set_token(args
->token
);
48 MockShaderTranslator::MockShaderTranslator() {}
50 MockShaderTranslator::~MockShaderTranslator() {}
52 MockProgramCache::MockProgramCache() {}
53 MockProgramCache::~MockProgramCache() {}
55 MockMemoryTracker::MockMemoryTracker() {}
56 MockMemoryTracker::~MockMemoryTracker() {}