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

Unified Diff: chrome/browser/bookmarks/bookmark_utils_unittest.cc

Issue 176563002: Revert r252832: Eliminate Bookmarks dependence to bookmark_undo_utils.h. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 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/bookmarks/bookmark_utils_unittest.cc
diff --git a/chrome/browser/bookmarks/bookmark_utils_unittest.cc b/chrome/browser/bookmarks/bookmark_utils_unittest.cc
index d95928eadc03e00877f456c9209f08da56708486..0bb86b76b78fbe68e5a0ff91bfa20be51affa630 100644
--- a/chrome/browser/bookmarks/bookmark_utils_unittest.cc
+++ b/chrome/browser/bookmarks/bookmark_utils_unittest.cc
@@ -8,7 +8,6 @@
#include "base/message_loop/message_loop.h"
#include "base/strings/utf_string_conversions.h"
-#include "chrome/browser/bookmarks/base_bookmark_model_observer.h"
#include "chrome/browser/bookmarks/bookmark_model.h"
#include "chrome/browser/bookmarks/bookmark_node_data.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -21,38 +20,16 @@ using std::string;
namespace bookmark_utils {
namespace {
-class BookmarkUtilsTest : public testing::Test,
- public BaseBookmarkModelObserver {
+class BookmarkUtilsTest : public ::testing::Test {
public:
- BookmarkUtilsTest()
- : grouped_changes_beginning_count_(0), grouped_changes_ended_count_(0) {}
+ BookmarkUtilsTest() {}
virtual ~BookmarkUtilsTest() {}
virtual void TearDown() OVERRIDE {
ui::Clipboard::DestroyClipboardForCurrentThread();
}
- void ExpectGroupedChangeCount(int expected_beginning_count,
- int expected_ended_count) {
- EXPECT_EQ(grouped_changes_beginning_count_, expected_beginning_count);
- EXPECT_EQ(grouped_changes_ended_count_, expected_ended_count);
- }
-
- // BaseBookmarkModelObserver:
- virtual void BookmarkModelChanged() OVERRIDE {}
-
- virtual void GroupedBookmarkChangesBeginning(BookmarkModel* model) OVERRIDE {
- ++grouped_changes_beginning_count_;
- }
-
- virtual void GroupedBookmarkChangesEnded(BookmarkModel* model) OVERRIDE {
- ++grouped_changes_ended_count_;
- }
-
private:
- int grouped_changes_beginning_count_;
- int grouped_changes_ended_count_;
-
// Clipboard requires a message loop.
base::MessageLoopForUI loop_;
@@ -265,31 +242,6 @@ TEST_F(BookmarkUtilsTest, CopyPaste) {
EXPECT_FALSE(CanPasteFromClipboard(model.bookmark_bar_node()));
}
-TEST_F(BookmarkUtilsTest, CutToClipboard) {
- BookmarkModel model(NULL);
- model.AddObserver(this);
-
- base::string16 title(ASCIIToUTF16("foo"));
- GURL url("http://foo.com");
- const BookmarkNode* n1 = model.AddURL(model.other_node(), 0, title, url);
- const BookmarkNode* n2 = model.AddURL(model.other_node(), 1, title, url);
-
- // Cut the nodes to the clipboard.
- std::vector<const BookmarkNode*> nodes;
- nodes.push_back(n1);
- nodes.push_back(n2);
- CopyToClipboard(&model, nodes, true);
-
- // Make sure the nodes were removed.
- EXPECT_EQ(0, model.other_node()->child_count());
-
- // Make sure observers were notified the set of changes should be grouped.
- ExpectGroupedChangeCount(1, 1);
-
- // And make sure we can paste from the clipboard.
- EXPECT_TRUE(CanPasteFromClipboard(model.other_node()));
-}
-
TEST_F(BookmarkUtilsTest, GetParentForNewNodes) {
BookmarkModel model(NULL);
// This tests the case where selection contains one item and that item is a
« no previous file with comments | « chrome/browser/bookmarks/bookmark_utils.cc ('k') | chrome/browser/bookmarks/scoped_group_bookmark_actions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698