Add a minor text member to ui::MenuModel.
[chromium-blink-merge.git] / chrome / browser / ui / bookmarks / bookmark_editor_unittest.cc
blob83d16e62c18195c4b9dbd9080b80c5b9d71e424c
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
3 // found in the LICENSE file.
5 #include "chrome/browser/ui/bookmarks/bookmark_editor.h"
7 #include "base/strings/utf_string_conversions.h"
8 #include "testing/gtest/include/gtest/gtest.h"
10 namespace {
12 TEST(BookmarkEditorTest, ApplyEditsWithNoFolderChange) {
13 BookmarkModel model(NULL);
14 const BookmarkNode* bookmarkbar = model.bookmark_bar_node();
15 model.AddURL(bookmarkbar, 0, ASCIIToUTF16("url0"), GURL("chrome://newtab"));
16 model.AddURL(bookmarkbar, 1, ASCIIToUTF16("url1"), GURL("chrome://newtab"));
19 BookmarkEditor::EditDetails detail(
20 BookmarkEditor::EditDetails::AddFolder(bookmarkbar, 1));
21 BookmarkEditor::ApplyEditsWithNoFolderChange(&model,
22 bookmarkbar,
23 detail,
24 ASCIIToUTF16("folder0"),
25 GURL(std::string()));
26 EXPECT_EQ(ASCIIToUTF16("folder0"), bookmarkbar->GetChild(1)->GetTitle());
29 BookmarkEditor::EditDetails detail(
30 BookmarkEditor::EditDetails::AddFolder(bookmarkbar, -1));
31 BookmarkEditor::ApplyEditsWithNoFolderChange(&model,
32 bookmarkbar,
33 detail,
34 ASCIIToUTF16("folder1"),
35 GURL(std::string()));
36 EXPECT_EQ(ASCIIToUTF16("folder1"), bookmarkbar->GetChild(3)->GetTitle());
39 BookmarkEditor::EditDetails detail(
40 BookmarkEditor::EditDetails::AddFolder(bookmarkbar, 10));
41 BookmarkEditor::ApplyEditsWithNoFolderChange(&model,
42 bookmarkbar,
43 detail,
44 ASCIIToUTF16("folder2"),
45 GURL(std::string()));
46 EXPECT_EQ(ASCIIToUTF16("folder2"), bookmarkbar->GetChild(4)->GetTitle());
50 } // namespace