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

Side by Side Diff: chrome/browser/history/history_querying_unittest.cc

Issue 322983003: Rename HistoryService::NotifyRenderProcessHostDestruction (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comments Created 6 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 unified diff | Download patch
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 "base/basictypes.h" 5 #include "base/basictypes.h"
6 #include "base/bind.h" 6 #include "base/bind.h"
7 #include "base/bind_helpers.h" 7 #include "base/bind_helpers.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/files/scoped_temp_dir.h" 10 #include "base/files/scoped_temp_dir.h"
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 } 140 }
141 141
142 protected: 142 protected:
143 scoped_ptr<HistoryService> history_; 143 scoped_ptr<HistoryService> history_;
144 144
145 // Counter used to generate a unique ID for each page added to the history. 145 // Counter used to generate a unique ID for each page added to the history.
146 int32 page_id_; 146 int32 page_id_;
147 147
148 void AddEntryToHistory(const TestEntry& entry) { 148 void AddEntryToHistory(const TestEntry& entry) {
149 // We need the ID scope and page ID so that the visit tracker can find it. 149 // We need the ID scope and page ID so that the visit tracker can find it.
150 const void* id_scope = reinterpret_cast<void*>(1); 150 ContextID context_id = reinterpret_cast<ContextID>(1);
151 GURL url(entry.url); 151 GURL url(entry.url);
152 152
153 history_->AddPage(url, entry.time, id_scope, page_id_++, GURL(), 153 history_->AddPage(url, entry.time, context_id, page_id_++, GURL(),
154 history::RedirectList(), content::PAGE_TRANSITION_LINK, 154 history::RedirectList(), content::PAGE_TRANSITION_LINK,
155 history::SOURCE_BROWSED, false); 155 history::SOURCE_BROWSED, false);
156 history_->SetPageTitle(url, base::UTF8ToUTF16(entry.title)); 156 history_->SetPageTitle(url, base::UTF8ToUTF16(entry.title));
157 } 157 }
158 158
159 private: 159 private:
160 virtual void SetUp() { 160 virtual void SetUp() {
161 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); 161 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
162 history_dir_ = temp_dir_.path().AppendASCII("HistoryTest"); 162 history_dir_ = temp_dir_.path().AppendASCII("HistoryTest");
163 ASSERT_TRUE(base::CreateDirectory(history_dir_)); 163 ASSERT_TRUE(base::CreateDirectory(history_dir_));
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
419 419
420 TEST_F(HistoryQueryTest, TextSearchPaging) { 420 TEST_F(HistoryQueryTest, TextSearchPaging) {
421 // Since results are fetched 1 and 2 at a time, entry #0 and #6 will not 421 // Since results are fetched 1 and 2 at a time, entry #0 and #6 will not
422 // be de-duplicated. Entry #4 does not contain the text "title", so it 422 // be de-duplicated. Entry #4 does not contain the text "title", so it
423 // shouldn't appear. 423 // shouldn't appear.
424 int expected_results[] = { 2, 3, 1, 7, 6, 5 }; 424 int expected_results[] = { 2, 3, 1, 7, 6, 5 };
425 TestPaging("title", expected_results, arraysize(expected_results)); 425 TestPaging("title", expected_results, arraysize(expected_results));
426 } 426 }
427 427
428 } // namespace history 428 } // namespace history
OLDNEW
« no previous file with comments | « chrome/browser/history/history_backend_unittest.cc ('k') | chrome/browser/history/history_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698