| 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/enhanced_bookmarks/enhanced_bookmark_model.h" | 5 #include "components/enhanced_bookmarks/enhanced_bookmark_model.h" |
| 6 | 6 |
| 7 #include "base/base64.h" | 7 #include "base/base64.h" |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| 11 #include "base/run_loop.h" | 11 #include "base/run_loop.h" |
| 12 #include "base/strings/string_number_conversions.h" | 12 #include "base/strings/string_number_conversions.h" |
| 13 #include "base/strings/string_util.h" | 13 #include "base/strings/string_util.h" |
| 14 #include "base/strings/utf_string_conversions.h" | 14 #include "base/strings/utf_string_conversions.h" |
| 15 #include "components/bookmarks/browser/bookmark_model.h" | 15 #include "components/bookmarks/browser/bookmark_model.h" |
| 16 #include "components/bookmarks/browser/bookmark_node.h" | 16 #include "components/bookmarks/browser/bookmark_node.h" |
| 17 #include "components/bookmarks/test/test_bookmark_client.h" | 17 #include "components/bookmarks/test/test_bookmark_client.h" |
| 18 #include "components/enhanced_bookmarks/enhanced_bookmark_model_observer.h" | 18 #include "components/enhanced_bookmarks/enhanced_bookmark_model_observer.h" |
| 19 #include "components/enhanced_bookmarks/proto/metadata.pb.h" | 19 #include "components/enhanced_bookmarks/proto/metadata.pb.h" |
| 20 #include "testing/gtest/include/gtest/gtest.h" | 20 #include "testing/gtest/include/gtest/gtest.h" |
| 21 #include "url/gurl.h" | 21 #include "url/gurl.h" |
| 22 | 22 |
| 23 using bookmarks::BookmarkModel; | 23 using bookmarks::BookmarkModel; |
| 24 using bookmarks::BookmarkNode; |
| 24 using enhanced_bookmarks::EnhancedBookmarkModel; | 25 using enhanced_bookmarks::EnhancedBookmarkModel; |
| 25 | 26 |
| 26 namespace { | 27 namespace { |
| 27 const std::string BOOKMARK_URL("http://example.com/index.html"); | 28 const std::string BOOKMARK_URL("http://example.com/index.html"); |
| 28 } // namespace | 29 } // namespace |
| 29 | 30 |
| 30 class EnhancedBookmarkModelTest | 31 class EnhancedBookmarkModelTest |
| 31 : public testing::Test, | 32 : public testing::Test, |
| 32 public enhanced_bookmarks::EnhancedBookmarkModelObserver { | 33 public enhanced_bookmarks::EnhancedBookmarkModelObserver { |
| 33 public: | 34 public: |
| (...skipping 732 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 766 const BookmarkNode* gp = parent->parent(); | 767 const BookmarkNode* gp = parent->parent(); |
| 767 bookmark_model_->Remove(gp, gp->GetIndexOf(parent)); | 768 bookmark_model_->Remove(gp, gp->GetIndexOf(parent)); |
| 768 EXPECT_FALSE(model_->BookmarkForRemoteId(remote_id)); | 769 EXPECT_FALSE(model_->BookmarkForRemoteId(remote_id)); |
| 769 } | 770 } |
| 770 | 771 |
| 771 TEST_F(EnhancedBookmarkModelTest, AddsRemoteIdToNonClonedKeys) { | 772 TEST_F(EnhancedBookmarkModelTest, AddsRemoteIdToNonClonedKeys) { |
| 772 const std::set<std::string>& non_cloned_keys = | 773 const std::set<std::string>& non_cloned_keys = |
| 773 bookmark_model_->non_cloned_keys(); | 774 bookmark_model_->non_cloned_keys(); |
| 774 EXPECT_TRUE(non_cloned_keys.find("stars.id") != non_cloned_keys.end()); | 775 EXPECT_TRUE(non_cloned_keys.find("stars.id") != non_cloned_keys.end()); |
| 775 } | 776 } |
| OLD | NEW |