OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium 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 #include "core/loader/DocumentLoadTiming.h" | 5 #include "core/loader/DocumentLoadTiming.h" |
6 | 6 |
| 7 #include <memory> |
7 #include "core/loader/DocumentLoader.h" | 8 #include "core/loader/DocumentLoader.h" |
8 #include "core/testing/DummyPageHolder.h" | 9 #include "core/testing/DummyPageHolder.h" |
9 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
10 #include <memory> | |
11 | 11 |
12 namespace blink { | 12 namespace blink { |
13 | 13 |
14 class DocumentLoadTimingTest : public testing::Test {}; | 14 class DocumentLoadTimingTest : public testing::Test {}; |
15 | 15 |
16 TEST_F(DocumentLoadTimingTest, ensureValidNavigationStartAfterEmbedder) { | 16 TEST_F(DocumentLoadTimingTest, ensureValidNavigationStartAfterEmbedder) { |
17 std::unique_ptr<DummyPageHolder> dummyPage = DummyPageHolder::create(); | 17 std::unique_ptr<DummyPageHolder> dummyPage = DummyPageHolder::create(); |
18 DocumentLoadTiming timing(*(dummyPage->document().loader())); | 18 DocumentLoadTiming timing(*(dummyPage->document().loader())); |
19 | 19 |
20 double delta = -1000; | 20 double delta = -1000; |
(...skipping 26 matching lines...) Expand all Loading... |
47 | 47 |
48 EXPECT_NEAR(adjustedLoadEventEnd, realWallLoadEventEnd, .001); | 48 EXPECT_NEAR(adjustedLoadEventEnd, realWallLoadEventEnd, .001); |
49 | 49 |
50 double adjustedNavigationStart = | 50 double adjustedNavigationStart = |
51 timing.monotonicTimeToPseudoWallTime(timing.navigationStart()); | 51 timing.monotonicTimeToPseudoWallTime(timing.navigationStart()); |
52 EXPECT_NEAR(adjustedLoadEventEnd - adjustedNavigationStart, | 52 EXPECT_NEAR(adjustedLoadEventEnd - adjustedNavigationStart, |
53 -navigationStartDelta, .001); | 53 -navigationStartDelta, .001); |
54 } | 54 } |
55 | 55 |
56 } // namespace blink | 56 } // namespace blink |
OLD | NEW |