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

Side by Side Diff: chrome/browser/bookmarks/recently_used_folders_combo_model_unittest.cc

Issue 10821097: Removing instances of profile_->GetBookmarkModel() as part of converting BookmarkModel to a PKS. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 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
« no previous file with comments | « chrome/browser/bookmarks/bookmark_utils.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "chrome/browser/bookmarks/recently_used_folders_combo_model.h" 5 #include "chrome/browser/bookmarks/recently_used_folders_combo_model.h"
6 6
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "base/utf_string_conversions.h" 8 #include "base/utf_string_conversions.h"
9 #include "chrome/browser/bookmarks/bookmark_model_factory.h"
9 #include "chrome/test/base/testing_profile.h" 10 #include "chrome/test/base/testing_profile.h"
10 #include "content/public/test/test_browser_thread.h" 11 #include "content/public/test/test_browser_thread.h"
11 #include "testing/gtest/include/gtest/gtest.h" 12 #include "testing/gtest/include/gtest/gtest.h"
12 13
13 using content::BrowserThread; 14 using content::BrowserThread;
14 15
15 class RecentlyUsedFoldersComboModelTest : public testing::Test { 16 class RecentlyUsedFoldersComboModelTest : public testing::Test {
16 public: 17 public:
17 RecentlyUsedFoldersComboModelTest(); 18 RecentlyUsedFoldersComboModelTest();
18 19
(...skipping 22 matching lines...) Expand all
41 profile_->BlockUntilBookmarkModelLoaded(); 42 profile_->BlockUntilBookmarkModelLoaded();
42 } 43 }
43 44
44 void RecentlyUsedFoldersComboModelTest::TearDown() { 45 void RecentlyUsedFoldersComboModelTest::TearDown() {
45 // Flush the message loop to make application verifiers happy. 46 // Flush the message loop to make application verifiers happy.
46 message_loop_.RunAllPending(); 47 message_loop_.RunAllPending();
47 } 48 }
48 49
49 // Verifies there are no duplicate nodes in the model. 50 // Verifies there are no duplicate nodes in the model.
50 TEST_F(RecentlyUsedFoldersComboModelTest, NoDups) { 51 TEST_F(RecentlyUsedFoldersComboModelTest, NoDups) {
51 BookmarkModel* bookmark_model = profile_->GetBookmarkModel(); 52 BookmarkModel* bookmark_model =
53 BookmarkModelFactory::GetForProfile(profile_.get());
52 const BookmarkNode* new_node = bookmark_model->AddURL( 54 const BookmarkNode* new_node = bookmark_model->AddURL(
53 bookmark_model->bookmark_bar_node(), 0, ASCIIToUTF16("a"), 55 bookmark_model->bookmark_bar_node(), 0, ASCIIToUTF16("a"),
54 GURL("http://a")); 56 GURL("http://a"));
55 RecentlyUsedFoldersComboModel model(bookmark_model, new_node); 57 RecentlyUsedFoldersComboModel model(bookmark_model, new_node);
56 std::set<const BookmarkNode*> nodes; 58 std::set<const BookmarkNode*> nodes;
57 for (int i = 0; i < model.GetItemCount(); ++i) { 59 for (int i = 0; i < model.GetItemCount(); ++i) {
58 const BookmarkNode* node = model.GetNodeAt(i); 60 const BookmarkNode* node = model.GetNodeAt(i);
59 EXPECT_EQ(0u, nodes.count(node)); 61 EXPECT_EQ(0u, nodes.count(node));
60 nodes.insert(node); 62 nodes.insert(node);
61 } 63 }
62 } 64 }
OLDNEW
« no previous file with comments | « chrome/browser/bookmarks/bookmark_utils.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698