#include "src/libsampler/sampler.h"
#include "include/v8-external.h"
#include "include/v8-function.h"
#include "src/base/platform/platform.h"
#include "src/base/platform/time.h"
#include "test/unittests/test-utils.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace v8 {
using SamplerTest = TestWithContext;
namespace sampler {
namespace {
class TestSamplingThread : public base::Thread { … };
class TestSampler : public Sampler { … };
class TestApiCallbacks { … };
static void RunSampler(v8::Local<v8::Context> env,
v8::Local<v8::Function> function,
v8::Local<v8::Value> argv[], int argc,
unsigned min_js_samples = 0,
unsigned min_external_samples = 0) { … }
}
static const char* sampler_test_source = …;
static v8::Local<v8::Function> GetFunction(v8::Local<v8::Context> env,
const char* name) { … }
TEST_F(SamplerTest, LibSamplerCollectSample) { … }
#ifdef USE_SIGNALS
class CountingSampler : public Sampler { … };
TEST_F(SamplerTest, SamplerManager_AddRemoveSampler) { … }
TEST_F(SamplerTest, SamplerManager_DoesNotReAdd) { … }
TEST_F(SamplerTest, AtomicGuard_GetNonBlockingSuccess) { … }
TEST_F(SamplerTest, AtomicGuard_GetBlockingSuccess) { … }
#endif
}
}