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 | 4 |
5 #include "cc/scheduler/scheduler_state_machine.h" | 5 #include "cc/scheduler/scheduler_state_machine.h" |
6 | 6 |
7 #include "base/debug/trace_event.h" | 7 #include "base/debug/trace_event.h" |
8 #include "cc/scheduler/scheduler.h" | 8 #include "cc/scheduler/scheduler.h" |
9 #include "cc/test/begin_frame_args_test.h" | 9 #include "cc/test/begin_frame_args_test.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
11 | 11 |
12 #define EXPECT_ACTION_UPDATE_STATE(action) \ | 12 #define EXPECT_ACTION_UPDATE_STATE(action) \ |
13 EXPECT_EQ(action, state.NextAction()) << state.AsValue()->ToString(); \ | 13 EXPECT_STREQ(SchedulerStateMachine::ActionToString(action), \ |
Sami
2014/10/13 09:43:05
I'm guessing this doesn't hugely affect the test's
mithro-old
2014/10/13 10:29:10
The change is well within noise on a z620.
| |
14 SchedulerStateMachine::ActionToString(state.NextAction())) \ | |
15 << state.AsValue()->ToString(); \ | |
14 if (action == SchedulerStateMachine::ACTION_DRAW_AND_SWAP_IF_POSSIBLE || \ | 16 if (action == SchedulerStateMachine::ACTION_DRAW_AND_SWAP_IF_POSSIBLE || \ |
15 action == SchedulerStateMachine::ACTION_DRAW_AND_SWAP_FORCED) { \ | 17 action == SchedulerStateMachine::ACTION_DRAW_AND_SWAP_FORCED) { \ |
16 EXPECT_EQ(SchedulerStateMachine::BEGIN_IMPL_FRAME_STATE_INSIDE_DEADLINE, \ | 18 EXPECT_EQ(SchedulerStateMachine::BEGIN_IMPL_FRAME_STATE_INSIDE_DEADLINE, \ |
17 state.begin_impl_frame_state()) \ | 19 state.begin_impl_frame_state()) \ |
18 << state.AsValue()->ToString(); \ | 20 << state.AsValue()->ToString(); \ |
19 } \ | 21 } \ |
20 state.UpdateState(action); \ | 22 state.UpdateState(action); \ |
21 if (action == SchedulerStateMachine::ACTION_NONE) { \ | 23 if (action == SchedulerStateMachine::ACTION_NONE) { \ |
22 if (state.begin_impl_frame_state() == \ | 24 if (state.begin_impl_frame_state() == \ |
23 SchedulerStateMachine::BEGIN_IMPL_FRAME_STATE_BEGIN_FRAME_STARTING) \ | 25 SchedulerStateMachine::BEGIN_IMPL_FRAME_STATE_BEGIN_FRAME_STARTING) \ |
(...skipping 1824 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1848 // Verify we send another begin frame | 1850 // Verify we send another begin frame |
1849 state.SetNeedsCommit(); | 1851 state.SetNeedsCommit(); |
1850 state.OnBeginImplFrame(CreateBeginFrameArgsForTesting()); | 1852 state.OnBeginImplFrame(CreateBeginFrameArgsForTesting()); |
1851 EXPECT_ACTION_UPDATE_STATE( | 1853 EXPECT_ACTION_UPDATE_STATE( |
1852 SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME); | 1854 SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME); |
1853 EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE); | 1855 EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE); |
1854 } | 1856 } |
1855 | 1857 |
1856 } // namespace | 1858 } // namespace |
1857 } // namespace cc | 1859 } // namespace cc |
OLD | NEW |