| 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/views/bookmarks/bookmark_context_menu.h" | 5 #include "chrome/browser/ui/views/bookmarks/bookmark_context_menu.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| 11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "base/threading/sequenced_worker_pool.h" |
| 12 #include "base/utf_string_conversions.h" | 13 #include "base/utf_string_conversions.h" |
| 13 #include "chrome/app/chrome_command_ids.h" | 14 #include "chrome/app/chrome_command_ids.h" |
| 14 #include "chrome/browser/bookmarks/bookmark_model.h" | 15 #include "chrome/browser/bookmarks/bookmark_model.h" |
| 15 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 16 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
| 16 #include "chrome/browser/bookmarks/bookmark_utils.h" | 17 #include "chrome/browser/bookmarks/bookmark_utils.h" |
| 17 #include "chrome/browser/profiles/profile.h" | 18 #include "chrome/browser/profiles/profile.h" |
| 18 #include "chrome/browser/ui/bookmarks/bookmark_utils.h" | 19 #include "chrome/browser/ui/bookmarks/bookmark_utils.h" |
| 19 #include "chrome/test/base/testing_profile.h" | 20 #include "chrome/test/base/testing_profile.h" |
| 20 #include "content/public/browser/page_navigator.h" | 21 #include "content/public/browser/page_navigator.h" |
| 21 #include "content/public/test/test_browser_thread.h" | 22 #include "content/public/test/test_browser_thread.h" |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 AddTestData(); | 70 AddTestData(); |
| 70 } | 71 } |
| 71 | 72 |
| 72 virtual void TearDown() { | 73 virtual void TearDown() { |
| 73 #if defined(OS_WIN) | 74 #if defined(OS_WIN) |
| 74 bookmark_utils::DisableBookmarkBarViewAnimationsForTesting(false); | 75 bookmark_utils::DisableBookmarkBarViewAnimationsForTesting(false); |
| 75 #endif | 76 #endif |
| 76 | 77 |
| 77 ui::Clipboard::DestroyClipboardForCurrentThread(); | 78 ui::Clipboard::DestroyClipboardForCurrentThread(); |
| 78 | 79 |
| 80 BrowserThread::GetBlockingPool()->FlushForTesting(); |
| 79 // Flush the message loop to make application verifiers happy. | 81 // Flush the message loop to make application verifiers happy. |
| 80 message_loop_.RunAllPending(); | 82 message_loop_.RunAllPending(); |
| 81 } | 83 } |
| 82 | 84 |
| 83 protected: | 85 protected: |
| 84 MessageLoopForUI message_loop_; | 86 MessageLoopForUI message_loop_; |
| 85 content::TestBrowserThread ui_thread_; | 87 content::TestBrowserThread ui_thread_; |
| 86 content::TestBrowserThread file_thread_; | 88 content::TestBrowserThread file_thread_; |
| 87 scoped_ptr<TestingProfile> profile_; | 89 scoped_ptr<TestingProfile> profile_; |
| 88 BookmarkModel* model_; | 90 BookmarkModel* model_; |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 312 ASSERT_EQ(bb_node->GetChild(0)->url(), bb_node->GetChild(1)->url()); | 314 ASSERT_EQ(bb_node->GetChild(0)->url(), bb_node->GetChild(1)->url()); |
| 313 | 315 |
| 314 controller.reset(new BookmarkContextMenu( | 316 controller.reset(new BookmarkContextMenu( |
| 315 NULL, NULL, profile_.get(), NULL, nodes[0]->parent(), nodes, false)); | 317 NULL, NULL, profile_.get(), NULL, nodes[0]->parent(), nodes, false)); |
| 316 // Cut the URL. | 318 // Cut the URL. |
| 317 controller->ExecuteCommand(IDC_CUT); | 319 controller->ExecuteCommand(IDC_CUT); |
| 318 ASSERT_TRUE(bb_node->GetChild(0)->is_url()); | 320 ASSERT_TRUE(bb_node->GetChild(0)->is_url()); |
| 319 ASSERT_TRUE(bb_node->GetChild(1)->is_folder()); | 321 ASSERT_TRUE(bb_node->GetChild(1)->is_folder()); |
| 320 ASSERT_EQ(old_count, bb_node->child_count()); | 322 ASSERT_EQ(old_count, bb_node->child_count()); |
| 321 } | 323 } |
| OLD | NEW |