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

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

Issue 7465041: GTTF: Use a fresh TestingBrowserProcess for each test, part #4 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: update Created 9 years, 4 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 | 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/history/history_backend.h" 17 #include "chrome/browser/history/history_backend.h"
18 #include "chrome/browser/history/history_notifications.h" 18 #include "chrome/browser/history/history_notifications.h"
19 #include "chrome/browser/history/in_memory_database.h" 19 #include "chrome/browser/history/in_memory_database.h"
20 #include "chrome/browser/history/in_memory_history_backend.h" 20 #include "chrome/browser/history/in_memory_history_backend.h"
21 #include "chrome/common/chrome_constants.h" 21 #include "chrome/common/chrome_constants.h"
22 #include "chrome/common/chrome_paths.h" 22 #include "chrome/common/chrome_paths.h"
23 #include "chrome/common/thumbnail_score.h" 23 #include "chrome/common/thumbnail_score.h"
24 #include "chrome/test/testing_browser_process_test.h"
24 #include "chrome/tools/profiles/thumbnail-inl.h" 25 #include "chrome/tools/profiles/thumbnail-inl.h"
25 #include "content/common/notification_details.h" 26 #include "content/common/notification_details.h"
26 #include "content/common/notification_source.h" 27 #include "content/common/notification_source.h"
27 #include "googleurl/src/gurl.h" 28 #include "googleurl/src/gurl.h"
28 #include "testing/gtest/include/gtest/gtest.h" 29 #include "testing/gtest/include/gtest/gtest.h"
29 #include "ui/gfx/codec/jpeg_codec.h" 30 #include "ui/gfx/codec/jpeg_codec.h"
30 #include "ui/gfx/image/image.h" 31 #include "ui/gfx/image/image.h"
31 32
32 using base::Time; 33 using base::Time;
33 34
(...skipping 27 matching lines...) Expand all
61 virtual void DBLoaded() OVERRIDE; 62 virtual void DBLoaded() OVERRIDE;
62 virtual void StartTopSitesMigration() OVERRIDE; 63 virtual void StartTopSitesMigration() OVERRIDE;
63 64
64 private: 65 private:
65 // Not owned by us. 66 // Not owned by us.
66 HistoryBackendTest* test_; 67 HistoryBackendTest* test_;
67 68
68 DISALLOW_COPY_AND_ASSIGN(HistoryBackendTestDelegate); 69 DISALLOW_COPY_AND_ASSIGN(HistoryBackendTestDelegate);
69 }; 70 };
70 71
71 class HistoryBackendTest : public testing::Test { 72 class HistoryBackendTest : public TestingBrowserProcessTest {
72 public: 73 public:
73 HistoryBackendTest() : bookmark_model_(NULL), loaded_(false) {} 74 HistoryBackendTest() : bookmark_model_(NULL), loaded_(false) {}
74 virtual ~HistoryBackendTest() { 75 virtual ~HistoryBackendTest() {
75 } 76 }
76 77
77 protected: 78 protected:
78 scoped_refptr<HistoryBackend> backend_; // Will be NULL on init failure. 79 scoped_refptr<HistoryBackend> backend_; // Will be NULL on init failure.
79 scoped_ptr<InMemoryHistoryBackend> mem_backend_; 80 scoped_ptr<InMemoryHistoryBackend> mem_backend_;
80 81
81 void AddRedirectChain(const char* sequence[], int page_id) { 82 void AddRedirectChain(const char* sequence[], int page_id) {
(...skipping 898 matching lines...) Expand 10 before | Expand all | Expand 10 after
980 url, icon_id, FAVICON, &replaced)); 981 url, icon_id, FAVICON, &replaced));
981 EXPECT_EQ(0, replaced); 982 EXPECT_EQ(0, replaced);
982 983
983 std::vector<IconMapping> icon_mapping; 984 std::vector<IconMapping> icon_mapping;
984 EXPECT_TRUE(backend_->thumbnail_db_->GetIconMappingsForPageURL( 985 EXPECT_TRUE(backend_->thumbnail_db_->GetIconMappingsForPageURL(
985 url, &icon_mapping)); 986 url, &icon_mapping));
986 EXPECT_EQ(1u, icon_mapping.size()); 987 EXPECT_EQ(1u, icon_mapping.size());
987 } 988 }
988 989
989 } // namespace history 990 } // namespace history
OLDNEW
« no previous file with comments | « chrome/browser/history/expire_history_backend_unittest.cc ('k') | chrome/browser/history/history_querying_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698