Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(589)

Side by Side Diff: gpu/command_buffer/service/mocks.h

Issue 465040: Added CommandBufferClient, CommandBufferStub and some IPC messages.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright 2009, Google Inc. 2 * Copyright 2009, Google Inc.
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 18 matching lines...) Expand all
29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 */ 30 */
31 31
32 32
33 // This file contains definitions for mock objects, used for testing. 33 // This file contains definitions for mock objects, used for testing.
34 34
35 // TODO: This file "manually" defines some mock objects. Using gMock 35 // TODO: This file "manually" defines some mock objects. Using gMock
36 // would be definitely preferable, unfortunately it doesn't work on Windows 36 // would be definitely preferable, unfortunately it doesn't work on Windows
37 // yet. 37 // yet.
38 38
39 #ifndef GPU_COMMAND_BUFFER_SERVICE_CROSS_MOCKS_H_ 39 #ifndef GPU_COMMAND_BUFFER_SERVICE_MOCKS_H_
40 #define GPU_COMMAND_BUFFER_SERVICE_CROSS_MOCKS_H_ 40 #define GPU_COMMAND_BUFFER_SERVICE_MOCKS_H_
41 41
42 #include <vector> 42 #include <vector>
43 #include "testing/gmock/include/gmock/gmock.h" 43 #include "testing/gmock/include/gmock/gmock.h"
44 #include "gpu/command_buffer/service/cmd_parser.h" 44 #include "gpu/command_buffer/service/cmd_parser.h"
45 #include "gpu/command_buffer/service/cmd_buffer_engine.h" 45 #include "gpu/command_buffer/service/cmd_buffer_engine.h"
46 46
47 namespace command_buffer { 47 namespace gpu {
48 48
49 // Mocks an AsyncAPIInterface, using GMock. 49 // Mocks an AsyncAPIInterface, using GMock.
50 class AsyncAPIMock : public AsyncAPIInterface { 50 class AsyncAPIMock : public AsyncAPIInterface {
51 public: 51 public:
52 AsyncAPIMock() { 52 AsyncAPIMock() {
53 testing::DefaultValue<parse_error::ParseError>::Set( 53 testing::DefaultValue<parse_error::ParseError>::Set(
54 parse_error::kParseNoError); 54 parse_error::kParseNoError);
55 } 55 }
56 56
57 // Predicate that matches args passed to DoCommand, by looking at the values. 57 // Predicate that matches args passed to DoCommand, by looking at the values.
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 DCHECK_EQ(1u, command); 96 DCHECK_EQ(1u, command);
97 DCHECK_EQ(1u, arg_count); 97 DCHECK_EQ(1u, arg_count);
98 const CommandBufferEntry* args = 98 const CommandBufferEntry* args =
99 static_cast<const CommandBufferEntry*>(_args); 99 static_cast<const CommandBufferEntry*>(_args);
100 engine_->set_token(args[0].value_uint32); 100 engine_->set_token(args[0].value_uint32);
101 } 101 }
102 private: 102 private:
103 CommandBufferEngine *engine_; 103 CommandBufferEngine *engine_;
104 }; 104 };
105 105
106 } // namespace command_buffer 106 } // namespace gpu
107 107
108 #endif // GPU_COMMAND_BUFFER_SERVICE_CROSS_MOCKS_H_ 108 #endif // GPU_COMMAND_BUFFER_SERVICE_MOCKS_H_
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/gpu_processor_win.cc ('k') | gpu/command_buffer/service/precompile.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698