OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |