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

Unified Diff: runtime/vm/profiler_test.cc

Issue 1225343004: Add forgotten toggle on / off part of typed array allocation test (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 5 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 9759876070cbab4c9d478e3e40404cc8b45f43f5..1aff2a5db9760018e165ad792f265061d99cc1bc 100644
--- a/runtime/vm/profiler_test.cc
+++ b/runtime/vm/profiler_test.cc
@@ -539,6 +539,34 @@ TEST_CASE(Profiler_TypedArrayAllocation) {
EXPECT_STREQ("foo", walker.CurrentName());
EXPECT(!walker.Down());
}
+
+ float32_list_class.SetTraceAllocation(false);
+ result = Dart_Invoke(lib, NewString("foo"), 0, NULL);
+ EXPECT_VALID(result);
+
+ {
+ StackZone zone(isolate);
+ HANDLESCOPE(isolate);
+ Profile profile(isolate);
+ AllocationFilter filter(isolate, float32_list_class.id());
+ profile.Build(&filter, Profile::kNoTags);
+ // We should still only have one allocation sample.
+ EXPECT_EQ(1, profile.sample_count());
+ }
+
+ float32_list_class.SetTraceAllocation(true);
+ result = Dart_Invoke(lib, NewString("foo"), 0, NULL);
+ EXPECT_VALID(result);
+
+ {
+ StackZone zone(isolate);
+ HANDLESCOPE(isolate);
+ Profile profile(isolate);
+ AllocationFilter filter(isolate, float32_list_class.id());
+ profile.Build(&filter, Profile::kNoTags);
+ // We should now have two allocation samples.
+ EXPECT_EQ(2, profile.sample_count());
+ }
}
} // namespace dart
« 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