| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "chrome/browser/android/offline_pages/offline_page_utils.h" | 5 #include "chrome/browser/android/offline_pages/offline_page_utils.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 // This one should be missing | 209 // This one should be missing |
| 210 OfflinePageUtils::CheckExistenceOfPagesWithURL( | 210 OfflinePageUtils::CheckExistenceOfPagesWithURL( |
| 211 profile(), kDownloadNamespace, kTestPage3Url, | 211 profile(), kDownloadNamespace, kTestPage3Url, |
| 212 base::Bind(&HasDuplicatesCallback, base::Unretained(&has_duplicates), | 212 base::Bind(&HasDuplicatesCallback, base::Unretained(&has_duplicates), |
| 213 base::Unretained(&latest_saved_time))); | 213 base::Unretained(&latest_saved_time))); |
| 214 RunUntilIdle(); | 214 RunUntilIdle(); |
| 215 EXPECT_FALSE(has_duplicates); | 215 EXPECT_FALSE(has_duplicates); |
| 216 EXPECT_EQ(base::Time(), latest_saved_time); | 216 EXPECT_EQ(base::Time(), latest_saved_time); |
| 217 } | 217 } |
| 218 | 218 |
| 219 TEST_F(OfflinePageUtilsTest, EqualsIgnoringFragment) { |
| 220 EXPECT_TRUE(OfflinePageUtils::EqualsIgnoringFragment( |
| 221 GURL("http://example.com/"), GURL("http://example.com/"))); |
| 222 EXPECT_TRUE(OfflinePageUtils::EqualsIgnoringFragment( |
| 223 GURL("http://example.com/"), GURL("http://example.com/#test"))); |
| 224 EXPECT_TRUE(OfflinePageUtils::EqualsIgnoringFragment( |
| 225 GURL("http://example.com/#test"), GURL("http://example.com/"))); |
| 226 EXPECT_TRUE(OfflinePageUtils::EqualsIgnoringFragment( |
| 227 GURL("http://example.com/#test"), GURL("http://example.com/#test2"))); |
| 228 EXPECT_FALSE(OfflinePageUtils::EqualsIgnoringFragment( |
| 229 GURL("http://example.com/"), GURL("http://test.com/#test"))); |
| 230 } |
| 231 |
| 219 } // namespace offline_pages | 232 } // namespace offline_pages |
| OLD | NEW |