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

Side by Side Diff: chrome/browser/android/offline_pages/offline_page_utils_unittest.cc

Issue 2542503002: [Offline pages] Fixing OfflinePageUtis::EqualsIgnoringFragment (Closed)
Patch Set: Created 4 years 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 unified diff | Download patch
OLDNEW
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698