OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <stdint.h> | 5 #include <stdint.h> |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "gpu/command_buffer/service/gles2_cmd_decoder_mock.h" | 8 #include "gpu/command_buffer/service/gles2_cmd_decoder_mock.h" |
9 #include "gpu/command_buffer/service/gpu_service_test.h" | 9 #include "gpu/command_buffer/service/gpu_service_test.h" |
10 #include "gpu/command_buffer/service/gpu_tracer.h" | 10 #include "gpu/command_buffer/service/gpu_tracer.h" |
(...skipping 729 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
740 .Times(AtMost(1)) | 740 .Times(AtMost(1)) |
741 .WillRepeatedly(Return(GetGLContext())); | 741 .WillRepeatedly(Return(GetGLContext())); |
742 tracer_tester_.reset(new GPUTracerTester(decoder_.get())); | 742 tracer_tester_.reset(new GPUTracerTester(decoder_.get())); |
743 } | 743 } |
744 | 744 |
745 void TearDown() override { | 745 void TearDown() override { |
746 tracer_tester_ = nullptr; | 746 tracer_tester_ = nullptr; |
747 decoder_ = nullptr; | 747 decoder_ = nullptr; |
748 GpuServiceTest::TearDown(); | 748 GpuServiceTest::TearDown(); |
749 } | 749 } |
750 scoped_ptr<MockGLES2Decoder> decoder_; | 750 std::unique_ptr<MockGLES2Decoder> decoder_; |
751 scoped_ptr<GPUTracerTester> tracer_tester_; | 751 std::unique_ptr<GPUTracerTester> tracer_tester_; |
752 }; | 752 }; |
753 | 753 |
754 TEST_F(GPUTracerTest, IsTracingTest) { | 754 TEST_F(GPUTracerTest, IsTracingTest) { |
755 EXPECT_FALSE(tracer_tester_->IsTracing()); | 755 EXPECT_FALSE(tracer_tester_->IsTracing()); |
756 tracer_tester_->SetTracingEnabled(true); | 756 tracer_tester_->SetTracingEnabled(true); |
757 EXPECT_TRUE(tracer_tester_->IsTracing()); | 757 EXPECT_TRUE(tracer_tester_->IsTracing()); |
758 } | 758 } |
759 // Test basic functionality of the GPUTracerTester. | 759 // Test basic functionality of the GPUTracerTester. |
760 TEST_F(GPUTracerTest, DecodeTest) { | 760 TEST_F(GPUTracerTest, DecodeTest) { |
761 ASSERT_TRUE(tracer_tester_->BeginDecoding()); | 761 ASSERT_TRUE(tracer_tester_->BeginDecoding()); |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
804 scoped_refptr<gfx::GPUTimingClient> client3 = | 804 scoped_refptr<gfx::GPUTimingClient> client3 = |
805 GetGLContext()->CreateGPUTimingClient(); | 805 GetGLContext()->CreateGPUTimingClient(); |
806 ASSERT_TRUE(client1->CheckAndResetTimerErrors()); | 806 ASSERT_TRUE(client1->CheckAndResetTimerErrors()); |
807 ASSERT_TRUE(client2->CheckAndResetTimerErrors()); | 807 ASSERT_TRUE(client2->CheckAndResetTimerErrors()); |
808 ASSERT_FALSE(client3->CheckAndResetTimerErrors()); | 808 ASSERT_FALSE(client3->CheckAndResetTimerErrors()); |
809 } | 809 } |
810 | 810 |
811 } // namespace | 811 } // namespace |
812 } // namespace gles2 | 812 } // namespace gles2 |
813 } // namespace gpu | 813 } // namespace gpu |
OLD | NEW |