| Index: base/trace_event/trace_event_unittest.cc
|
| diff --git a/base/trace_event/trace_event_unittest.cc b/base/trace_event/trace_event_unittest.cc
|
| index 0d3b0912ae21a15deac99aaa02b3eaede25421b8..33a287992d5e9ae64aa96430e85f43487e0caf38 100644
|
| --- a/base/trace_event/trace_event_unittest.cc
|
| +++ b/base/trace_event/trace_event_unittest.cc
|
| @@ -2204,6 +2204,35 @@ TEST_F(TraceEventTestFixture, PrimitiveArgs) {
|
| EXPECT_EQ(1, int_value);
|
| }
|
|
|
| +TEST_F(TraceEventTestFixture, ArgsWhitelisting) {
|
| + TraceOptions trace_options;
|
| + trace_options.enable_args_whitelist = true;
|
| + TraceLog::GetInstance()->SetEnabled(CategoryFilter("*"),
|
| + TraceLog::RECORDING_MODE, trace_options);
|
| +
|
| + TRACE_EVENT1("toplevel", "event1", "int_one", 1);
|
| + TRACE_EVENT1("whitewashed", "event2", "int_two", 1);
|
| + EndTraceAndFlush();
|
| +
|
| + const DictionaryValue* args_dict = NULL;
|
| + DictionaryValue* dict = NULL;
|
| + int int_value;
|
| +
|
| + dict = FindNamePhase("event1", "X");
|
| + ASSERT_TRUE(dict);
|
| + dict->GetDictionary("args", &args_dict);
|
| + ASSERT_TRUE(args_dict);
|
| + EXPECT_TRUE(args_dict->GetInteger("int_one", &int_value));
|
| + EXPECT_EQ(1, int_value);
|
| +
|
| + dict = FindNamePhase("event2", "X");
|
| + ASSERT_TRUE(dict);
|
| + dict->GetDictionary("args", &args_dict);
|
| + ASSERT_TRUE(args_dict);
|
| + EXPECT_FALSE(args_dict->GetInteger("int_two", &int_value));
|
| + EXPECT_TRUE(args_dict->GetInteger("stripped", &int_value));
|
| +}
|
| +
|
| class TraceEventCallbackTest : public TraceEventTestFixture {
|
| public:
|
| void SetUp() override {
|
|
|