| OLD | NEW |
| 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" | |
| 23 #include "chrome/common/chrome_constants.h" | 22 #include "chrome/common/chrome_constants.h" |
| 24 #include "chrome/common/chrome_paths.h" | 23 #include "chrome/common/chrome_paths.h" |
| 25 #include "chrome/common/thumbnail_score.h" | 24 #include "chrome/common/thumbnail_score.h" |
| 26 #include "chrome/tools/profiles/thumbnail-inl.h" | 25 #include "chrome/tools/profiles/thumbnail-inl.h" |
| 27 #include "content/public/browser/notification_details.h" | 26 #include "content/public/browser/notification_details.h" |
| 28 #include "content/public/browser/notification_source.h" | 27 #include "content/public/browser/notification_source.h" |
| 29 #include "googleurl/src/gurl.h" | 28 #include "googleurl/src/gurl.h" |
| 30 #include "testing/gtest/include/gtest/gtest.h" | 29 #include "testing/gtest/include/gtest/gtest.h" |
| 31 #include "ui/gfx/codec/jpeg_codec.h" | 30 #include "ui/gfx/codec/jpeg_codec.h" |
| 32 #include "ui/gfx/image/image.h" | 31 #include "ui/gfx/image/image.h" |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 IconMapping icon_mapping; | 139 IconMapping icon_mapping; |
| 141 if (backend_->thumbnail_db_->GetIconMappingForPageURL(url, icon_type, | 140 if (backend_->thumbnail_db_->GetIconMappingForPageURL(url, icon_type, |
| 142 &icon_mapping)) | 141 &icon_mapping)) |
| 143 return icon_mapping.icon_id; | 142 return icon_mapping.icon_id; |
| 144 else | 143 else |
| 145 return 0; | 144 return 0; |
| 146 } | 145 } |
| 147 | 146 |
| 148 BookmarkModel bookmark_model_; | 147 BookmarkModel bookmark_model_; |
| 149 | 148 |
| 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 Loading... |
| 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 |
| OLD | NEW |