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

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

Issue 253753005: Move bookmarks' production code to components/bookmarks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@367656
Patch Set: Fix compilation for win_chromium_x64_rel Created 6 years, 7 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
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 "chrome/browser/history/history_backend.h" 5 #include "chrome/browser/history/history_backend.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <set> 8 #include <set>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/basictypes.h" 11 #include "base/basictypes.h"
12 #include "base/bind.h" 12 #include "base/bind.h"
13 #include "base/command_line.h" 13 #include "base/command_line.h"
14 #include "base/file_util.h" 14 #include "base/file_util.h"
15 #include "base/files/file_path.h" 15 #include "base/files/file_path.h"
16 #include "base/memory/ref_counted.h" 16 #include "base/memory/ref_counted.h"
17 #include "base/memory/scoped_ptr.h" 17 #include "base/memory/scoped_ptr.h"
18 #include "base/path_service.h" 18 #include "base/path_service.h"
19 #include "base/run_loop.h" 19 #include "base/run_loop.h"
20 #include "base/strings/string16.h" 20 #include "base/strings/string16.h"
21 #include "base/strings/string_number_conversions.h" 21 #include "base/strings/string_number_conversions.h"
22 #include "base/strings/utf_string_conversions.h" 22 #include "base/strings/utf_string_conversions.h"
23 #include "chrome/browser/bookmarks/bookmark_model.h"
24 #include "chrome/browser/bookmarks/bookmark_model_factory.h" 23 #include "chrome/browser/bookmarks/bookmark_model_factory.h"
25 #include "chrome/browser/bookmarks/bookmark_test_helpers.h" 24 #include "chrome/browser/bookmarks/bookmark_test_helpers.h"
26 #include "chrome/browser/bookmarks/bookmark_utils.h"
27 #include "chrome/browser/bookmarks/test_bookmark_client.h" 25 #include "chrome/browser/bookmarks/test_bookmark_client.h"
28 #include "chrome/browser/chrome_notification_types.h" 26 #include "chrome/browser/chrome_notification_types.h"
29 #include "chrome/browser/history/history_notifications.h" 27 #include "chrome/browser/history/history_notifications.h"
30 #include "chrome/browser/history/history_service.h" 28 #include "chrome/browser/history/history_service.h"
31 #include "chrome/browser/history/history_service_factory.h" 29 #include "chrome/browser/history/history_service_factory.h"
32 #include "chrome/browser/history/in_memory_database.h" 30 #include "chrome/browser/history/in_memory_database.h"
33 #include "chrome/browser/history/in_memory_history_backend.h" 31 #include "chrome/browser/history/in_memory_history_backend.h"
34 #include "chrome/browser/history/visit_filter.h" 32 #include "chrome/browser/history/visit_filter.h"
35 #include "chrome/common/chrome_constants.h" 33 #include "chrome/common/chrome_constants.h"
36 #include "chrome/common/chrome_paths.h" 34 #include "chrome/common/chrome_paths.h"
37 #include "chrome/common/importer/imported_favicon_usage.h" 35 #include "chrome/common/importer/imported_favicon_usage.h"
38 #include "chrome/test/base/testing_profile.h" 36 #include "chrome/test/base/testing_profile.h"
37 #include "components/bookmarks/core/browser/bookmark_model.h"
38 #include "components/bookmarks/core/browser/bookmark_utils.h"
39 #include "content/public/browser/notification_details.h" 39 #include "content/public/browser/notification_details.h"
40 #include "content/public/browser/notification_source.h" 40 #include "content/public/browser/notification_source.h"
41 #include "content/public/test/test_browser_thread.h" 41 #include "content/public/test/test_browser_thread.h"
42 #include "testing/gtest/include/gtest/gtest.h" 42 #include "testing/gtest/include/gtest/gtest.h"
43 #include "url/gurl.h" 43 #include "url/gurl.h"
44 44
45 using base::Time; 45 using base::Time;
46 46
47 // This file only tests functionality where it is most convenient to call the 47 // This file only tests functionality where it is most convenient to call the
48 // backend directly. Most of the history backend functions are tested by the 48 // backend directly. Most of the history backend functions are tested by the
(...skipping 3335 matching lines...) Expand 10 before | Expand all | Expand 10 after
3384 // Verify that the second term is no longer returned as result, and also check 3384 // Verify that the second term is no longer returned as result, and also check
3385 // at the low level that it is gone for good. The term corresponding to the 3385 // at the low level that it is gone for good. The term corresponding to the
3386 // first URLRow should not be affected. 3386 // first URLRow should not be affected.
3387 EXPECT_EQ(1u, GetNumberOfMatchingSearchTerms(kTestKeywordId, term1)); 3387 EXPECT_EQ(1u, GetNumberOfMatchingSearchTerms(kTestKeywordId, term1));
3388 EXPECT_EQ(0u, GetNumberOfMatchingSearchTerms(kTestKeywordId, term2)); 3388 EXPECT_EQ(0u, GetNumberOfMatchingSearchTerms(kTestKeywordId, term2));
3389 EXPECT_TRUE(mem_backend_->db()->GetKeywordSearchTermRow(row1.id(), NULL)); 3389 EXPECT_TRUE(mem_backend_->db()->GetKeywordSearchTermRow(row1.id(), NULL));
3390 EXPECT_FALSE(mem_backend_->db()->GetKeywordSearchTermRow(row2.id(), NULL)); 3390 EXPECT_FALSE(mem_backend_->db()->GetKeywordSearchTermRow(row2.id(), NULL));
3391 } 3391 }
3392 3392
3393 } // namespace history 3393 } // namespace history
OLDNEW
« no previous file with comments | « chrome/browser/history/expire_history_backend_unittest.cc ('k') | chrome/browser/history/history_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698