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/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
11 #include "base/strings/utf_string_conversions.h" | 11 #include "base/strings/utf_string_conversions.h" |
12 #include "components/bookmarks/browser/bookmark_model.h" | 12 #include "components/bookmarks/browser/bookmark_model.h" |
13 #include "components/bookmarks/browser/bookmark_node.h" | 13 #include "components/bookmarks/browser/bookmark_node.h" |
14 #include "components/bookmarks/test/test_bookmark_client.h" | 14 #include "components/bookmarks/test/test_bookmark_client.h" |
15 #include "components/enhanced_bookmarks/proto/metadata.pb.h" | 15 #include "components/enhanced_bookmarks/proto/metadata.pb.h" |
16 #include "testing/gtest/include/gtest/gtest.h" | 16 #include "testing/gtest/include/gtest/gtest.h" |
17 #include "url/gurl.h" | 17 #include "url/gurl.h" |
18 | 18 |
19 namespace { | 19 namespace { |
20 | 20 |
21 const std::string BOOKMARK_URL("http://example.com/index.html"); | 21 const std::string BOOKMARK_URL("http://example.com/index.html"); |
22 | 22 |
23 class EnhancedBookmarkModelTest : public testing::Test { | 23 class EnhancedBookmarkModelTest : public testing::Test { |
24 public: | 24 public: |
25 EnhancedBookmarkModelTest() {} | 25 EnhancedBookmarkModelTest() {} |
26 virtual ~EnhancedBookmarkModelTest() {} | 26 virtual ~EnhancedBookmarkModelTest() {} |
27 | 27 |
28 virtual void SetUp() OVERRIDE { | 28 virtual void SetUp() OVERRIDE { |
29 test::TestBookmarkClient bookmark_client; | 29 bookmarks::TestBookmarkClient bookmark_client; |
30 bookmark_model_.reset(bookmark_client.CreateModel().release()); | 30 bookmark_model_.reset(bookmark_client.CreateModel().release()); |
31 model_.reset(new enhanced_bookmarks::EnhancedBookmarkModel( | 31 model_.reset(new enhanced_bookmarks::EnhancedBookmarkModel( |
32 bookmark_model_.get(), "v1.0")); | 32 bookmark_model_.get(), "v1.0")); |
33 } | 33 } |
34 | 34 |
35 virtual void TearDown() OVERRIDE { | 35 virtual void TearDown() OVERRIDE { |
36 model_.reset(); | 36 model_.reset(); |
37 bookmark_model_.reset(); | 37 bookmark_model_.reset(); |
38 } | 38 } |
39 | 39 |
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
371 TEST_F(EnhancedBookmarkModelTest, TestUserEdit) { | 371 TEST_F(EnhancedBookmarkModelTest, TestUserEdit) { |
372 const BookmarkNode* node = AddBookmark(); | 372 const BookmarkNode* node = AddBookmark(); |
373 | 373 |
374 model_->SetDescription(node, "foo"); | 374 model_->SetDescription(node, "foo"); |
375 std::string user_edit; | 375 std::string user_edit; |
376 ASSERT_TRUE(node->GetMetaInfo("stars.userEdit", &user_edit)); | 376 ASSERT_TRUE(node->GetMetaInfo("stars.userEdit", &user_edit)); |
377 EXPECT_EQ("true", user_edit); | 377 EXPECT_EQ("true", user_edit); |
378 } | 378 } |
379 | 379 |
380 } // namespace | 380 } // namespace |
OLD | NEW |