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

Unified Diff: third_party/WebKit/Source/core/inspector/InspectorInspectorAgent.cpp

Issue 1828983002: Revert of [DevTools] Use InspectorFrontendHost.readyForTest for layout tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ready-for-test
Patch Set: Created 4 years, 9 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
Index: third_party/WebKit/Source/core/inspector/InspectorInspectorAgent.cpp
diff --git a/third_party/WebKit/Source/core/inspector/InspectorInspectorAgent.cpp b/third_party/WebKit/Source/core/inspector/InspectorInspectorAgent.cpp
index e88b11b5fda3c7bda13c2d89d664f28e3b693620..c5e0a6273e67c4a46589f6126c1f456a496a6698 100644
--- a/third_party/WebKit/Source/core/inspector/InspectorInspectorAgent.cpp
+++ b/third_party/WebKit/Source/core/inspector/InspectorInspectorAgent.cpp
@@ -57,11 +57,33 @@
void InspectorInspectorAgent::enable(ErrorString*)
{
m_state->setBoolean(InspectorAgentState::inspectorAgentEnabled, true);
+ for (Vector<std::pair<long, String>>::iterator it = m_pendingEvaluateTestCommands.begin(); frontend() && it != m_pendingEvaluateTestCommands.end(); ++it)
+ frontend()->evaluateForTestInFrontend(static_cast<int>((*it).first), (*it).second);
+ m_pendingEvaluateTestCommands.clear();
}
void InspectorInspectorAgent::disable(ErrorString*)
{
m_state->setBoolean(InspectorAgentState::inspectorAgentEnabled, false);
+ m_pendingEvaluateTestCommands.clear();
+}
+
+void InspectorInspectorAgent::restore()
+{
+ if (m_state->booleanProperty(InspectorAgentState::inspectorAgentEnabled, false)) {
+ ErrorString error;
+ enable(&error);
+ }
+}
+
+void InspectorInspectorAgent::evaluateForTestInFrontend(long callId, const String& script)
+{
+ if (m_state->booleanProperty(InspectorAgentState::inspectorAgentEnabled, false)) {
+ frontend()->evaluateForTestInFrontend(static_cast<int>(callId), script);
+ frontend()->flush();
+ } else {
+ m_pendingEvaluateTestCommands.append(std::pair<long, String>(callId, script));
+ }
}
void InspectorInspectorAgent::inspect(PassOwnPtr<protocol::Runtime::RemoteObject> objectToInspect, PassOwnPtr<protocol::DictionaryValue> hints)

Powered by Google App Engine
This is Rietveld 408576698