| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/gtk/bookmarks/bookmark_editor_gtk.h" | 5 #include "chrome/browser/ui/gtk/bookmarks/bookmark_editor_gtk.h" |
| 6 | 6 |
| 7 #include <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 12 #include "base/message_loop/message_loop.h" | 12 #include "base/message_loop/message_loop.h" |
| 13 #include "base/strings/string_util.h" | 13 #include "base/strings/string_util.h" |
| 14 #include "base/strings/utf_string_conversions.h" | 14 #include "base/strings/utf_string_conversions.h" |
| 15 #include "chrome/browser/bookmarks/bookmark_model.h" | 15 #include "chrome/browser/bookmarks/bookmark_model.h" |
| 16 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 16 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
| 17 #include "chrome/browser/bookmarks/bookmark_test_helpers.h" | 17 #include "chrome/browser/bookmarks/bookmark_test_helpers.h" |
| 18 #include "chrome/browser/ui/gtk/bookmarks/bookmark_tree_model.h" | 18 #include "chrome/browser/ui/gtk/bookmarks/bookmark_tree_model.h" |
| 19 #include "chrome/test/base/testing_profile.h" | 19 #include "chrome/test/base/testing_profile.h" |
| 20 #include "content/public/test/test_browser_thread.h" | 20 #include "content/public/test/test_browser_thread.h" |
| 21 #include "testing/gtest/include/gtest/gtest.h" | 21 #include "testing/gtest/include/gtest/gtest.h" |
| 22 | 22 |
| 23 using base::ASCIIToUTF16; |
| 24 using base::UTF16ToUTF8; |
| 23 using base::Time; | 25 using base::Time; |
| 24 using base::TimeDelta; | 26 using base::TimeDelta; |
| 25 using content::BrowserThread; | 27 using content::BrowserThread; |
| 26 | 28 |
| 27 // Base class for bookmark editor tests. This class is a copy from | 29 // Base class for bookmark editor tests. This class is a copy from |
| 28 // bookmark_editor_view_unittest.cc, and all the tests in this file are | 30 // bookmark_editor_view_unittest.cc, and all the tests in this file are |
| 29 // GTK-ifications of the corresponding views tests. Testing here is really | 31 // GTK-ifications of the corresponding views tests. Testing here is really |
| 30 // important because on Linux, we make round trip copies from chrome's | 32 // important because on Linux, we make round trip copies from chrome's |
| 31 // BookmarkModel class to GTK's native GtkTreeStore. | 33 // BookmarkModel class to GTK's native GtkTreeStore. |
| 32 class BookmarkEditorGtkTest : public testing::Test { | 34 class BookmarkEditorGtkTest : public testing::Test { |
| (...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 337 gtk_entry_set_text(GTK_ENTRY(editor.name_entry_), "new_a"); | 339 gtk_entry_set_text(GTK_ENTRY(editor.name_entry_), "new_a"); |
| 338 | 340 |
| 339 editor.ApplyEdits(); | 341 editor.ApplyEdits(); |
| 340 | 342 |
| 341 const BookmarkNode* other_node = model_->other_node(); | 343 const BookmarkNode* other_node = model_->other_node(); |
| 342 ASSERT_EQ(2, other_node->child_count()); | 344 ASSERT_EQ(2, other_node->child_count()); |
| 343 | 345 |
| 344 const BookmarkNode* new_node = other_node->GetChild(0); | 346 const BookmarkNode* new_node = other_node->GetChild(0); |
| 345 EXPECT_EQ(ASCIIToUTF16("new_a"), new_node->GetTitle()); | 347 EXPECT_EQ(ASCIIToUTF16("new_a"), new_node->GetTitle()); |
| 346 } | 348 } |
| OLD | NEW |