OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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 #include "cc/scheduler/scheduler.h" | 4 #include "cc/scheduler/scheduler.h" |
5 | 5 |
6 #include <string> | 6 #include <string> |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 1891 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1902 scheduler->DidLoseOutputSurface(); | 1902 scheduler->DidLoseOutputSurface(); |
1903 EXPECT_EQ(0, client.num_actions_()); | 1903 EXPECT_EQ(0, client.num_actions_()); |
1904 EXPECT_FALSE(scheduler->IsSyntheticBeginFrameSourceActive()); | 1904 EXPECT_FALSE(scheduler->IsSyntheticBeginFrameSourceActive()); |
1905 | 1905 |
1906 client.Reset(); | 1906 client.Reset(); |
1907 client.task_runner().RunPendingTasks(); // Run posted deadline. | 1907 client.task_runner().RunPendingTasks(); // Run posted deadline. |
1908 EXPECT_SINGLE_ACTION("ScheduledActionBeginOutputSurfaceCreation", client); | 1908 EXPECT_SINGLE_ACTION("ScheduledActionBeginOutputSurfaceCreation", client); |
1909 EXPECT_FALSE(scheduler->IsSyntheticBeginFrameSourceActive()); | 1909 EXPECT_FALSE(scheduler->IsSyntheticBeginFrameSourceActive()); |
1910 } | 1910 } |
1911 | 1911 |
| 1912 TEST(SchedulerTest, ScheduledActionActivateAfterBecomingInvisible) { |
| 1913 FakeSchedulerClient client; |
| 1914 SchedulerSettings scheduler_settings; |
| 1915 scheduler_settings.impl_side_painting = true; |
| 1916 TestScheduler* scheduler = client.CreateScheduler(scheduler_settings); |
| 1917 scheduler->SetCanStart(); |
| 1918 scheduler->SetVisible(true); |
| 1919 scheduler->SetCanDraw(true); |
| 1920 |
| 1921 EXPECT_SINGLE_ACTION("ScheduledActionBeginOutputSurfaceCreation", client); |
| 1922 InitializeOutputSurfaceAndFirstCommit(scheduler, &client); |
| 1923 |
| 1924 // SetNeedsCommit should begin the frame. |
| 1925 client.Reset(); |
| 1926 scheduler->SetNeedsCommit(); |
| 1927 EXPECT_SINGLE_ACTION("SetNeedsBeginFrame", client); |
| 1928 |
| 1929 client.Reset(); |
| 1930 client.AdvanceFrame(); |
| 1931 EXPECT_ACTION("WillBeginImplFrame", client, 0, 2); |
| 1932 EXPECT_ACTION("ScheduledActionSendBeginMainFrame", client, 1, 2); |
| 1933 EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending()); |
| 1934 |
| 1935 client.Reset(); |
| 1936 scheduler->NotifyBeginMainFrameStarted(); |
| 1937 scheduler->NotifyReadyToCommit(); |
| 1938 EXPECT_SINGLE_ACTION("ScheduledActionCommit", client); |
| 1939 |
| 1940 client.Reset(); |
| 1941 scheduler->SetVisible(false); |
| 1942 // Sync tree should be forced to activate. |
| 1943 EXPECT_SINGLE_ACTION("ScheduledActionActivateSyncTree", client); |
| 1944 } |
| 1945 |
1912 } // namespace | 1946 } // namespace |
1913 } // namespace cc | 1947 } // namespace cc |
OLD | NEW |