OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <string> | 5 #include <string> |
6 | 6 |
7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "chrome/browser/bookmarks/bookmark_model.h" | 10 #include "chrome/browser/bookmarks/bookmark_model.h" |
11 #include "chrome/browser/profiles/profile.h" | 11 #include "chrome/browser/profiles/profile.h" |
12 #include "chrome/browser/ui/views/bookmarks/bookmark_editor_view.h" | 12 #include "chrome/browser/ui/views/bookmarks/bookmark_editor_view.h" |
13 #include "chrome/test/base/testing_browser_process_test.h" | |
14 #include "chrome/test/base/testing_profile.h" | 13 #include "chrome/test/base/testing_profile.h" |
15 #include "content/browser/browser_thread.h" | 14 #include "content/browser/browser_thread.h" |
16 #include "testing/gtest/include/gtest/gtest.h" | 15 #include "testing/gtest/include/gtest/gtest.h" |
17 | 16 |
18 using base::Time; | 17 using base::Time; |
19 using base::TimeDelta; | 18 using base::TimeDelta; |
20 | 19 |
21 // Base class for bookmark editor tests. Creates a BookmarkModel and populates | 20 // Base class for bookmark editor tests. Creates a BookmarkModel and populates |
22 // it with test data. | 21 // it with test data. |
23 class BookmarkEditorViewTest : public TestingBrowserProcessTest { | 22 class BookmarkEditorViewTest : public testing::Test { |
24 public: | 23 public: |
25 BookmarkEditorViewTest() | 24 BookmarkEditorViewTest() |
26 : ui_thread_(BrowserThread::UI, &message_loop_), | 25 : ui_thread_(BrowserThread::UI, &message_loop_), |
27 file_thread_(BrowserThread::FILE, &message_loop_), | 26 file_thread_(BrowserThread::FILE, &message_loop_), |
28 model_(NULL) { | 27 model_(NULL) { |
29 } | 28 } |
30 | 29 |
31 virtual void SetUp() { | 30 virtual void SetUp() { |
32 profile_.reset(new TestingProfile()); | 31 profile_.reset(new TestingProfile()); |
33 profile_->CreateBookmarkModel(true); | 32 profile_->CreateBookmarkModel(true); |
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
362 EXPECT_EQ(BookmarkNode::FOLDER, new_node->type()); | 361 EXPECT_EQ(BookmarkNode::FOLDER, new_node->type()); |
363 EXPECT_EQ(ASCIIToUTF16("new_F"), new_node->GetTitle()); | 362 EXPECT_EQ(ASCIIToUTF16("new_F"), new_node->GetTitle()); |
364 // The node should have one child. | 363 // The node should have one child. |
365 ASSERT_EQ(1, new_node->child_count()); | 364 ASSERT_EQ(1, new_node->child_count()); |
366 const BookmarkNode* new_child = new_node->GetChild(0); | 365 const BookmarkNode* new_child = new_node->GetChild(0); |
367 // Make sure the child url/title match. | 366 // Make sure the child url/title match. |
368 EXPECT_EQ(BookmarkNode::URL, new_child->type()); | 367 EXPECT_EQ(BookmarkNode::URL, new_child->type()); |
369 EXPECT_EQ(WideToUTF16Hack(details.urls[0].second), new_child->GetTitle()); | 368 EXPECT_EQ(WideToUTF16Hack(details.urls[0].second), new_child->GetTitle()); |
370 EXPECT_EQ(details.urls[0].first, new_child->url()); | 369 EXPECT_EQ(details.urls[0].first, new_child->url()); |
371 } | 370 } |
OLD | NEW |