| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "base/json/json_reader.h" | 5 #include "base/json/json_reader.h" |
| 6 #include "base/trace_event/trace_config.h" | 6 #include "base/trace_event/trace_config.h" |
| 7 #include "base/values.h" | 7 #include "base/values.h" |
| 8 #include "content/browser/devtools/protocol/tracing_handler.h" | 8 #include "content/browser/devtools/protocol/tracing_handler.h" |
| 9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
| 10 | 10 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 "{\"mode\":\"detailed\",\"periodicIntervalMs\":1000}" | 50 "{\"mode\":\"detailed\",\"periodicIntervalMs\":1000}" |
| 51 "]" | 51 "]" |
| 52 "}," | 52 "}," |
| 53 "\"recordMode\":\"recordContinuously\"," | 53 "\"recordMode\":\"recordContinuously\"," |
| 54 "\"synthetic_delays\":[\"test.Delay1;16\",\"test.Delay2;32\"]" | 54 "\"synthetic_delays\":[\"test.Delay1;16\",\"test.Delay2;32\"]" |
| 55 "}"; | 55 "}"; |
| 56 | 56 |
| 57 } | 57 } |
| 58 | 58 |
| 59 TEST(TracingHandlerTest, GetTraceConfigFromDevToolsConfig) { | 59 TEST(TracingHandlerTest, GetTraceConfigFromDevToolsConfig) { |
| 60 scoped_ptr<base::Value> value = base::JSONReader::Read( | 60 std::unique_ptr<base::Value> value = |
| 61 kCustomTraceConfigStringDevToolsStyle); | 61 base::JSONReader::Read(kCustomTraceConfigStringDevToolsStyle); |
| 62 scoped_ptr<base::DictionaryValue> devtools_style_dict( | 62 std::unique_ptr<base::DictionaryValue> devtools_style_dict( |
| 63 static_cast<base::DictionaryValue*>(value.release())); | 63 static_cast<base::DictionaryValue*>(value.release())); |
| 64 | 64 |
| 65 base::trace_event::TraceConfig trace_config = | 65 base::trace_event::TraceConfig trace_config = |
| 66 TracingHandler::GetTraceConfigFromDevToolsConfig(*devtools_style_dict); | 66 TracingHandler::GetTraceConfigFromDevToolsConfig(*devtools_style_dict); |
| 67 | 67 |
| 68 EXPECT_STREQ(kCustomTraceConfigString, trace_config.ToString().c_str()); | 68 EXPECT_STREQ(kCustomTraceConfigString, trace_config.ToString().c_str()); |
| 69 } | 69 } |
| 70 | 70 |
| 71 } // namespace tracing | 71 } // namespace tracing |
| 72 } // namespace devtools | 72 } // namespace devtools |
| 73 } // namespace content | 73 } // namespace content |
| OLD | NEW |