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

Unified Diff: test/inspector/inspector-impl.cc

Issue 2784713002: [inspector] console get all information from inspector when needed (Closed)
Patch Set: fixed last test Created 3 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
« no previous file with comments | « test/inspector/inspector-impl.h ('k') | test/inspector/inspector-test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/inspector/inspector-impl.cc
diff --git a/test/inspector/inspector-impl.cc b/test/inspector/inspector-impl.cc
index 67e3718a7b809ffa31d5aeb4d59591891a293cbc..ddf1b131279589a1ce4c3789d30418393c4d2db2 100644
--- a/test/inspector/inspector-impl.cc
+++ b/test/inspector/inspector-impl.cc
@@ -174,8 +174,10 @@ void InspectorClientImpl::connect(v8::Local<v8::Context> context) {
sessions_[context_group_id] =
inspector_->connect(context_group_id, channel_.get(), state);
context->SetAlignedPointerInEmbedderData(kInspectorClientIndex, this);
- inspector_->contextCreated(v8_inspector::V8ContextInfo(
- context, context_group_id, v8_inspector::StringView()));
+ v8_inspector::V8ContextInfo info(context, context_group_id,
+ v8_inspector::StringView());
+ info.hasMemoryOnConsole = true;
+ inspector_->contextCreated(info);
} else {
for (const auto& it : states_) {
int context_group_id = it.first;
@@ -185,8 +187,10 @@ void InspectorClientImpl::connect(v8::Local<v8::Context> context) {
sessions_[context_group_id] =
inspector_->connect(context_group_id, channel_.get(), state);
context->SetAlignedPointerInEmbedderData(kInspectorClientIndex, this);
- inspector_->contextCreated(v8_inspector::V8ContextInfo(
- context, context_group_id, v8_inspector::StringView()));
+ v8_inspector::V8ContextInfo info(context, context_group_id,
+ v8_inspector::StringView());
+ info.hasMemoryOnConsole = true;
+ inspector_->contextCreated(info);
}
}
states_.clear();
@@ -256,6 +260,17 @@ double InspectorClientImpl::currentTimeMS() {
return v8::base::OS::TimeCurrentMillis();
}
+void InspectorClientImpl::setMemoryInfoForTest(
+ v8::Local<v8::Value> memory_info) {
+ memory_info_.Reset(isolate_, memory_info);
+}
+
+v8::MaybeLocal<v8::Value> InspectorClientImpl::memoryInfo(
+ v8::Isolate* isolate, v8::Local<v8::Context>) {
+ if (memory_info_.IsEmpty()) return v8::MaybeLocal<v8::Value>();
+ return memory_info_.Get(isolate);
+}
+
void InspectorClientImpl::runMessageLoopOnPause(int) {
task_runner_->RunMessageLoop(true);
}
« no previous file with comments | « test/inspector/inspector-impl.h ('k') | test/inspector/inspector-test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698