| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "content/shell/browser/layout_test/layout_test_devtools_frontend.h" | 5 #include "content/shell/browser/layout_test/layout_test_devtools_frontend.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/json/json_reader.h" | 8 #include "base/json/json_reader.h" |
| 9 #include "base/json/json_writer.h" | 9 #include "base/json/json_writer.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 | 106 |
| 107 void LayoutTestDevToolsFrontend::AgentHostClosed( | 107 void LayoutTestDevToolsFrontend::AgentHostClosed( |
| 108 DevToolsAgentHost* agent_host, bool replaced) { | 108 DevToolsAgentHost* agent_host, bool replaced) { |
| 109 // Do not close the front-end shell. | 109 // Do not close the front-end shell. |
| 110 } | 110 } |
| 111 | 111 |
| 112 void LayoutTestDevToolsFrontend::HandleMessageFromDevToolsFrontend( | 112 void LayoutTestDevToolsFrontend::HandleMessageFromDevToolsFrontend( |
| 113 const std::string& message) { | 113 const std::string& message) { |
| 114 std::string method; | 114 std::string method; |
| 115 base::DictionaryValue* dict = nullptr; | 115 base::DictionaryValue* dict = nullptr; |
| 116 scoped_ptr<base::Value> parsed_message = base::JSONReader::Read(message); | 116 std::unique_ptr<base::Value> parsed_message = base::JSONReader::Read(message); |
| 117 if (parsed_message && | 117 if (parsed_message && |
| 118 parsed_message->GetAsDictionary(&dict) && | 118 parsed_message->GetAsDictionary(&dict) && |
| 119 dict->GetString("method", &method) && | 119 dict->GetString("method", &method) && |
| 120 method == "readyForTest") { | 120 method == "readyForTest") { |
| 121 ready_for_test_ = true; | 121 ready_for_test_ = true; |
| 122 for (const auto& pair : pending_evaluations_) | 122 for (const auto& pair : pending_evaluations_) |
| 123 EvaluateInFrontend(pair.first, pair.second); | 123 EvaluateInFrontend(pair.first, pair.second); |
| 124 pending_evaluations_.clear(); | 124 pending_evaluations_.clear(); |
| 125 return; | 125 return; |
| 126 } | 126 } |
| 127 | 127 |
| 128 ShellDevToolsFrontend::HandleMessageFromDevToolsFrontend(message); | 128 ShellDevToolsFrontend::HandleMessageFromDevToolsFrontend(message); |
| 129 } | 129 } |
| 130 | 130 |
| 131 void LayoutTestDevToolsFrontend::RenderProcessGone( | 131 void LayoutTestDevToolsFrontend::RenderProcessGone( |
| 132 base::TerminationStatus status) { | 132 base::TerminationStatus status) { |
| 133 BlinkTestController::Get()->DevToolsProcessCrashed(); | 133 BlinkTestController::Get()->DevToolsProcessCrashed(); |
| 134 } | 134 } |
| 135 | 135 |
| 136 } // namespace content | 136 } // namespace content |
| OLD | NEW |