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

Side by Side Diff: test/cctest/test-sampler-api.cc

Issue 1506753002: [test] Test expectations in cctest should use CHECK and not DCHECK. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years 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 unified diff | Download patch
« no previous file with comments | « test/cctest/test-regexp.cc ('k') | test/cctest/test-serialize.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 // 4 //
5 // Tests the sampling API in include/v8.h 5 // Tests the sampling API in include/v8.h
6 6
7 // TODO(mythria): Remove this define after this flag is turned on globally 7 // TODO(mythria): Remove this define after this flag is turned on globally
8 #define V8_IMMINENT_DEPRECATION_WARNINGS 8 #define V8_IMMINENT_DEPRECATION_WARNINGS
9 9
10 #include <map> 10 #include <map>
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 public: 87 public:
88 struct CodeEventEntry { 88 struct CodeEventEntry {
89 std::string name; 89 std::string name;
90 const void* code_start; 90 const void* code_start;
91 size_t code_len; 91 size_t code_len;
92 }; 92 };
93 typedef std::map<const void*, CodeEventEntry> CodeEntries; 93 typedef std::map<const void*, CodeEventEntry> CodeEntries;
94 94
95 explicit SamplingTestHelper(const std::string& test_function) 95 explicit SamplingTestHelper(const std::string& test_function)
96 : sample_is_taken_(false), isolate_(CcTest::isolate()) { 96 : sample_is_taken_(false), isolate_(CcTest::isolate()) {
97 DCHECK(!instance_); 97 CHECK(!instance_);
98 instance_ = this; 98 instance_ = this;
99 v8::HandleScope scope(isolate_); 99 v8::HandleScope scope(isolate_);
100 v8::Local<v8::ObjectTemplate> global = v8::ObjectTemplate::New(isolate_); 100 v8::Local<v8::ObjectTemplate> global = v8::ObjectTemplate::New(isolate_);
101 global->Set(v8_str("CollectSample"), 101 global->Set(v8_str("CollectSample"),
102 v8::FunctionTemplate::New(isolate_, CollectSample)); 102 v8::FunctionTemplate::New(isolate_, CollectSample));
103 LocalContext env(isolate_, NULL, global); 103 LocalContext env(isolate_, NULL, global);
104 isolate_->SetJitCodeEventHandler(v8::kJitCodeEventDefault, 104 isolate_->SetJitCodeEventHandler(v8::kJitCodeEventDefault,
105 JitCodeEventHandler); 105 JitCodeEventHandler);
106 CompileRun(v8_str(test_function.c_str())); 106 CompileRun(v8_str(test_function.c_str()));
107 } 107 }
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 245
246 const SamplingTestHelper::CodeEventEntry* entry; 246 const SamplingTestHelper::CodeEventEntry* entry;
247 entry = helper.FindEventEntry(sample.begin()[0]); 247 entry = helper.FindEventEntry(sample.begin()[0]);
248 CHECK(entry); 248 CHECK(entry);
249 CHECK(std::string::npos != entry->name.find("test_sampler_api_inner")); 249 CHECK(std::string::npos != entry->name.find("test_sampler_api_inner"));
250 250
251 entry = helper.FindEventEntry(sample.begin()[1]); 251 entry = helper.FindEventEntry(sample.begin()[1]);
252 CHECK(entry); 252 CHECK(entry);
253 CHECK(std::string::npos != entry->name.find("test_sampler_api_outer")); 253 CHECK(std::string::npos != entry->name.find("test_sampler_api_outer"));
254 } 254 }
OLDNEW
« no previous file with comments | « test/cctest/test-regexp.cc ('k') | test/cctest/test-serialize.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698