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