Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5176)

Unified Diff: chrome/browser/ui/views/bookmarks/bookmark_editor_view_unittest.cc

Issue 7670041: Add --use-more-webui runtime flag to toggle WebUI replacements for native dialogs. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Merge with trunk. Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/bookmarks/bookmark_editor_view_unittest.cc
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_editor_view_unittest.cc b/chrome/browser/ui/views/bookmarks/bookmark_editor_view_unittest.cc
index 3b37cc5214b8cda32bbb7863e4325683a80e6a24..9bf17a74699af8428f17bb8eccca48a2f15fc32e 100644
--- a/chrome/browser/ui/views/bookmarks/bookmark_editor_view_unittest.cc
+++ b/chrome/browser/ui/views/bookmarks/bookmark_editor_view_unittest.cc
@@ -130,7 +130,8 @@ class BookmarkEditorViewTest : public testing::Test {
// Makes sure the tree model matches that of the bookmark bar model.
TEST_F(BookmarkEditorViewTest, ModelsMatch) {
- CreateEditor(profile_.get(), NULL, BookmarkEditor::EditDetails(),
+ CreateEditor(profile_.get(), NULL,
+ BookmarkEditor::EditDetails::AddNodeInFolder(NULL),
BookmarkEditorView::SHOW_TREE);
BookmarkEditorView::EditorNode* editor_root = editor_tree_model()->GetRoot();
// The root should have two or three children: bookmark bar, other bookmarks
@@ -159,7 +160,8 @@ TEST_F(BookmarkEditorViewTest, ModelsMatch) {
// Changes the title and makes sure parent/visual order doesn't change.
TEST_F(BookmarkEditorViewTest, EditTitleKeepsPosition) {
- CreateEditor(profile_.get(), NULL, BookmarkEditor::EditDetails(GetNode("a")),
+ CreateEditor(profile_.get(), NULL,
+ BookmarkEditor::EditDetails::EditNode(GetNode("a")),
BookmarkEditorView::SHOW_TREE);
SetTitleText(L"new_a");
@@ -176,7 +178,8 @@ TEST_F(BookmarkEditorViewTest, EditTitleKeepsPosition) {
TEST_F(BookmarkEditorViewTest, EditURLKeepsPosition) {
Time node_time = Time::Now() + TimeDelta::FromDays(2);
GetMutableNode("a")->set_date_added(node_time);
- CreateEditor(profile_.get(), NULL, BookmarkEditor::EditDetails(GetNode("a")),
+ CreateEditor(profile_.get(), NULL,
+ BookmarkEditor::EditDetails::EditNode(GetNode("a")),
BookmarkEditorView::SHOW_TREE);
SetURLText(UTF8ToWide(GURL(base_path() + "new_a").spec()));
@@ -193,7 +196,8 @@ TEST_F(BookmarkEditorViewTest, EditURLKeepsPosition) {
// Moves 'a' to be a child of the other node.
TEST_F(BookmarkEditorViewTest, ChangeParent) {
- CreateEditor(profile_.get(), NULL, BookmarkEditor::EditDetails(GetNode("a")),
+ CreateEditor(profile_.get(), NULL,
+ BookmarkEditor::EditDetails::EditNode(GetNode("a")),
BookmarkEditorView::SHOW_TREE);
ApplyEdits(editor_tree_model()->GetRoot()->GetChild(1));
@@ -207,7 +211,8 @@ TEST_F(BookmarkEditorViewTest, ChangeParent) {
TEST_F(BookmarkEditorViewTest, ChangeParentAndURL) {
Time node_time = Time::Now() + TimeDelta::FromDays(2);
GetMutableNode("a")->set_date_added(node_time);
- CreateEditor(profile_.get(), NULL, BookmarkEditor::EditDetails(GetNode("a")),
+ CreateEditor(profile_.get(), NULL,
+ BookmarkEditor::EditDetails::EditNode(GetNode("a")),
BookmarkEditorView::SHOW_TREE);
SetURLText(UTF8ToWide(GURL(base_path() + "new_a").spec()));
@@ -222,7 +227,8 @@ TEST_F(BookmarkEditorViewTest, ChangeParentAndURL) {
// Creates a new folder and moves a node to it.
TEST_F(BookmarkEditorViewTest, MoveToNewParent) {
- CreateEditor(profile_.get(), NULL, BookmarkEditor::EditDetails(GetNode("a")),
+ CreateEditor(profile_.get(), NULL,
+ BookmarkEditor::EditDetails::EditNode(GetNode("a")),
BookmarkEditorView::SHOW_TREE);
// Create two nodes: "F21" as a child of "F2" and "F211" as a child of "F21".
@@ -255,7 +261,8 @@ TEST_F(BookmarkEditorViewTest, MoveToNewParent) {
// Brings up the editor, creating a new URL on the bookmark bar.
TEST_F(BookmarkEditorViewTest, NewURL) {
- CreateEditor(profile_.get(), NULL, BookmarkEditor::EditDetails(),
+ CreateEditor(profile_.get(), NULL,
+ BookmarkEditor::EditDetails::AddNodeInFolder(NULL),
BookmarkEditorView::SHOW_TREE);
SetURLText(UTF8ToWide(GURL(base_path() + "a").spec()));
@@ -276,7 +283,8 @@ TEST_F(BookmarkEditorViewTest, NewURL) {
// Brings up the editor with no tree and modifies the url.
TEST_F(BookmarkEditorViewTest, ChangeURLNoTree) {
CreateEditor(profile_.get(), NULL,
- BookmarkEditor::EditDetails(model_->other_node()->GetChild(0)),
+ BookmarkEditor::EditDetails::EditNode(
+ model_->other_node()->GetChild(0)),
BookmarkEditorView::NO_TREE);
SetURLText(UTF8ToWide(GURL(base_path() + "a").spec()));
@@ -296,7 +304,8 @@ TEST_F(BookmarkEditorViewTest, ChangeURLNoTree) {
// Brings up the editor with no tree and modifies only the title.
TEST_F(BookmarkEditorViewTest, ChangeTitleNoTree) {
CreateEditor(profile_.get(), NULL,
- BookmarkEditor::EditDetails(model_->other_node()->GetChild(0)),
+ BookmarkEditor::EditDetails::EditNode(
+ model_->other_node()->GetChild(0)),
BookmarkEditorView::NO_TREE);
SetTitleText(L"new_a");
@@ -314,10 +323,10 @@ TEST_F(BookmarkEditorViewTest, ChangeTitleNoTree) {
// Creates a new folder.
TEST_F(BookmarkEditorViewTest, NewFolder) {
const BookmarkNode* bb_node = model_->bookmark_bar_node();
- BookmarkEditor::EditDetails details;
+ BookmarkEditor::EditDetails details =
+ BookmarkEditor::EditDetails::AddFolder(bb_node);
details.urls.push_back(std::make_pair(GURL(base_path() + "x"),
ASCIIToUTF16("z")));
- details.type = BookmarkEditor::EditDetails::NEW_FOLDER;
CreateEditor(profile_.get(), bb_node, details, BookmarkEditorView::SHOW_TREE);
// The url field shouldn't be visible.
@@ -343,10 +352,10 @@ TEST_F(BookmarkEditorViewTest, NewFolder) {
// Creates a new folder and selects a different folder for the folder to appear
// in then the editor is initially created showing.
TEST_F(BookmarkEditorViewTest, MoveFolder) {
- BookmarkEditor::EditDetails details;
+ BookmarkEditor::EditDetails details = BookmarkEditor::EditDetails::AddFolder(
+ model_->bookmark_bar_node());
details.urls.push_back(std::make_pair(GURL(base_path() + "x"),
ASCIIToUTF16("z")));
- details.type = BookmarkEditor::EditDetails::NEW_FOLDER;
CreateEditor(profile_.get(), model_->bookmark_bar_node(),
details, BookmarkEditorView::SHOW_TREE);
« no previous file with comments | « chrome/browser/ui/views/bookmarks/bookmark_editor_view.cc ('k') | chrome/browser/ui/views/hung_renderer_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698