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

Unified Diff: components/offline_pages/offline_page_model_impl_unittest.cc

Issue 2083653008: Temporarily remove "last_n" from availability searches. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: gNit. Created 4 years, 6 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/offline_pages/offline_page_model_impl.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/offline_pages/offline_page_model_impl_unittest.cc
diff --git a/components/offline_pages/offline_page_model_impl_unittest.cc b/components/offline_pages/offline_page_model_impl_unittest.cc
index 184858c9bb7941ad440b7ce31b0edcc36bdbdb5d..609598e388e5af98595f202acea6e2469e76ea32 100644
--- a/components/offline_pages/offline_page_model_impl_unittest.cc
+++ b/components/offline_pages/offline_page_model_impl_unittest.cc
@@ -20,6 +20,7 @@
#include "base/test/test_mock_time_task_runner.h"
#include "base/threading/thread_task_runner_handle.h"
#include "base/time/time.h"
+#include "components/offline_pages/client_namespace_constants.h"
#include "components/offline_pages/client_policy_controller.h"
#include "components/offline_pages/offline_page_client_policy.h"
#include "components/offline_pages/offline_page_feature.h"
@@ -38,6 +39,7 @@ const char kTestClientNamespace[] = "CLIENT_NAMESPACE";
const GURL kTestUrl("http://example.com");
const GURL kTestUrl2("http://other.page.com");
const GURL kTestUrl3("http://test.xyz");
+const GURL kTestUrl4("http://page.net");
const GURL kFileUrl("file:///foo");
const ClientId kTestClientId1(kTestClientNamespace, "1234");
const ClientId kTestClientId2(kTestClientNamespace, "5678");
@@ -888,16 +890,23 @@ TEST_F(OfflinePageModelImplTest, CheckPagesExistOffline) {
SavePage(kTestUrl, kTestClientId1);
SavePage(kTestUrl2, kTestClientId2);
+ // TODO(dewittj): Remove the "Last N" restriction in favor of a better query
+ // interface. See https://crbug.com/622763 for information.
+ const ClientId last_n_client_id(kLastNNamespace, "1234");
+ SavePage(kTestUrl3, last_n_client_id);
+
std::set<GURL> input;
input.insert(kTestUrl);
input.insert(kTestUrl2);
input.insert(kTestUrl3);
+ input.insert(kTestUrl4);
CheckPagesExistOfflineResult existing_pages = CheckPagesExistOffline(input);
EXPECT_EQ(2U, existing_pages.size());
EXPECT_NE(existing_pages.end(), existing_pages.find(kTestUrl));
EXPECT_NE(existing_pages.end(), existing_pages.find(kTestUrl2));
EXPECT_EQ(existing_pages.end(), existing_pages.find(kTestUrl3));
+ EXPECT_EQ(existing_pages.end(), existing_pages.find(kTestUrl4));
}
TEST_F(OfflinePageModelImplTest, CanSaveURL) {
« no previous file with comments | « components/offline_pages/offline_page_model_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698