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

Unified Diff: test/inspector/inspector-test.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.cc ('k') | test/inspector/protocol-test.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/inspector/inspector-test.cc
diff --git a/test/inspector/inspector-test.cc b/test/inspector/inspector-test.cc
index 817f3d6418185755dffca1a81d217736a4d73528..d29d675cbfe6b00b6425134056381d553cde382f 100644
--- a/test/inspector/inspector-test.cc
+++ b/test/inspector/inspector-test.cc
@@ -57,6 +57,7 @@ class UtilsExtension : public v8::Extension {
"native function load();"
"native function compileAndRunWithOrigin();"
"native function setCurrentTimeMSForTest();"
+ "native function setMemoryInfoForTest();"
"native function schedulePauseOnNextStatement();"
"native function cancelPauseOnNextStatement();"
"native function reconnect();"
@@ -107,6 +108,13 @@ class UtilsExtension : public v8::Extension {
.FromJust()) {
return v8::FunctionTemplate::New(isolate,
UtilsExtension::SetCurrentTimeMSForTest);
+ } else if (name->Equals(context, v8::String::NewFromUtf8(
+ isolate, "setMemoryInfoForTest",
+ v8::NewStringType::kNormal)
+ .ToLocalChecked())
+ .FromJust()) {
+ return v8::FunctionTemplate::New(isolate,
+ UtilsExtension::SetMemoryInfoForTest);
} else if (name->Equals(context,
v8::String::NewFromUtf8(
isolate, "schedulePauseOnNextStatement",
@@ -266,6 +274,15 @@ class UtilsExtension : public v8::Extension {
args[0].As<v8::Number>()->Value());
}
+ static void SetMemoryInfoForTest(
+ const v8::FunctionCallbackInfo<v8::Value>& args) {
+ if (args.Length() != 1) {
+ fprintf(stderr, "Internal error: setMemoryInfoForTest(value).");
+ Exit();
+ }
+ inspector_client_->setMemoryInfoForTest(args[0]);
+ }
+
static void SchedulePauseOnNextStatement(
const v8::FunctionCallbackInfo<v8::Value>& args) {
if (args.Length() != 2 || !args[0]->IsString() || !args[1]->IsString()) {
« no previous file with comments | « test/inspector/inspector-impl.cc ('k') | test/inspector/protocol-test.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698