OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/ui/bookmarks/bookmark_editor.h" | 5 #include "chrome/browser/ui/bookmarks/bookmark_editor.h" |
6 | 6 |
7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
8 #include "components/bookmarks/browser/bookmark_model.h" | 8 #include "components/bookmarks/browser/bookmark_model.h" |
9 #include "components/bookmarks/test/test_bookmark_client.h" | 9 #include "components/bookmarks/test/test_bookmark_client.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
11 | 11 |
12 using base::ASCIIToUTF16; | 12 using base::ASCIIToUTF16; |
13 using bookmarks::BookmarkModel; | 13 using bookmarks::BookmarkModel; |
14 using bookmarks::BookmarkNode; | 14 using bookmarks::BookmarkNode; |
15 | 15 |
16 namespace { | 16 namespace { |
17 | 17 |
18 TEST(BookmarkEditorTest, ApplyEditsWithNoFolderChange) { | 18 TEST(BookmarkEditorTest, ApplyEditsWithNoFolderChange) { |
19 scoped_ptr<BookmarkModel> model(bookmarks::TestBookmarkClient::CreateModel()); | 19 std::unique_ptr<BookmarkModel> model( |
| 20 bookmarks::TestBookmarkClient::CreateModel()); |
20 const BookmarkNode* bookmarkbar = model->bookmark_bar_node(); | 21 const BookmarkNode* bookmarkbar = model->bookmark_bar_node(); |
21 model->AddURL(bookmarkbar, 0, ASCIIToUTF16("url0"), GURL("chrome://newtab")); | 22 model->AddURL(bookmarkbar, 0, ASCIIToUTF16("url0"), GURL("chrome://newtab")); |
22 model->AddURL(bookmarkbar, 1, ASCIIToUTF16("url1"), GURL("chrome://newtab")); | 23 model->AddURL(bookmarkbar, 1, ASCIIToUTF16("url1"), GURL("chrome://newtab")); |
23 | 24 |
24 { | 25 { |
25 BookmarkEditor::EditDetails detail( | 26 BookmarkEditor::EditDetails detail( |
26 BookmarkEditor::EditDetails::AddFolder(bookmarkbar, 1)); | 27 BookmarkEditor::EditDetails::AddFolder(bookmarkbar, 1)); |
27 BookmarkEditor::ApplyEditsWithNoFolderChange(model.get(), | 28 BookmarkEditor::ApplyEditsWithNoFolderChange(model.get(), |
28 bookmarkbar, | 29 bookmarkbar, |
29 detail, | 30 detail, |
(...skipping 17 matching lines...) Expand all Loading... |
47 BookmarkEditor::ApplyEditsWithNoFolderChange(model.get(), | 48 BookmarkEditor::ApplyEditsWithNoFolderChange(model.get(), |
48 bookmarkbar, | 49 bookmarkbar, |
49 detail, | 50 detail, |
50 ASCIIToUTF16("folder2"), | 51 ASCIIToUTF16("folder2"), |
51 GURL(std::string())); | 52 GURL(std::string())); |
52 EXPECT_EQ(ASCIIToUTF16("folder2"), bookmarkbar->GetChild(4)->GetTitle()); | 53 EXPECT_EQ(ASCIIToUTF16("folder2"), bookmarkbar->GetChild(4)->GetTitle()); |
53 } | 54 } |
54 } | 55 } |
55 | 56 |
56 } // namespace | 57 } // namespace |
OLD | NEW |