| 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 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 RunUntilIdle(); | 193 RunUntilIdle(); |
| 194 EXPECT_TRUE(page_exists); | 194 EXPECT_TRUE(page_exists); |
| 195 // This one should be missing | 195 // This one should be missing |
| 196 OfflinePageUtils::CheckExistenceOfPagesWithURL( | 196 OfflinePageUtils::CheckExistenceOfPagesWithURL( |
| 197 profile(), kDownloadNamespace, kTestPage3Url, | 197 profile(), kDownloadNamespace, kTestPage3Url, |
| 198 base::Bind(&BoolCallback, base::Unretained(&page_exists))); | 198 base::Bind(&BoolCallback, base::Unretained(&page_exists))); |
| 199 RunUntilIdle(); | 199 RunUntilIdle(); |
| 200 EXPECT_FALSE(page_exists); | 200 EXPECT_FALSE(page_exists); |
| 201 } | 201 } |
| 202 | 202 |
| 203 TEST_F(OfflinePageUtilsTest, EqualsIgnoringFragment) { |
| 204 EXPECT_TRUE(OfflinePageUtils::EqualsIgnoringFragment( |
| 205 GURL("http://example.com/"), GURL("http://example.com/"))); |
| 206 EXPECT_TRUE(OfflinePageUtils::EqualsIgnoringFragment( |
| 207 GURL("http://example.com/"), GURL("http://example.com/#test"))); |
| 208 EXPECT_TRUE(OfflinePageUtils::EqualsIgnoringFragment( |
| 209 GURL("http://example.com/#test"), GURL("http://example.com/"))); |
| 210 EXPECT_TRUE(OfflinePageUtils::EqualsIgnoringFragment( |
| 211 GURL("http://example.com/#test"), GURL("http://example.com/#test2"))); |
| 212 EXPECT_FALSE(OfflinePageUtils::EqualsIgnoringFragment( |
| 213 GURL("http://example.com/"), GURL("http://test.com/#test"))); |
| 214 } |
| 215 |
| 203 } // namespace offline_pages | 216 } // namespace offline_pages |
| OLD | NEW |