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

Unified Diff: cc/scheduler/scheduler_state_machine_unittest.cc

Issue 380763002: Add builders for tracing event's structural arguments (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed memory leak found by Linux ASAN Created 6 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/scheduler/scheduler_state_machine.cc ('k') | cc/scheduler/scheduler_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/scheduler/scheduler_state_machine_unittest.cc
diff --git a/cc/scheduler/scheduler_state_machine_unittest.cc b/cc/scheduler/scheduler_state_machine_unittest.cc
index c89da2f70d1460aba50c0a5629c19b7589aa4c5c..1dd9788f63982929824d355f516e4712f1f45c39 100644
--- a/cc/scheduler/scheduler_state_machine_unittest.cc
+++ b/cc/scheduler/scheduler_state_machine_unittest.cc
@@ -4,17 +4,18 @@
#include "cc/scheduler/scheduler_state_machine.h"
+#include "base/debug/trace_event.h"
#include "cc/scheduler/scheduler.h"
#include "cc/test/begin_frame_args_test.h"
#include "testing/gtest/include/gtest/gtest.h"
#define EXPECT_ACTION_UPDATE_STATE(action) \
- EXPECT_EQ(action, state.NextAction()) << *state.AsValue(); \
+ EXPECT_EQ(action, state.NextAction()) << state.AsValue()->ToString(); \
if (action == SchedulerStateMachine::ACTION_DRAW_AND_SWAP_IF_POSSIBLE || \
action == SchedulerStateMachine::ACTION_DRAW_AND_SWAP_FORCED) { \
EXPECT_EQ(SchedulerStateMachine::BEGIN_IMPL_FRAME_STATE_INSIDE_DEADLINE, \
state.begin_impl_frame_state()) \
- << *state.AsValue(); \
+ << state.AsValue()->ToString(); \
} \
state.UpdateState(action); \
if (action == SchedulerStateMachine::ACTION_NONE) { \
@@ -690,7 +691,7 @@ TEST(SchedulerStateMachineTest, TestNextActionDrawsOnBeginImplFrame) {
state.SetNeedsCommit();
EXPECT_NE(SchedulerStateMachine::ACTION_DRAW_AND_SWAP_IF_POSSIBLE,
state.NextAction())
- << *state.AsValue();
+ << state.AsValue()->ToString();
}
}
@@ -716,16 +717,18 @@ TEST(SchedulerStateMachineTest, TestNextActionDrawsOnBeginImplFrame) {
} else {
expected_action = SchedulerStateMachine::ACTION_DRAW_AND_SWAP_IF_POSSIBLE;
EXPECT_EQ(state.NextAction(), SchedulerStateMachine::ACTION_ANIMATE)
- << *state.AsValue();
+ << state.AsValue()->ToString();
state.UpdateState(state.NextAction());
}
// Case 1: needs_commit=false.
- EXPECT_EQ(state.NextAction(), expected_action) << *state.AsValue();
+ EXPECT_EQ(state.NextAction(), expected_action)
+ << state.AsValue()->ToString();
// Case 2: needs_commit=true.
state.SetNeedsCommit();
- EXPECT_EQ(state.NextAction(), expected_action) << *state.AsValue();
+ EXPECT_EQ(state.NextAction(), expected_action)
+ << state.AsValue()->ToString();
}
}
@@ -757,7 +760,7 @@ TEST(SchedulerStateMachineTest, TestNoCommitStatesRedrawWhenInvisible) {
state.SetNeedsCommit();
EXPECT_NE(SchedulerStateMachine::ACTION_DRAW_AND_SWAP_IF_POSSIBLE,
state.NextAction())
- << *state.AsValue();
+ << state.AsValue()->ToString();
}
}
}
@@ -1655,7 +1658,7 @@ TEST(SchedulerStateMachineTest, TestInitialActionsWhenContextLost) {
// main thread will just abort anyway.
state.SetVisible(false);
EXPECT_EQ(SchedulerStateMachine::ACTION_NONE, state.NextAction())
- << *state.AsValue();
+ << state.AsValue()->ToString();
}
TEST(SchedulerStateMachineTest, ReportIfNotDrawing) {
« no previous file with comments | « cc/scheduler/scheduler_state_machine.cc ('k') | cc/scheduler/scheduler_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698