Add spec for heap snapshot crash (#66).
This commit is contained in:
parent
fd299cb3fe
commit
018a48770a
2 changed files with 13 additions and 0 deletions
|
@ -3,7 +3,9 @@
|
||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
#include "common/api/object_life_monitor.h"
|
#include "common/api/object_life_monitor.h"
|
||||||
|
#include "v8/include/v8-profiler.h"
|
||||||
#include "vendor/node/src/node.h"
|
#include "vendor/node/src/node.h"
|
||||||
|
#include "vendor/node/src/node_internals.h"
|
||||||
|
|
||||||
namespace atom {
|
namespace atom {
|
||||||
|
|
||||||
|
@ -44,6 +46,12 @@ v8::Handle<v8::Value> SetDestructor(const v8::Arguments& args) {
|
||||||
return v8::Undefined();
|
return v8::Undefined();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
v8::Handle<v8::Value> TakeHeapSnapshot(const v8::Arguments& args) {
|
||||||
|
node::node_isolate->GetHeapProfiler()->TakeHeapSnapshot(
|
||||||
|
v8::String::New("test"));
|
||||||
|
return v8::Undefined();
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
void InitializeV8Util(v8::Handle<v8::Object> target) {
|
void InitializeV8Util(v8::Handle<v8::Object> target) {
|
||||||
|
@ -52,6 +60,7 @@ void InitializeV8Util(v8::Handle<v8::Object> target) {
|
||||||
NODE_SET_METHOD(target, "setHiddenValue", SetHiddenValue);
|
NODE_SET_METHOD(target, "setHiddenValue", SetHiddenValue);
|
||||||
NODE_SET_METHOD(target, "getObjectHash", GetObjectHash);
|
NODE_SET_METHOD(target, "getObjectHash", GetObjectHash);
|
||||||
NODE_SET_METHOD(target, "setDestructor", SetDestructor);
|
NODE_SET_METHOD(target, "setDestructor", SetDestructor);
|
||||||
|
NODE_SET_METHOD(target, "takeHeapSnapshot", TakeHeapSnapshot);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace api
|
} // namespace api
|
||||||
|
|
4
spec/web/debugger.coffee
Normal file
4
spec/web/debugger.coffee
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
describe 'debugger', ->
|
||||||
|
describe 'heap snapshot', ->
|
||||||
|
it 'should not crash', ->
|
||||||
|
process.atomBinding('v8_util').takeHeapSnapshot()
|
Loading…
Reference in a new issue