| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include <cstring> | 5 #include <cstring> |
| 6 | 6 |
| 7 #include "platform/assert.h" | 7 #include "platform/assert.h" |
| 8 | 8 |
| 9 #include "vm/dart_api_impl.h" | 9 #include "vm/dart_api_impl.h" |
| 10 #include "vm/dart_api_state.h" | 10 #include "vm/dart_api_state.h" |
| (...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 434 const char* beta = strstr(js.ToCString(), "Beta"); | 434 const char* beta = strstr(js.ToCString(), "Beta"); |
| 435 EXPECT(alpha < beta); | 435 EXPECT(alpha < beta); |
| 436 } | 436 } |
| 437 | 437 |
| 438 | 438 |
| 439 TEST_CASE(TimelinePauses_Basic) { | 439 TEST_CASE(TimelinePauses_Basic) { |
| 440 TimelineEventEndlessRecorder* recorder = new TimelineEventEndlessRecorder(); | 440 TimelineEventEndlessRecorder* recorder = new TimelineEventEndlessRecorder(); |
| 441 ASSERT(recorder != NULL); | 441 ASSERT(recorder != NULL); |
| 442 Zone* zone = thread->zone(); | 442 Zone* zone = thread->zone(); |
| 443 Isolate* isolate = thread->isolate(); | 443 Isolate* isolate = thread->isolate(); |
| 444 ThreadId tid = OSThread::GetCurrentThreadId(); | 444 ThreadId tid = OSThread::GetCurrentThreadTraceId(); |
| 445 | 445 |
| 446 // Test case. | 446 // Test case. |
| 447 TimelineTestHelper::FakeDuration(recorder, "a", 0, 10); | 447 TimelineTestHelper::FakeDuration(recorder, "a", 0, 10); |
| 448 { | 448 { |
| 449 TimelinePauses pauses(zone, isolate, recorder); | 449 TimelinePauses pauses(zone, isolate, recorder); |
| 450 pauses.Setup(); | 450 pauses.Setup(); |
| 451 pauses.CalculatePauseTimesForThread(tid); | 451 pauses.CalculatePauseTimesForThread(tid); |
| 452 EXPECT(!pauses.has_error()); | 452 EXPECT(!pauses.has_error()); |
| 453 EXPECT_EQ(10, pauses.InclusiveTime("a")); | 453 EXPECT_EQ(10, pauses.InclusiveTime("a")); |
| 454 EXPECT_EQ(10, pauses.ExclusiveTime("a")); | 454 EXPECT_EQ(10, pauses.ExclusiveTime("a")); |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 599 EXPECT(!pauses.has_error()); | 599 EXPECT(!pauses.has_error()); |
| 600 EXPECT_EQ(10, pauses.InclusiveTime("a")); | 600 EXPECT_EQ(10, pauses.InclusiveTime("a")); |
| 601 EXPECT_EQ(10, pauses.ExclusiveTime("a")); | 601 EXPECT_EQ(10, pauses.ExclusiveTime("a")); |
| 602 EXPECT_EQ(10, pauses.MaxInclusiveTime("a")); | 602 EXPECT_EQ(10, pauses.MaxInclusiveTime("a")); |
| 603 EXPECT_EQ(8, pauses.MaxExclusiveTime("a")); | 603 EXPECT_EQ(8, pauses.MaxExclusiveTime("a")); |
| 604 } | 604 } |
| 605 TimelineTestHelper::Clear(recorder); | 605 TimelineTestHelper::Clear(recorder); |
| 606 } | 606 } |
| 607 | 607 |
| 608 } // namespace dart | 608 } // namespace dart |
| OLD | NEW |