| 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 "components/omnibox/browser/shortcuts_backend.h" | 5 #include "components/omnibox/browser/shortcuts_backend.h" |
| 6 | 6 |
| 7 #include "base/files/scoped_temp_dir.h" | 7 #include "base/files/scoped_temp_dir.h" |
| 8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
| 9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 search_test_utils::WaitForTemplateURLServiceToLoad(template_url_service); | 129 search_test_utils::WaitForTemplateURLServiceToLoad(template_url_service); |
| 130 } | 130 } |
| 131 | 131 |
| 132 void ShortcutsBackendTest::TearDown() { | 132 void ShortcutsBackendTest::TearDown() { |
| 133 backend_->RemoveObserver(this); | 133 backend_->RemoveObserver(this); |
| 134 db_thread_.Stop(); | 134 db_thread_.Stop(); |
| 135 } | 135 } |
| 136 | 136 |
| 137 void ShortcutsBackendTest::OnShortcutsLoaded() { | 137 void ShortcutsBackendTest::OnShortcutsLoaded() { |
| 138 load_notified_ = true; | 138 load_notified_ = true; |
| 139 base::MessageLoop::current()->Quit(); | 139 base::MessageLoop::current()->QuitWhenIdle(); |
| 140 } | 140 } |
| 141 | 141 |
| 142 void ShortcutsBackendTest::OnShortcutsChanged() { | 142 void ShortcutsBackendTest::OnShortcutsChanged() { |
| 143 changed_notified_ = true; | 143 changed_notified_ = true; |
| 144 } | 144 } |
| 145 | 145 |
| 146 void ShortcutsBackendTest::InitBackend() { | 146 void ShortcutsBackendTest::InitBackend() { |
| 147 ShortcutsBackend* backend = | 147 ShortcutsBackend* backend = |
| 148 ShortcutsBackendFactory::GetForProfile(&profile_).get(); | 148 ShortcutsBackendFactory::GetForProfile(&profile_).get(); |
| 149 ASSERT_TRUE(backend); | 149 ASSERT_TRUE(backend); |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 316 ASSERT_TRUE(shortcut4_iter != shortcuts_map().end()); | 316 ASSERT_TRUE(shortcut4_iter != shortcuts_map().end()); |
| 317 EXPECT_EQ(shortcut4.id, shortcut4_iter->second.id); | 317 EXPECT_EQ(shortcut4.id, shortcut4_iter->second.id); |
| 318 | 318 |
| 319 ShortcutsDatabase::ShortcutIDs deleted_ids; | 319 ShortcutsDatabase::ShortcutIDs deleted_ids; |
| 320 deleted_ids.push_back(shortcut3.id); | 320 deleted_ids.push_back(shortcut3.id); |
| 321 deleted_ids.push_back(shortcut4.id); | 321 deleted_ids.push_back(shortcut4.id); |
| 322 EXPECT_TRUE(DeleteShortcutsWithIDs(deleted_ids)); | 322 EXPECT_TRUE(DeleteShortcutsWithIDs(deleted_ids)); |
| 323 | 323 |
| 324 ASSERT_EQ(0U, shortcuts_map().size()); | 324 ASSERT_EQ(0U, shortcuts_map().size()); |
| 325 } | 325 } |
| OLD | NEW |