Commit 035117fc authored by Daniel Bratell's avatar Daniel Bratell Committed by Commit Bot

[jumbo] Avoid having two TimeTicksFromSecondsD

With the changes to port from wtf/time.h to base/time/time.h
the core test build target ended up with two TimeTicksFromSecondsD
which clashed in some jumbo builds. This patch is a short
term fix that inlines one of them.

A long term fix would imho be to add a TimeTick::FromSecondsD
method.

Bug: 919383
Change-Id: I5ff65f2a8bcfb95fc0163453793f7c290bbd9e52
Reviewed-on: https://chromium-review.googlesource.com/c/1489196
Auto-Submit: Daniel Bratell <bratell@opera.com>
Commit-Queue: Sergio Villar <svillar@igalia.com>
Reviewed-by: default avatarSergio Villar <svillar@igalia.com>
Cr-Commit-Position: refs/heads/master@{#635974}
parent 599efcbd
......@@ -20,12 +20,6 @@
#include "third_party/blink/renderer/core/timing/performance_observer_init.h"
#include "third_party/blink/renderer/platform/loader/fetch/resource_response.h"
namespace {
base::TimeTicks TimeTicksFromSecondsD(double seconds) {
return base::TimeTicks() + base::TimeDelta::FromSecondsD(seconds);
}
} // namespace
namespace blink {
class TestPerformance : public Performance {
......@@ -128,9 +122,10 @@ TEST_F(PerformanceTest, AddLongTaskTiming) {
SubTaskAttribution::EntriesVector sub_task_attributions;
// Add a long task entry, but no observer registered.
base_->AddLongTaskTiming(TimeTicksFromSecondsD(1234),
TimeTicksFromSecondsD(5678), "same-origin",
"www.foo.com/bar", "", "", sub_task_attributions);
base_->AddLongTaskTiming(
base::TimeTicks() + base::TimeDelta::FromSecondsD(1234),
base::TimeTicks() + base::TimeDelta::FromSecondsD(5678), "same-origin",
"www.foo.com/bar", "", "", sub_task_attributions);
EXPECT_FALSE(base_->HasPerformanceObserverFor(PerformanceEntry::kLongTask));
EXPECT_EQ(0, NumPerformanceEntriesInObserver()); // has no effect
......@@ -144,9 +139,10 @@ TEST_F(PerformanceTest, AddLongTaskTiming) {
EXPECT_TRUE(base_->HasPerformanceObserverFor(PerformanceEntry::kLongTask));
// Add a long task entry
base_->AddLongTaskTiming(TimeTicksFromSecondsD(1234),
TimeTicksFromSecondsD(5678), "same-origin",
"www.foo.com/bar", "", "", sub_task_attributions);
base_->AddLongTaskTiming(
base::TimeTicks() + base::TimeDelta::FromSecondsD(1234),
base::TimeTicks() + base::TimeDelta::FromSecondsD(5678), "same-origin",
"www.foo.com/bar", "", "", sub_task_attributions);
EXPECT_EQ(1, NumPerformanceEntriesInObserver()); // added an entry
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment