Index: components/history/core/browser/download_job_info_unittest.cc |
diff --git a/components/history/core/browser/download_job_info_unittest.cc b/components/history/core/browser/download_job_info_unittest.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..ff6eca090382f003d1d401fcdbc4d61751e2d4c5 |
--- /dev/null |
+++ b/components/history/core/browser/download_job_info_unittest.cc |
@@ -0,0 +1,27 @@ |
+// Copyright 2017 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 "components/history/core/browser/download_job_info.h" |
+ |
+#include "components/history/core/browser/download_constants.h" |
+#include "testing/gtest/include/gtest/gtest.h" |
+ |
+namespace history { |
+ |
+TEST(DownloadJobInfoTest, CompareDownloadJobInfo) { |
+ DownloadJobInfo info1(1, 1, 500, 1000, 10, DownloadState::IN_PROGRESS, 0); |
+ DownloadJobInfo info2(1, 1, 500, 1000, 1000, DownloadState::COMPLETE, 0); |
+ EXPECT_FALSE(info1 == info2); |
+ |
+ info1.received_bytes = 1000; |
+ EXPECT_FALSE(info1 == info2); |
+ |
+ info1.state = DownloadState::COMPLETE; |
+ EXPECT_EQ(info1, info2); |
+ |
+ info1.interrupt_reason = 1; |
+ EXPECT_FALSE(info1 == info2); |
+} |
+ |
+} // namespace history |