| 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/test/test_bookmark_client.h" | 8 #include "components/bookmarks/test/test_bookmark_client.h" |
| 9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
| 10 | 10 |
| 11 using base::ASCIIToUTF16; | 11 using base::ASCIIToUTF16; |
| 12 | 12 |
| 13 namespace { | 13 namespace { |
| 14 | 14 |
| 15 TEST(BookmarkEditorTest, ApplyEditsWithNoFolderChange) { | 15 TEST(BookmarkEditorTest, ApplyEditsWithNoFolderChange) { |
| 16 test::TestBookmarkClient client; | 16 test::TestBookmarkClient client; |
| 17 scoped_ptr<BookmarkModel> model(client.CreateModel()); | 17 scoped_ptr<BookmarkModel> model(client.CreateModel(false)); |
| 18 const BookmarkNode* bookmarkbar = model->bookmark_bar_node(); | 18 const BookmarkNode* bookmarkbar = model->bookmark_bar_node(); |
| 19 model->AddURL(bookmarkbar, 0, ASCIIToUTF16("url0"), GURL("chrome://newtab")); | 19 model->AddURL(bookmarkbar, 0, ASCIIToUTF16("url0"), GURL("chrome://newtab")); |
| 20 model->AddURL(bookmarkbar, 1, ASCIIToUTF16("url1"), GURL("chrome://newtab")); | 20 model->AddURL(bookmarkbar, 1, ASCIIToUTF16("url1"), GURL("chrome://newtab")); |
| 21 | 21 |
| 22 { | 22 { |
| 23 BookmarkEditor::EditDetails detail( | 23 BookmarkEditor::EditDetails detail( |
| 24 BookmarkEditor::EditDetails::AddFolder(bookmarkbar, 1)); | 24 BookmarkEditor::EditDetails::AddFolder(bookmarkbar, 1)); |
| 25 BookmarkEditor::ApplyEditsWithNoFolderChange(model.get(), | 25 BookmarkEditor::ApplyEditsWithNoFolderChange(model.get(), |
| 26 bookmarkbar, | 26 bookmarkbar, |
| 27 detail, | 27 detail, |
| (...skipping 17 matching lines...) Expand all Loading... |
| 45 BookmarkEditor::ApplyEditsWithNoFolderChange(model.get(), | 45 BookmarkEditor::ApplyEditsWithNoFolderChange(model.get(), |
| 46 bookmarkbar, | 46 bookmarkbar, |
| 47 detail, | 47 detail, |
| 48 ASCIIToUTF16("folder2"), | 48 ASCIIToUTF16("folder2"), |
| 49 GURL(std::string())); | 49 GURL(std::string())); |
| 50 EXPECT_EQ(ASCIIToUTF16("folder2"), bookmarkbar->GetChild(4)->GetTitle()); | 50 EXPECT_EQ(ASCIIToUTF16("folder2"), bookmarkbar->GetChild(4)->GetTitle()); |
| 51 } | 51 } |
| 52 } | 52 } |
| 53 | 53 |
| 54 } // namespace | 54 } // namespace |
| OLD | NEW |