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 18 matching lines...) Expand all Loading... |
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 // Tests for the ResourceMap. | 33 // Tests for the ResourceMap. |
34 | 34 |
35 #include "gpu/command_buffer/service/precompile.h" | 35 #include "gpu/command_buffer/service/precompile.h" |
36 #include "gpu/command_buffer/service/resource.h" | 36 #include "gpu/command_buffer/service/resource.h" |
37 #include "testing/gtest/include/gtest/gtest.h" | 37 #include "testing/gtest/include/gtest/gtest.h" |
38 | 38 |
39 namespace command_buffer { | 39 namespace gpu { |
40 | 40 |
41 // Mock resource implementation that checks for leaks. | 41 // Mock resource implementation that checks for leaks. |
42 class ResourceMock : public Resource { | 42 class ResourceMock : public Resource { |
43 public: | 43 public: |
44 ResourceMock() : Resource() { | 44 ResourceMock() : Resource() { |
45 ++instance_count_; | 45 ++instance_count_; |
46 } | 46 } |
47 virtual ~ResourceMock() { | 47 virtual ~ResourceMock() { |
48 --instance_count_; | 48 --instance_count_; |
49 } | 49 } |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 map()->Assign(2, resource); | 117 map()->Assign(2, resource); |
118 resource = new ResourceMock(); | 118 resource = new ResourceMock(); |
119 map()->Assign(3, resource); | 119 map()->Assign(3, resource); |
120 map()->DestroyAllResources(); | 120 map()->DestroyAllResources(); |
121 EXPECT_EQ(NULL, map()->Get(1)); | 121 EXPECT_EQ(NULL, map()->Get(1)); |
122 EXPECT_EQ(NULL, map()->Get(2)); | 122 EXPECT_EQ(NULL, map()->Get(2)); |
123 EXPECT_EQ(NULL, map()->Get(3)); | 123 EXPECT_EQ(NULL, map()->Get(3)); |
124 CheckLeaks(); | 124 CheckLeaks(); |
125 } | 125 } |
126 | 126 |
127 } // namespace command_buffer | 127 } // namespace gpu |
OLD | NEW |