OLD | NEW |
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 21 matching lines...) Expand all Loading... |
32 | 32 |
33 // Tests for the command parser. | 33 // Tests for the command parser. |
34 | 34 |
35 #include "gpu/command_buffer/service/precompile.h" | 35 #include "gpu/command_buffer/service/precompile.h" |
36 | 36 |
37 #include "base/scoped_ptr.h" | 37 #include "base/scoped_ptr.h" |
38 #include "gpu/command_buffer/service/cmd_parser.h" | 38 #include "gpu/command_buffer/service/cmd_parser.h" |
39 #include "gpu/command_buffer/service/mocks.h" | 39 #include "gpu/command_buffer/service/mocks.h" |
40 #include "testing/gtest/include/gtest/gtest.h" | 40 #include "testing/gtest/include/gtest/gtest.h" |
41 | 41 |
42 namespace command_buffer { | 42 namespace gpu { |
43 | 43 |
44 using testing::Return; | 44 using testing::Return; |
45 using testing::Mock; | 45 using testing::Mock; |
46 using testing::Truly; | 46 using testing::Truly; |
47 using testing::Sequence; | 47 using testing::Sequence; |
48 using testing::_; | 48 using testing::_; |
49 | 49 |
50 // Test fixture for CommandParser test - Creates a mock AsyncAPIInterface, and | 50 // Test fixture for CommandParser test - Creates a mock AsyncAPIInterface, and |
51 // a fixed size memory buffer. Also provides a simple API to create a | 51 // a fixed size memory buffer. Also provides a simple API to create a |
52 // CommandParser. | 52 // CommandParser. |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
306 // correctly. | 306 // correctly. |
307 EXPECT_EQ(put_post_fail, parser->get()); | 307 EXPECT_EQ(put_post_fail, parser->get()); |
308 Mock::VerifyAndClearExpectations(api_mock()); | 308 Mock::VerifyAndClearExpectations(api_mock()); |
309 // make the second one succeed, and check that the parser recovered fine. | 309 // make the second one succeed, and check that the parser recovered fine. |
310 AddDoCommandExpect(parse_error::kParseNoError, 4, 0, NULL); | 310 AddDoCommandExpect(parse_error::kParseNoError, 4, 0, NULL); |
311 EXPECT_EQ(parse_error::kParseNoError, parser->ProcessAllCommands()); | 311 EXPECT_EQ(parse_error::kParseNoError, parser->ProcessAllCommands()); |
312 EXPECT_EQ(put, parser->get()); | 312 EXPECT_EQ(put, parser->get()); |
313 Mock::VerifyAndClearExpectations(api_mock()); | 313 Mock::VerifyAndClearExpectations(api_mock()); |
314 } | 314 } |
315 | 315 |
316 } // namespace command_buffer | 316 } // namespace gpu |
OLD | NEW |