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

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

Issue 15984016: Call scoped_refptr<T>::get() rather than relying on implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 7 years, 6 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/history/history_service.cc ('k') | chrome/browser/history/top_sites_backend.cc » ('j') | 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "base/files/scoped_temp_dir.h" 5 #include "base/files/scoped_temp_dir.h"
6 #include "base/message_loop.h" 6 #include "base/message_loop.h"
7 #include "base/path_service.h" 7 #include "base/path_service.h"
8 #include "base/strings/stringprintf.h" 8 #include "base/strings/stringprintf.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "base/time.h" 10 #include "base/time.h"
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 void ShortcutsBackendTest::OnShortcutsLoaded() { 67 void ShortcutsBackendTest::OnShortcutsLoaded() {
68 load_notified_ = true; 68 load_notified_ = true;
69 base::MessageLoop::current()->Quit(); 69 base::MessageLoop::current()->Quit();
70 } 70 }
71 71
72 void ShortcutsBackendTest::OnShortcutsChanged() { 72 void ShortcutsBackendTest::OnShortcutsChanged() {
73 changed_notified_ = true; 73 changed_notified_ = true;
74 } 74 }
75 75
76 void ShortcutsBackendTest::InitBackend() { 76 void ShortcutsBackendTest::InitBackend() {
77 ShortcutsBackend* backend = ShortcutsBackendFactory::GetForProfile(&profile_); 77 ShortcutsBackend* backend =
78 ShortcutsBackendFactory::GetForProfile(&profile_).get();
78 ASSERT_TRUE(backend); 79 ASSERT_TRUE(backend);
79 ASSERT_FALSE(load_notified_); 80 ASSERT_FALSE(load_notified_);
80 ASSERT_FALSE(backend_->initialized()); 81 ASSERT_FALSE(backend_->initialized());
81 base::MessageLoop::current()->Run(); 82 base::MessageLoop::current()->Run();
82 EXPECT_TRUE(load_notified_); 83 EXPECT_TRUE(load_notified_);
83 EXPECT_TRUE(backend_->initialized()); 84 EXPECT_TRUE(backend_->initialized());
84 } 85 }
85 86
86 TEST_F(ShortcutsBackendTest, AddAndUpdateShortcut) { 87 TEST_F(ShortcutsBackendTest, AddAndUpdateShortcut) {
87 InitBackend(); 88 InitBackend();
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 std::vector<std::string> deleted_ids; 166 std::vector<std::string> deleted_ids;
166 deleted_ids.push_back(shortcut3.id); 167 deleted_ids.push_back(shortcut3.id);
167 deleted_ids.push_back(shortcut4.id); 168 deleted_ids.push_back(shortcut4.id);
168 169
169 EXPECT_TRUE(backend_->DeleteShortcutsWithIds(deleted_ids)); 170 EXPECT_TRUE(backend_->DeleteShortcutsWithIds(deleted_ids));
170 171
171 ASSERT_EQ(0U, shortcuts.size()); 172 ASSERT_EQ(0U, shortcuts.size());
172 } 173 }
173 174
174 } // namespace history 175 } // namespace history
OLDNEW
« no previous file with comments | « chrome/browser/history/history_service.cc ('k') | chrome/browser/history/top_sites_backend.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698