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

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

Issue 8451009: HQP Refactoring (in Preparation for SQLite Cache) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 <set> 5 #include <set>
6 #include <vector> 6 #include <vector>
7 7
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/file_path.h" 9 #include "base/file_path.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
11 #include "base/memory/ref_counted.h" 11 #include "base/memory/ref_counted.h"
12 #include "base/memory/scoped_ptr.h" 12 #include "base/memory/scoped_ptr.h"
13 #include "base/path_service.h" 13 #include "base/path_service.h"
14 #include "base/string16.h" 14 #include "base/string16.h"
15 #include "base/utf_string_conversions.h" 15 #include "base/utf_string_conversions.h"
16 #include "chrome/browser/bookmarks/bookmark_model.h" 16 #include "chrome/browser/bookmarks/bookmark_model.h"
17 #include "chrome/browser/bookmarks/bookmark_utils.h" 17 #include "chrome/browser/bookmarks/bookmark_utils.h"
18 #include "chrome/browser/history/history_backend.h" 18 #include "chrome/browser/history/history_backend.h"
19 #include "chrome/browser/history/history_notifications.h" 19 #include "chrome/browser/history/history_notifications.h"
20 #include "chrome/browser/history/in_memory_database.h" 20 #include "chrome/browser/history/in_memory_database.h"
21 #include "chrome/browser/history/in_memory_history_backend.h" 21 #include "chrome/browser/history/in_memory_history_backend.h"
22 #include "chrome/browser/history/in_memory_url_index.h"
22 #include "chrome/common/chrome_constants.h" 23 #include "chrome/common/chrome_constants.h"
23 #include "chrome/common/chrome_paths.h" 24 #include "chrome/common/chrome_paths.h"
24 #include "chrome/common/thumbnail_score.h" 25 #include "chrome/common/thumbnail_score.h"
25 #include "chrome/tools/profiles/thumbnail-inl.h" 26 #include "chrome/tools/profiles/thumbnail-inl.h"
26 #include "content/public/browser/notification_details.h" 27 #include "content/public/browser/notification_details.h"
27 #include "content/public/browser/notification_source.h" 28 #include "content/public/browser/notification_source.h"
28 #include "googleurl/src/gurl.h" 29 #include "googleurl/src/gurl.h"
29 #include "testing/gtest/include/gtest/gtest.h" 30 #include "testing/gtest/include/gtest/gtest.h"
30 #include "ui/gfx/codec/jpeg_codec.h" 31 #include "ui/gfx/codec/jpeg_codec.h"
31 #include "ui/gfx/image/image.h" 32 #include "ui/gfx/image/image.h"
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 IconMapping icon_mapping; 140 IconMapping icon_mapping;
140 if (backend_->thumbnail_db_->GetIconMappingForPageURL(url, icon_type, 141 if (backend_->thumbnail_db_->GetIconMappingForPageURL(url, icon_type,
141 &icon_mapping)) 142 &icon_mapping))
142 return icon_mapping.icon_id; 143 return icon_mapping.icon_id;
143 else 144 else
144 return 0; 145 return 0;
145 } 146 }
146 147
147 BookmarkModel bookmark_model_; 148 BookmarkModel bookmark_model_;
148 149
149 protected:
150 bool loaded_; 150 bool loaded_;
151 151
152 private: 152 private:
153 friend class HistoryBackendTestDelegate; 153 friend class HistoryBackendTestDelegate;
154 154
155 // testing::Test 155 // testing::Test
156 virtual void SetUp() { 156 virtual void SetUp() {
157 if (!file_util::CreateNewTempDirectory(FILE_PATH_LITERAL("BackendTest"), 157 if (!file_util::CreateNewTempDirectory(FILE_PATH_LITERAL("BackendTest"),
158 &test_dir_)) 158 &test_dir_))
159 return; 159 return;
(...skipping 999 matching lines...) Expand 10 before | Expand all | Expand 10 after
1159 // Same-domain cloning should work. 1159 // Same-domain cloning should work.
1160 backend_->CloneFavicon(url, same_domain_url); 1160 backend_->CloneFavicon(url, same_domain_url);
1161 EXPECT_TRUE(backend_->GetFaviconFromDB(same_domain_url, FAVICON, &favicon)); 1161 EXPECT_TRUE(backend_->GetFaviconFromDB(same_domain_url, FAVICON, &favicon));
1162 1162
1163 // Foreign-domain cloning is forbidden. 1163 // Foreign-domain cloning is forbidden.
1164 backend_->CloneFavicon(url, foreign_domain_url); 1164 backend_->CloneFavicon(url, foreign_domain_url);
1165 EXPECT_FALSE(backend_->GetFaviconFromDB(foreign_domain_url, 1165 EXPECT_FALSE(backend_->GetFaviconFromDB(foreign_domain_url,
1166 FAVICON, &favicon)); 1166 FAVICON, &favicon));
1167 } 1167 }
1168 } // namespace history 1168 } // namespace history
OLDNEW
« no previous file with comments | « chrome/browser/history/history_backend.cc ('k') | chrome/browser/history/history_notifications.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698