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

Side by Side Diff: components/history/core/browser/history_backend_unittest.cc

Issue 1722493002: Project Eraser: Kill chrome://memory. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix chrome_browser_ui.gypi. Created 4 years, 9 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 unified diff | Download patch
« no previous file with comments | « chrome/common/url_constants.cc ('k') | content/browser/child_process_security_policy_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "components/history/core/browser/history_backend.h" 5 #include "components/history/core/browser/history_backend.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <set> 10 #include <set>
(...skipping 3086 matching lines...) Expand 10 before | Expand all | Expand 10 after
3097 3097
3098 TEST_F(HistoryBackendTest, TopHosts_IgnoreUnusualURLs) { 3098 TEST_F(HistoryBackendTest, TopHosts_IgnoreUnusualURLs) {
3099 std::vector<GURL> urls; 3099 std::vector<GURL> urls;
3100 urls.push_back(GURL("http://cnn.com/us")); 3100 urls.push_back(GURL("http://cnn.com/us"));
3101 urls.push_back(GURL("ftp://cnn.com/intl")); 3101 urls.push_back(GURL("ftp://cnn.com/intl"));
3102 urls.push_back(GURL("https://cnn.com/sports")); 3102 urls.push_back(GURL("https://cnn.com/sports"));
3103 urls.push_back( 3103 urls.push_back(
3104 GURL("chrome-extension://nghiiepjnjgjeolabmjjceablnkpkjde/options.html")); 3104 GURL("chrome-extension://nghiiepjnjgjeolabmjjceablnkpkjde/options.html"));
3105 urls.push_back(GURL("file:///home/foobar/tmp/baz.html")); 3105 urls.push_back(GURL("file:///home/foobar/tmp/baz.html"));
3106 urls.push_back(GURL("data:text/plain,Hello%20world%21")); 3106 urls.push_back(GURL("data:text/plain,Hello%20world%21"));
3107 urls.push_back(GURL("chrome://memory")); 3107 urls.push_back(GURL("chrome://version"));
3108 urls.push_back(GURL("about:mammon")); 3108 urls.push_back(GURL("about:mammon"));
3109 for (const GURL& url : urls) { 3109 for (const GURL& url : urls) {
3110 backend_->AddPageVisit(url, base::Time::Now(), 0, ui::PAGE_TRANSITION_LINK, 3110 backend_->AddPageVisit(url, base::Time::Now(), 0, ui::PAGE_TRANSITION_LINK,
3111 history::SOURCE_BROWSED); 3111 history::SOURCE_BROWSED);
3112 } 3112 }
3113 3113
3114 EXPECT_THAT(backend_->TopHosts(5), ElementsAre(std::make_pair("cnn.com", 3))); 3114 EXPECT_THAT(backend_->TopHosts(5), ElementsAre(std::make_pair("cnn.com", 3)));
3115 } 3115 }
3116 3116
3117 TEST_F(HistoryBackendTest, HostRankIfAvailable) { 3117 TEST_F(HistoryBackendTest, HostRankIfAvailable) {
(...skipping 620 matching lines...) Expand 10 before | Expand all | Expand 10 after
3738 // Verify that the second term is no longer returned as result, and also check 3738 // Verify that the second term is no longer returned as result, and also check
3739 // at the low level that it is gone for good. The term corresponding to the 3739 // at the low level that it is gone for good. The term corresponding to the
3740 // first URLRow should not be affected. 3740 // first URLRow should not be affected.
3741 EXPECT_EQ(1u, GetNumberOfMatchingSearchTerms(kTestKeywordId, term1)); 3741 EXPECT_EQ(1u, GetNumberOfMatchingSearchTerms(kTestKeywordId, term1));
3742 EXPECT_EQ(0u, GetNumberOfMatchingSearchTerms(kTestKeywordId, term2)); 3742 EXPECT_EQ(0u, GetNumberOfMatchingSearchTerms(kTestKeywordId, term2));
3743 EXPECT_TRUE(mem_backend_->db()->GetKeywordSearchTermRow(row1.id(), NULL)); 3743 EXPECT_TRUE(mem_backend_->db()->GetKeywordSearchTermRow(row1.id(), NULL));
3744 EXPECT_FALSE(mem_backend_->db()->GetKeywordSearchTermRow(row2.id(), NULL)); 3744 EXPECT_FALSE(mem_backend_->db()->GetKeywordSearchTermRow(row2.id(), NULL));
3745 } 3745 }
3746 3746
3747 } // namespace history 3747 } // namespace history
OLDNEW
« no previous file with comments | « chrome/common/url_constants.cc ('k') | content/browser/child_process_security_policy_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698