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

Unified Diff: chrome/common/page_load_metrics/page_load_timing_unittest.cc

Issue 2199443002: Move PageLoadTiming TimeDelta fields to a common header. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove dom_loading Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/common/page_load_metrics/page_load_timing_fields.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/page_load_metrics/page_load_timing_unittest.cc
diff --git a/chrome/common/page_load_metrics/page_load_timing_unittest.cc b/chrome/common/page_load_metrics/page_load_timing_unittest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..f00c9d190006de09a339b829e14088af5be4444e
--- /dev/null
+++ b/chrome/common/page_load_metrics/page_load_timing_unittest.cc
@@ -0,0 +1,38 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/common/page_load_metrics/page_load_timing.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+class PageLoadTimingTest : public testing::Test {};
+
+TEST_F(PageLoadTimingTest, IsEmpty1) {
+ page_load_metrics::PageLoadTiming timing;
+ ASSERT_TRUE(timing.IsEmpty());
+ timing.navigation_start = base::Time::Now();
+ ASSERT_FALSE(timing.IsEmpty());
+}
+
+TEST_F(PageLoadTimingTest, IsEmpty2) {
+ page_load_metrics::PageLoadTiming timing;
+ ASSERT_TRUE(timing.IsEmpty());
+ timing.parse_start = base::TimeDelta::FromSeconds(1);
+ ASSERT_FALSE(timing.IsEmpty());
+}
+
+TEST_F(PageLoadTimingTest, Equal) {
+ page_load_metrics::PageLoadTiming timing1;
+ page_load_metrics::PageLoadTiming timing2;
+ ASSERT_TRUE(timing1 == timing2);
+
+ timing1.parse_start = base::TimeDelta::FromSeconds(1);
+ ASSERT_FALSE(timing1 == timing2);
+ timing2.parse_start = timing1.parse_start;
+ ASSERT_TRUE(timing1 == timing2);
+
+ timing1.navigation_start = base::Time::Now();
+ ASSERT_FALSE(timing1 == timing2);
+ timing2.navigation_start = timing1.navigation_start;
+ ASSERT_TRUE(timing1 == timing2);
+}
« no previous file with comments | « chrome/common/page_load_metrics/page_load_timing_fields.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698