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

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

Issue 2669393002: [inspector] fixed taskHeapSnapshot on pause (Closed)
Patch Set: updated test expectations Created 3 years, 10 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/heap-profiler/take-heap-snapshot-on-pause-expected.txt ('k') | no next file » | 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 0459687a60b3ac0d8bb62915929f4f444d6c22ae..841be28f043fcf6fbc60f04830896c1c332aa215 100644
--- a/test/inspector/inspector-test.cc
+++ b/test/inspector/inspector-test.cc
@@ -320,6 +320,13 @@ class SetTimeoutExtension : public v8::Extension {
}
};
+bool StrictAccessCheck(v8::Local<v8::Context> accessing_context,
+ v8::Local<v8::Object> accessed_object,
+ v8::Local<v8::Value> data) {
+ CHECK(accessing_context.IsEmpty());
+ return accessing_context.IsEmpty();
+}
+
class InspectorExtension : public v8::Extension {
public:
InspectorExtension()
@@ -327,7 +334,8 @@ class InspectorExtension : public v8::Extension {
"native function attachInspector();"
"native function detachInspector();"
"native function setMaxAsyncTaskStacks();"
- "native function breakProgram();") {}
+ "native function breakProgram();"
+ "native function createObjectWithStrictCheck();") {}
virtual v8::Local<v8::FunctionTemplate> GetNativeFunctionTemplate(
v8::Isolate* isolate, v8::Local<v8::String> name) {
@@ -358,6 +366,13 @@ class InspectorExtension : public v8::Extension {
.FromJust()) {
return v8::FunctionTemplate::New(isolate,
InspectorExtension::BreakProgram);
+ } else if (name->Equals(context, v8::String::NewFromUtf8(
+ isolate, "createObjectWithStrictCheck",
+ v8::NewStringType::kNormal)
+ .ToLocalChecked())
+ .FromJust()) {
+ return v8::FunctionTemplate::New(
+ isolate, InspectorExtension::CreateObjectWithStrictCheck);
}
return v8::Local<v8::FunctionTemplate>();
}
@@ -418,6 +433,20 @@ class InspectorExtension : public v8::Extension {
v8_inspector::StringView details_view(details.start(), details.length());
session->breakProgram(reason_view, details_view);
}
+
+ static void CreateObjectWithStrictCheck(
+ const v8::FunctionCallbackInfo<v8::Value>& args) {
+ if (args.Length() != 0) {
+ fprintf(stderr, "Internal error: createObjectWithStrictCheck().");
+ Exit();
+ }
+ v8::Local<v8::ObjectTemplate> templ =
+ v8::ObjectTemplate::New(args.GetIsolate());
+ templ->SetAccessCheckCallback(&StrictAccessCheck);
+ args.GetReturnValue().Set(
+ templ->NewInstance(args.GetIsolate()->GetCurrentContext())
+ .ToLocalChecked());
+ }
};
v8::Local<v8::String> ToString(v8::Isolate* isolate,
« no previous file with comments | « test/inspector/heap-profiler/take-heap-snapshot-on-pause-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698