OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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 #include <stdlib.h> | 4 #include <stdlib.h> |
5 #include <string.h> | 5 #include <string.h> |
6 | 6 |
7 #include "src/v8.h" | 7 #include "src/v8.h" |
8 | 8 |
9 #include "src/list.h" | 9 #include "src/list.h" |
10 #include "src/list-inl.h" | 10 #include "src/list-inl.h" |
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 | 250 |
251 CHECK_EQ(2, GET_TRACE_OBJECTS_LIST->length()); | 251 CHECK_EQ(2, GET_TRACE_OBJECTS_LIST->length()); |
252 CHECK_EQ(TRACE_EVENT_PHASE_ASYNC_BEGIN, GET_TRACE_OBJECT(0)->phase); | 252 CHECK_EQ(TRACE_EVENT_PHASE_ASYNC_BEGIN, GET_TRACE_OBJECT(0)->phase); |
253 CHECK_EQ(event_id, GET_TRACE_OBJECT(0)->id); | 253 CHECK_EQ(event_id, GET_TRACE_OBJECT(0)->id); |
254 CHECK_EQ(TRACE_EVENT_PHASE_ASYNC_END, GET_TRACE_OBJECT(1)->phase); | 254 CHECK_EQ(TRACE_EVENT_PHASE_ASYNC_END, GET_TRACE_OBJECT(1)->phase); |
255 CHECK_EQ(event_id, GET_TRACE_OBJECT(1)->id); | 255 CHECK_EQ(event_id, GET_TRACE_OBJECT(1)->id); |
256 | 256 |
257 i::V8::SetPlatformForTesting(old_platform); | 257 i::V8::SetPlatformForTesting(old_platform); |
258 } | 258 } |
259 | 259 |
260 /* | |
261 TODO(chiniforooshan, crbug.com/647986): enable this again after landing | |
262 https://codereview.chromium.org/2253973003 | |
263 | |
264 TEST(TestEventInContext) { | 260 TEST(TestEventInContext) { |
265 v8::Platform* old_platform = i::V8::GetCurrentPlatform(); | 261 v8::Platform* old_platform = i::V8::GetCurrentPlatform(); |
266 MockTracingPlatform platform(old_platform); | 262 MockTracingPlatform platform(old_platform); |
267 i::V8::SetPlatformForTesting(&platform); | 263 i::V8::SetPlatformForTesting(&platform); |
268 | 264 |
269 static uint64_t isolate_id = 0x20151021; | 265 static uint64_t isolate_id = 0x20151021; |
270 { | 266 { |
271 TRACE_EVENT_SCOPED_CONTEXT("v8-cat", "Isolate", isolate_id); | 267 TRACE_EVENT_SCOPED_CONTEXT("v8-cat", "Isolate", isolate_id); |
272 TRACE_EVENT0("v8-cat", "e"); | 268 TRACE_EVENT0("v8-cat", "e"); |
273 } | 269 } |
274 | 270 |
275 CHECK_EQ(3, GET_TRACE_OBJECTS_LIST->length()); | 271 CHECK_EQ(3, GET_TRACE_OBJECTS_LIST->length()); |
276 CHECK_EQ(TRACE_EVENT_PHASE_ENTER_CONTEXT, GET_TRACE_OBJECT(0)->phase); | 272 CHECK_EQ(TRACE_EVENT_PHASE_ENTER_CONTEXT, GET_TRACE_OBJECT(0)->phase); |
277 CHECK_EQ("Isolate", GET_TRACE_OBJECT(0)->name); | 273 CHECK_EQ("Isolate", GET_TRACE_OBJECT(0)->name); |
278 CHECK_EQ(isolate_id, GET_TRACE_OBJECT(0)->id); | 274 CHECK_EQ(isolate_id, GET_TRACE_OBJECT(0)->id); |
279 CHECK_EQ(TRACE_EVENT_PHASE_COMPLETE, GET_TRACE_OBJECT(1)->phase); | 275 CHECK_EQ(TRACE_EVENT_PHASE_COMPLETE, GET_TRACE_OBJECT(1)->phase); |
280 CHECK_EQ("e", GET_TRACE_OBJECT(1)->name); | 276 CHECK_EQ("e", GET_TRACE_OBJECT(1)->name); |
281 CHECK_EQ(TRACE_EVENT_PHASE_LEAVE_CONTEXT, GET_TRACE_OBJECT(2)->phase); | 277 CHECK_EQ(TRACE_EVENT_PHASE_LEAVE_CONTEXT, GET_TRACE_OBJECT(2)->phase); |
282 CHECK_EQ("Isolate", GET_TRACE_OBJECT(2)->name); | 278 CHECK_EQ("Isolate", GET_TRACE_OBJECT(2)->name); |
283 CHECK_EQ(isolate_id, GET_TRACE_OBJECT(2)->id); | 279 CHECK_EQ(isolate_id, GET_TRACE_OBJECT(2)->id); |
284 | 280 |
285 i::V8::SetPlatformForTesting(old_platform); | 281 i::V8::SetPlatformForTesting(old_platform); |
286 } | 282 } |
287 */ | |
OLD | NEW |