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

Side by Side Diff: cc/surfaces/compositor_frame_sink_support_unittest.cc

Issue 2788893004: Renaming gpu swap buffer callbacks and the screenshot latency component. (Closed)
Patch Set: Updating android compositor Created 3 years, 8 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
« no previous file with comments | « no previous file | content/browser/compositor/gpu_browser_compositor_output_surface.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 "cc/surfaces/compositor_frame_sink_support.h" 5 #include "cc/surfaces/compositor_frame_sink_support.h"
6 6
7 #include "base/debug/stack_trace.h" 7 #include "base/debug/stack_trace.h"
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "cc/output/compositor_frame.h" 9 #include "cc/output/compositor_frame.h"
10 #include "cc/surfaces/compositor_frame_sink_support_client.h" 10 #include "cc/surfaces/compositor_frame_sink_support_client.h"
(...skipping 745 matching lines...) Expand 10 before | Expand all | Expand 10 after
756 EXPECT_THAT(GetChildReferences(parent_id), UnorderedElementsAre(child_id2)); 756 EXPECT_THAT(GetChildReferences(parent_id), UnorderedElementsAre(child_id2));
757 } 757 }
758 758
759 // Checks whether the latency info are moved to the new surface from the old 759 // Checks whether the latency info are moved to the new surface from the old
760 // one when LocalSurfaceId changes. No frame has unresolved dependencies. 760 // one when LocalSurfaceId changes. No frame has unresolved dependencies.
761 TEST_F(CompositorFrameSinkSupportTest, 761 TEST_F(CompositorFrameSinkSupportTest,
762 LatencyInfoCarriedOverOnResize_NoUnresolvedDependencies) { 762 LatencyInfoCarriedOverOnResize_NoUnresolvedDependencies) {
763 const SurfaceId parent_id1 = MakeSurfaceId(kParentFrameSink, 1); 763 const SurfaceId parent_id1 = MakeSurfaceId(kParentFrameSink, 1);
764 const SurfaceId parent_id2 = MakeSurfaceId(kParentFrameSink, 2); 764 const SurfaceId parent_id2 = MakeSurfaceId(kParentFrameSink, 2);
765 const ui::LatencyComponentType latency_type1 = 765 const ui::LatencyComponentType latency_type1 =
766 ui::WINDOW_SNAPSHOT_FRAME_NUMBER_COMPONENT; 766 ui::BROWSER_SNAPSHOT_FRAME_NUMBER_COMPONENT;
767 const int64_t latency_id1 = 234; 767 const int64_t latency_id1 = 234;
768 const int64_t latency_sequence_number1 = 5645432; 768 const int64_t latency_sequence_number1 = 5645432;
769 const ui::LatencyComponentType latency_type2 = ui::TAB_SHOW_COMPONENT; 769 const ui::LatencyComponentType latency_type2 = ui::TAB_SHOW_COMPONENT;
770 const int64_t latency_id2 = 31434351; 770 const int64_t latency_id2 = 31434351;
771 const int64_t latency_sequence_number2 = 663788; 771 const int64_t latency_sequence_number2 = 663788;
772 772
773 // Submit a frame with latency info 773 // Submit a frame with latency info
774 ui::LatencyInfo info; 774 ui::LatencyInfo info;
775 info.AddLatencyNumber(latency_type1, latency_id1, latency_sequence_number1); 775 info.AddLatencyNumber(latency_type1, latency_id1, latency_sequence_number1);
776 776
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
820 820
821 // Checks whether the latency info are moved to the new surface from the old 821 // Checks whether the latency info are moved to the new surface from the old
822 // one when LocalSurfaceId changes. Old surface has unresolved dependencies. 822 // one when LocalSurfaceId changes. Old surface has unresolved dependencies.
823 TEST_F(CompositorFrameSinkSupportTest, 823 TEST_F(CompositorFrameSinkSupportTest,
824 LatencyInfoCarriedOverOnResize_OldSurfaceHasPendingAndActiveFrame) { 824 LatencyInfoCarriedOverOnResize_OldSurfaceHasPendingAndActiveFrame) {
825 const SurfaceId parent_id1 = MakeSurfaceId(kParentFrameSink, 1); 825 const SurfaceId parent_id1 = MakeSurfaceId(kParentFrameSink, 1);
826 const SurfaceId parent_id2 = MakeSurfaceId(kParentFrameSink, 2); 826 const SurfaceId parent_id2 = MakeSurfaceId(kParentFrameSink, 2);
827 const SurfaceId child_id = MakeSurfaceId(kChildFrameSink1, 1); 827 const SurfaceId child_id = MakeSurfaceId(kChildFrameSink1, 1);
828 828
829 const ui::LatencyComponentType latency_type1 = 829 const ui::LatencyComponentType latency_type1 =
830 ui::WINDOW_SNAPSHOT_FRAME_NUMBER_COMPONENT; 830 ui::BROWSER_SNAPSHOT_FRAME_NUMBER_COMPONENT;
831 const int64_t latency_id1 = 234; 831 const int64_t latency_id1 = 234;
832 const int64_t latency_sequence_number1 = 5645432; 832 const int64_t latency_sequence_number1 = 5645432;
833 const ui::LatencyComponentType latency_type2 = ui::TAB_SHOW_COMPONENT; 833 const ui::LatencyComponentType latency_type2 = ui::TAB_SHOW_COMPONENT;
834 const int64_t latency_id2 = 31434351; 834 const int64_t latency_id2 = 31434351;
835 const int64_t latency_sequence_number2 = 663788; 835 const int64_t latency_sequence_number2 = 663788;
836 836
837 // Submit a frame with no unresolved dependecy. 837 // Submit a frame with no unresolved dependecy.
838 ui::LatencyInfo info; 838 ui::LatencyInfo info;
839 info.AddLatencyNumber(latency_type1, latency_id1, latency_sequence_number1); 839 info.AddLatencyNumber(latency_type1, latency_id1, latency_sequence_number1);
840 840
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
888 888
889 // Checks whether the latency info are moved to the new surface from the old 889 // Checks whether the latency info are moved to the new surface from the old
890 // one when LocalSurfaceId changes. The new surface has unresolved dependencies. 890 // one when LocalSurfaceId changes. The new surface has unresolved dependencies.
891 TEST_F(CompositorFrameSinkSupportTest, 891 TEST_F(CompositorFrameSinkSupportTest,
892 LatencyInfoCarriedOverOnResize_NewSurfaceHasPendingFrame) { 892 LatencyInfoCarriedOverOnResize_NewSurfaceHasPendingFrame) {
893 const SurfaceId parent_id1 = MakeSurfaceId(kParentFrameSink, 1); 893 const SurfaceId parent_id1 = MakeSurfaceId(kParentFrameSink, 1);
894 const SurfaceId parent_id2 = MakeSurfaceId(kParentFrameSink, 2); 894 const SurfaceId parent_id2 = MakeSurfaceId(kParentFrameSink, 2);
895 const SurfaceId child_id = MakeSurfaceId(kChildFrameSink1, 1); 895 const SurfaceId child_id = MakeSurfaceId(kChildFrameSink1, 1);
896 896
897 const ui::LatencyComponentType latency_type1 = 897 const ui::LatencyComponentType latency_type1 =
898 ui::WINDOW_SNAPSHOT_FRAME_NUMBER_COMPONENT; 898 ui::BROWSER_SNAPSHOT_FRAME_NUMBER_COMPONENT;
899 const int64_t latency_id1 = 234; 899 const int64_t latency_id1 = 234;
900 const int64_t latency_sequence_number1 = 5645432; 900 const int64_t latency_sequence_number1 = 5645432;
901 const ui::LatencyComponentType latency_type2 = ui::TAB_SHOW_COMPONENT; 901 const ui::LatencyComponentType latency_type2 = ui::TAB_SHOW_COMPONENT;
902 const int64_t latency_id2 = 31434351; 902 const int64_t latency_id2 = 31434351;
903 const int64_t latency_sequence_number2 = 663788; 903 const int64_t latency_sequence_number2 = 663788;
904 904
905 // Submit a frame with no unresolved dependencies. 905 // Submit a frame with no unresolved dependencies.
906 ui::LatencyInfo info; 906 ui::LatencyInfo info;
907 info.AddLatencyNumber(latency_type1, latency_id1, latency_sequence_number1); 907 info.AddLatencyNumber(latency_type1, latency_id1, latency_sequence_number1);
908 908
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
1095 // be used and destroyed() must return false. The surface must have a factory. 1095 // be used and destroyed() must return false. The surface must have a factory.
1096 child_support->SubmitCompositorFrame( 1096 child_support->SubmitCompositorFrame(
1097 child_id.local_surface_id(), MakeCompositorFrame(empty_surface_ids())); 1097 child_id.local_surface_id(), MakeCompositorFrame(empty_surface_ids()));
1098 EXPECT_EQ(surface, surface_manager().GetSurfaceForId(child_id)); 1098 EXPECT_EQ(surface, surface_manager().GetSurfaceForId(child_id));
1099 EXPECT_TRUE(surface->factory()); 1099 EXPECT_TRUE(surface->factory());
1100 EXPECT_FALSE(surface->destroyed()); 1100 EXPECT_FALSE(surface->destroyed());
1101 } 1101 }
1102 1102
1103 } // namespace test 1103 } // namespace test
1104 } // namespace cc 1104 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | content/browser/compositor/gpu_browser_compositor_output_surface.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698