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

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, 1 month 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 968 matching lines...) Expand 10 before | Expand all | Expand 10 after
1128 ASSERT_TRUE(backend_->GetFaviconFromDB(url, TOUCH_ICON, &favicon)); 1128 ASSERT_TRUE(backend_->GetFaviconFromDB(url, TOUCH_ICON, &favicon));
1129 std::string touchicon_data( 1129 std::string touchicon_data(
1130 favicon.image_data->front(), 1130 favicon.image_data->front(),
1131 favicon.image_data->front() + favicon.image_data->size()); 1131 favicon.image_data->front() + favicon.image_data->size());
1132 1132
1133 EXPECT_EQ(TOUCH_ICON, favicon.icon_type); 1133 EXPECT_EQ(TOUCH_ICON, favicon.icon_type);
1134 EXPECT_EQ(icon_url, favicon.icon_url); 1134 EXPECT_EQ(icon_url, favicon.icon_url);
1135 EXPECT_EQ(blob_data, touchicon_data); 1135 EXPECT_EQ(blob_data, touchicon_data);
1136 } 1136 }
1137 } // namespace history 1137 } // namespace history
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698