offline_page_item_utils_unittest.cc 1.1 KB

123456789101112131415161718192021222324252627
  1. // Copyright 2019 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #include "components/offline_pages/core/offline_page_item_utils.h"
  5. #include "testing/gtest/include/gtest/gtest.h"
  6. #include "url/gurl.h"
  7. namespace offline_pages {
  8. namespace {
  9. TEST(OfflinePageItemUtils, EqualsIgnoringFragment) {
  10. EXPECT_TRUE(EqualsIgnoringFragment(GURL("http://example.com/"),
  11. GURL("http://example.com/")));
  12. EXPECT_TRUE(EqualsIgnoringFragment(GURL("http://example.com/"),
  13. GURL("http://example.com/#test")));
  14. EXPECT_TRUE(EqualsIgnoringFragment(GURL("http://example.com/#test"),
  15. GURL("http://example.com/")));
  16. EXPECT_TRUE(EqualsIgnoringFragment(GURL("http://example.com/#test"),
  17. GURL("http://example.com/#test2")));
  18. EXPECT_FALSE(EqualsIgnoringFragment(GURL("http://example.com/"),
  19. GURL("http://test.com/#test")));
  20. }
  21. } // namespace
  22. } // namespace offline_pages