OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/bookmarks/managed/managed_bookmark_service.h" | 5 #include "components/bookmarks/managed/managed_bookmark_service.h" |
6 | 6 |
7 #include "base/macros.h" | 7 #include "base/macros.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
11 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 11 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
12 #include "chrome/browser/bookmarks/chrome_bookmark_client.h" | 12 #include "chrome/browser/bookmarks/chrome_bookmark_client.h" |
13 #include "chrome/browser/bookmarks/managed_bookmark_service_factory.h" | 13 #include "chrome/browser/bookmarks/managed_bookmark_service_factory.h" |
14 #include "chrome/test/base/testing_pref_service_syncable.h" | |
15 #include "chrome/test/base/testing_profile.h" | 14 #include "chrome/test/base/testing_profile.h" |
16 #include "components/bookmarks/browser/bookmark_model.h" | 15 #include "components/bookmarks/browser/bookmark_model.h" |
17 #include "components/bookmarks/browser/bookmark_node.h" | 16 #include "components/bookmarks/browser/bookmark_node.h" |
18 #include "components/bookmarks/browser/bookmark_utils.h" | 17 #include "components/bookmarks/browser/bookmark_utils.h" |
19 #include "components/bookmarks/common/bookmark_pref_names.h" | 18 #include "components/bookmarks/common/bookmark_pref_names.h" |
20 #include "components/bookmarks/test/bookmark_test_helpers.h" | 19 #include "components/bookmarks/test/bookmark_test_helpers.h" |
21 #include "components/bookmarks/test/mock_bookmark_model_observer.h" | 20 #include "components/bookmarks/test/mock_bookmark_model_observer.h" |
| 21 #include "components/syncable_prefs/testing_pref_service_syncable.h" |
22 #include "content/public/test/test_browser_thread_bundle.h" | 22 #include "content/public/test/test_browser_thread_bundle.h" |
23 #include "grit/components_strings.h" | 23 #include "grit/components_strings.h" |
24 #include "testing/gmock/include/gmock/gmock.h" | 24 #include "testing/gmock/include/gmock/gmock.h" |
25 #include "testing/gtest/include/gtest/gtest.h" | 25 #include "testing/gtest/include/gtest/gtest.h" |
26 #include "ui/base/l10n/l10n_util.h" | 26 #include "ui/base/l10n/l10n_util.h" |
27 | 27 |
28 using bookmarks::BookmarkModel; | 28 using bookmarks::BookmarkModel; |
29 using bookmarks::BookmarkNode; | 29 using bookmarks::BookmarkNode; |
30 using bookmarks::ManagedBookmarkService; | 30 using bookmarks::ManagedBookmarkService; |
31 using testing::Mock; | 31 using testing::Mock; |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 const BookmarkNode* managed_node = managed_->managed_node()->GetChild(0); | 285 const BookmarkNode* managed_node = managed_->managed_node()->GetChild(0); |
286 ASSERT_TRUE(managed_node); | 286 ASSERT_TRUE(managed_node); |
287 | 287 |
288 std::vector<const BookmarkNode*> nodes; | 288 std::vector<const BookmarkNode*> nodes; |
289 EXPECT_FALSE(bookmarks::HasDescendantsOf(nodes, managed_->managed_node())); | 289 EXPECT_FALSE(bookmarks::HasDescendantsOf(nodes, managed_->managed_node())); |
290 nodes.push_back(user_node); | 290 nodes.push_back(user_node); |
291 EXPECT_FALSE(bookmarks::HasDescendantsOf(nodes, managed_->managed_node())); | 291 EXPECT_FALSE(bookmarks::HasDescendantsOf(nodes, managed_->managed_node())); |
292 nodes.push_back(managed_node); | 292 nodes.push_back(managed_node); |
293 EXPECT_TRUE(bookmarks::HasDescendantsOf(nodes, managed_->managed_node())); | 293 EXPECT_TRUE(bookmarks::HasDescendantsOf(nodes, managed_->managed_node())); |
294 } | 294 } |
OLD | NEW |