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

Unified Diff: runtime/vm/profiler_test.cc

Issue 1276053002: Make sure that profile_vm is turned off when running profiler tests. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 4 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/profiler_test.cc
diff --git a/runtime/vm/profiler_test.cc b/runtime/vm/profiler_test.cc
index 965d6b3e08b16fd0ca8fbef8f3b5e2babd29a451..55b408489005ddddeb677f09d2fa36e9155dbb15 100644
--- a/runtime/vm/profiler_test.cc
+++ b/runtime/vm/profiler_test.cc
@@ -13,6 +13,24 @@
namespace dart {
+DECLARE_FLAG(bool, profile_vm);
+
+// Some tests are written assuming native stack trace profiling is disabled.
+class DisableNativeProfileScope {
+ DisableNativeProfileScope()
+ : FLAG_profile_vm_(FLAG_profile_vm) {
+ FLAG_profile_vm = false;
+ }
+
+ ~DisableNativeProfileScope() {
+ FLAG_profile_vm = FLAG_profile_vm_;
+ }
+
+ private:
+ bool FLAG_profile_vm_;
+};
+
+
class ProfileSampleBufferTestHelper {
public:
static intptr_t IterateCount(const Isolate* isolate,
@@ -126,6 +144,7 @@ class AllocationFilter : public SampleFilter {
TEST_CASE(Profiler_TrivialRecordAllocation) {
+ DisableNativeProfileScope dnps;
const char* kScript =
"class A {\n"
" var a;\n"
@@ -204,6 +223,7 @@ TEST_CASE(Profiler_TrivialRecordAllocation) {
TEST_CASE(Profiler_ToggleRecordAllocation) {
+ DisableNativeProfileScope dnps;
const char* kScript =
"class A {\n"
" var a;\n"
@@ -315,6 +335,7 @@ TEST_CASE(Profiler_ToggleRecordAllocation) {
TEST_CASE(Profiler_CodeTicks) {
+ DisableNativeProfileScope dnps;
const char* kScript =
"class A {\n"
" var a;\n"
@@ -407,6 +428,7 @@ TEST_CASE(Profiler_CodeTicks) {
TEST_CASE(Profiler_FunctionTicks) {
+ DisableNativeProfileScope dnps;
const char* kScript =
"class A {\n"
" var a;\n"
@@ -499,6 +521,7 @@ TEST_CASE(Profiler_FunctionTicks) {
TEST_CASE(Profiler_IntrinsicAllocation) {
+ DisableNativeProfileScope dnps;
const char* kScript = "double foo(double a, double b) => a + b;";
Dart_Handle lib = TestCase::LoadTestScript(kScript, NULL);
EXPECT_VALID(lib);
@@ -566,6 +589,7 @@ TEST_CASE(Profiler_IntrinsicAllocation) {
TEST_CASE(Profiler_ArrayAllocation) {
+ DisableNativeProfileScope dnps;
const char* kScript =
"List foo() => new List(4);\n"
"List bar() => new List();\n";
@@ -669,6 +693,7 @@ TEST_CASE(Profiler_ArrayAllocation) {
TEST_CASE(Profiler_TypedArrayAllocation) {
+ DisableNativeProfileScope dnps;
const char* kScript =
"import 'dart:typed_data';\n"
"List foo() => new Float32List(4);\n";
@@ -755,6 +780,7 @@ TEST_CASE(Profiler_TypedArrayAllocation) {
TEST_CASE(Profiler_StringAllocation) {
+ DisableNativeProfileScope dnps;
const char* kScript = "String foo(String a, String b) => a + b;";
Dart_Handle lib = TestCase::LoadTestScript(kScript, NULL);
EXPECT_VALID(lib);
@@ -834,6 +860,7 @@ TEST_CASE(Profiler_StringAllocation) {
TEST_CASE(Profiler_StringInterpolation) {
+ DisableNativeProfileScope dnps;
const char* kScript = "String foo(String a, String b) => '$a | $b';";
Dart_Handle lib = TestCase::LoadTestScript(kScript, NULL);
EXPECT_VALID(lib);
@@ -917,6 +944,7 @@ TEST_CASE(Profiler_StringInterpolation) {
TEST_CASE(Profiler_FunctionInline) {
+ DisableNativeProfileScope dnps;
const char* kScript =
"class A {\n"
" var a;\n"
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698