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 <string> | 5 #include <string> |
6 | 6 |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
9 #include "chrome/app/chrome_command_ids.h" | 9 #include "chrome/app/chrome_command_ids.h" |
10 #include "chrome/browser/bookmarks/bookmark_context_menu_controller.h" | 10 #include "chrome/browser/bookmarks/bookmark_context_menu_controller.h" |
11 #include "chrome/browser/bookmarks/bookmark_model.h" | 11 #include "chrome/browser/bookmarks/bookmark_model.h" |
| 12 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
12 #include "chrome/browser/bookmarks/bookmark_utils.h" | 13 #include "chrome/browser/bookmarks/bookmark_utils.h" |
13 #include "chrome/browser/profiles/profile.h" | 14 #include "chrome/browser/profiles/profile.h" |
14 #include "chrome/test/base/testing_profile.h" | 15 #include "chrome/test/base/testing_profile.h" |
15 #include "content/public/browser/page_navigator.h" | 16 #include "content/public/browser/page_navigator.h" |
16 #include "content/public/test/test_browser_thread.h" | 17 #include "content/public/test/test_browser_thread.h" |
17 #include "grit/generated_resources.h" | 18 #include "grit/generated_resources.h" |
18 #include "testing/gtest/include/gtest/gtest.h" | 19 #include "testing/gtest/include/gtest/gtest.h" |
19 | 20 |
20 using content::BrowserThread; | 21 using content::BrowserThread; |
21 using content::OpenURLParams; | 22 using content::OpenURLParams; |
(...skipping 21 matching lines...) Expand all Loading... |
43 | 44 |
44 virtual void SetUp() { | 45 virtual void SetUp() { |
45 #if defined(OS_WIN) | 46 #if defined(OS_WIN) |
46 bookmark_utils::DisableBookmarkBarViewAnimationsForTesting(true); | 47 bookmark_utils::DisableBookmarkBarViewAnimationsForTesting(true); |
47 #endif | 48 #endif |
48 | 49 |
49 profile_.reset(new TestingProfile()); | 50 profile_.reset(new TestingProfile()); |
50 profile_->CreateBookmarkModel(true); | 51 profile_->CreateBookmarkModel(true); |
51 profile_->BlockUntilBookmarkModelLoaded(); | 52 profile_->BlockUntilBookmarkModelLoaded(); |
52 | 53 |
53 model_ = profile_->GetBookmarkModel(); | 54 model_ = BookmarkModelFactory::GetForProfile(profile_.get()); |
54 | 55 |
55 AddTestData(); | 56 AddTestData(); |
56 } | 57 } |
57 | 58 |
58 virtual void TearDown() { | 59 virtual void TearDown() { |
59 #if defined(OS_WIN) | 60 #if defined(OS_WIN) |
60 bookmark_utils::DisableBookmarkBarViewAnimationsForTesting(false); | 61 bookmark_utils::DisableBookmarkBarViewAnimationsForTesting(false); |
61 #endif | 62 #endif |
62 | 63 |
63 // Flush the message loop to make application verifiers happy. | 64 // Flush the message loop to make application verifiers happy. |
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 ASSERT_EQ(bb_node->GetChild(0)->url(), bb_node->GetChild(1)->url()); | 320 ASSERT_EQ(bb_node->GetChild(0)->url(), bb_node->GetChild(1)->url()); |
320 | 321 |
321 controller.reset(new BookmarkContextMenuController( | 322 controller.reset(new BookmarkContextMenuController( |
322 NULL, NULL, NULL, profile_.get(), NULL, nodes[0]->parent(), nodes)); | 323 NULL, NULL, NULL, profile_.get(), NULL, nodes[0]->parent(), nodes)); |
323 // Cut the URL. | 324 // Cut the URL. |
324 controller->ExecuteCommand(IDC_CUT); | 325 controller->ExecuteCommand(IDC_CUT); |
325 ASSERT_TRUE(bb_node->GetChild(0)->is_url()); | 326 ASSERT_TRUE(bb_node->GetChild(0)->is_url()); |
326 ASSERT_TRUE(bb_node->GetChild(1)->is_folder()); | 327 ASSERT_TRUE(bb_node->GetChild(1)->is_folder()); |
327 ASSERT_EQ(old_count, bb_node->child_count()); | 328 ASSERT_EQ(old_count, bb_node->child_count()); |
328 } | 329 } |
OLD | NEW |