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

Side by Side Diff: runtime/vm/timeline_test.cc

Issue 1368823002: Fix TimelinePauses_Basic test failure (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« 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