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

Side by Side Diff: gpu/command_buffer/service/shader_manager_unittest.cc

Issue 2378583003: Ping watchdog thread during GpuChannel destruction (Closed)
Patch Set: Fix lifetime and use nullptr Created 4 years, 2 months 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "gpu/command_buffer/service/shader_manager.h" 5 #include "gpu/command_buffer/service/shader_manager.h"
6 6
7 #include "gpu/command_buffer/service/gpu_service_test.h" 7 #include "gpu/command_buffer/service/gpu_service_test.h"
8 #include "gpu/command_buffer/service/mocks.h" 8 #include "gpu/command_buffer/service/mocks.h"
9 #include "gpu/command_buffer/service/test_helper.h" 9 #include "gpu/command_buffer/service/test_helper.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
11 #include "ui/gl/gl_mock.h" 11 #include "ui/gl/gl_mock.h"
12 12
13 using ::testing::Return; 13 using ::testing::Return;
14 using ::testing::ReturnRef; 14 using ::testing::ReturnRef;
15 15
16 namespace gpu { 16 namespace gpu {
17 namespace gles2 { 17 namespace gles2 {
18 18
19 class ShaderManagerTest : public GpuServiceTest { 19 class ShaderManagerTest : public GpuServiceTest {
20 public: 20 public:
21 ShaderManagerTest() { 21 ShaderManagerTest() : manager_(nullptr) {}
22 }
23 22
24 ~ShaderManagerTest() override { manager_.Destroy(false); } 23 ~ShaderManagerTest() override { manager_.Destroy(false); }
25 24
26 protected: 25 protected:
27 ShaderManager manager_; 26 ShaderManager manager_;
28 }; 27 };
29 28
30 TEST_F(ShaderManagerTest, Basic) { 29 TEST_F(ShaderManagerTest, Basic) {
31 const GLuint kClient1Id = 1; 30 const GLuint kClient1Id = 1;
32 const GLuint kService1Id = 11; 31 const GLuint kService1Id = 11;
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 EXPECT_CALL(*gl_, DeleteShader(kService1Id)) 312 EXPECT_CALL(*gl_, DeleteShader(kService1Id))
314 .Times(1) 313 .Times(1)
315 .RetiresOnSaturation(); 314 .RetiresOnSaturation();
316 manager_.Delete(shader1); // this should delete the shader. 315 manager_.Delete(shader1); // this should delete the shader.
317 shader2 = manager_.GetShader(kClient1Id); 316 shader2 = manager_.GetShader(kClient1Id);
318 EXPECT_TRUE(shader2 == NULL); 317 EXPECT_TRUE(shader2 == NULL);
319 } 318 }
320 319
321 } // namespace gles2 320 } // namespace gles2
322 } // namespace gpu 321 } // namespace gpu
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698