| 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 "base/base64.h" | 5 #include "base/base64.h" |
| 6 #include "base/strings/utf_string_conversions.h" | 6 #include "base/strings/utf_string_conversions.h" |
| 7 #include "components/bookmarks/browser/bookmark_model.h" | 7 #include "components/bookmarks/browser/bookmark_model.h" |
| 8 #include "components/bookmarks/test/test_bookmark_client.h" | 8 #include "components/bookmarks/test/test_bookmark_client.h" |
| 9 #include "components/enhanced_bookmarks/enhanced_bookmark_utils.h" | 9 #include "components/enhanced_bookmarks/enhanced_bookmark_utils.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| 11 | 11 |
| 12 using bookmarks::TestBookmarkClient; | 12 using bookmarks::TestBookmarkClient; |
| 13 | 13 |
| 14 namespace { | 14 namespace { |
| 15 | 15 |
| 16 const GURL bookmark_url("http://example.com/index.html"); | 16 const GURL bookmark_url("http://example.com/index.html"); |
| 17 | 17 |
| 18 class EnhancedBookmarkUtilsTest : public testing::Test { | 18 class EnhancedBookmarkUtilsTest : public testing::Test { |
| 19 public: | 19 public: |
| 20 EnhancedBookmarkUtilsTest() {} | 20 EnhancedBookmarkUtilsTest() {} |
| 21 virtual ~EnhancedBookmarkUtilsTest() {} | 21 ~EnhancedBookmarkUtilsTest() override {} |
| 22 | 22 |
| 23 protected: | 23 protected: |
| 24 DISALLOW_COPY_AND_ASSIGN(EnhancedBookmarkUtilsTest); | 24 DISALLOW_COPY_AND_ASSIGN(EnhancedBookmarkUtilsTest); |
| 25 | 25 |
| 26 // Adds a bookmark as the subnode at index 0 to other_node. | 26 // Adds a bookmark as the subnode at index 0 to other_node. |
| 27 // |name| should be ASCII encoded. | 27 // |name| should be ASCII encoded. |
| 28 // Returns the newly added bookmark. | 28 // Returns the newly added bookmark. |
| 29 const BookmarkNode* AddBookmark(BookmarkModel* model, std::string name) { | 29 const BookmarkNode* AddBookmark(BookmarkModel* model, std::string name) { |
| 30 return model->AddURL(model->other_node(), | 30 return model->AddURL(model->other_node(), |
| 31 0, // index. | 31 0, // index. |
| (...skipping 17 matching lines...) Expand all Loading... |
| 49 | 49 |
| 50 CHECK(std::find(result.begin(), result.end(), node1) != result.end()); | 50 CHECK(std::find(result.begin(), result.end(), node1) != result.end()); |
| 51 CHECK(std::find(result.begin(), result.end(), node2) != result.end()); | 51 CHECK(std::find(result.begin(), result.end(), node2) != result.end()); |
| 52 CHECK(std::find(result.begin(), result.end(), node4) != result.end()); | 52 CHECK(std::find(result.begin(), result.end(), node4) != result.end()); |
| 53 | 53 |
| 54 CHECK(std::find(result.begin(), result.end(), node3) == result.end()); | 54 CHECK(std::find(result.begin(), result.end(), node3) == result.end()); |
| 55 CHECK(std::find(result.begin(), result.end(), node5) == result.end()); | 55 CHECK(std::find(result.begin(), result.end(), node5) == result.end()); |
| 56 }; | 56 }; |
| 57 | 57 |
| 58 } // namespace | 58 } // namespace |
| OLD | NEW |