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

Side by Side Diff: chrome/browser/ui/views/bookmarks/bookmark_bar_view_test.cc

Issue 2033753002: Remove use of deprecated MessageLoop methods in chrome/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: manual change Created 4 years, 6 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 unified diff | Download patch
OLDNEW
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 "base/bind.h" 5 #include "base/bind.h"
6 #include "base/callback.h" 6 #include "base/callback.h"
7 #include "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "base/location.h" 8 #include "base/location.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
11 #include "base/run_loop.h" 11 #include "base/run_loop.h"
12 #include "base/single_thread_task_runner.h"
12 #include "base/strings/string_number_conversions.h" 13 #include "base/strings/string_number_conversions.h"
13 #include "base/strings/utf_string_conversions.h" 14 #include "base/strings/utf_string_conversions.h"
15 #include "base/threading/thread_task_runner_handle.h"
14 #include "build/build_config.h" 16 #include "build/build_config.h"
15 #include "chrome/app/chrome_command_ids.h" 17 #include "chrome/app/chrome_command_ids.h"
16 #include "chrome/browser/bookmarks/bookmark_model_factory.h" 18 #include "chrome/browser/bookmarks/bookmark_model_factory.h"
17 #include "chrome/browser/chrome_content_browser_client.h" 19 #include "chrome/browser/chrome_content_browser_client.h"
18 #include "chrome/browser/chrome_notification_types.h" 20 #include "chrome/browser/chrome_notification_types.h"
19 #include "chrome/browser/profiles/profile.h" 21 #include "chrome/browser/profiles/profile.h"
20 #include "chrome/browser/ui/bookmarks/bookmark_utils.h" 22 #include "chrome/browser/ui/bookmarks/bookmark_utils.h"
21 #include "chrome/browser/ui/bookmarks/bookmark_utils_desktop.h" 23 #include "chrome/browser/ui/bookmarks/bookmark_utils_desktop.h"
22 #include "chrome/browser/ui/browser.h" 24 #include "chrome/browser/ui/browser.h"
23 #include "chrome/browser/ui/browser_tabstrip.h" 25 #include "chrome/browser/ui/browser_tabstrip.h"
(...skipping 2310 matching lines...) Expand 10 before | Expand all | Expand 10 after
2334 ASSERT_TRUE(menu != nullptr); 2336 ASSERT_TRUE(menu != nullptr);
2335 ASSERT_TRUE(menu->GetSubmenu()->IsShowing()); 2337 ASSERT_TRUE(menu->GetSubmenu()->IsShowing());
2336 2338
2337 // Send WM_CANCELMODE, which should close the menu. The message is sent 2339 // Send WM_CANCELMODE, which should close the menu. The message is sent
2338 // synchronously, however, we post a task to make sure that the message is 2340 // synchronously, however, we post a task to make sure that the message is
2339 // processed completely before finishing the test. 2341 // processed completely before finishing the test.
2340 ::SendMessage( 2342 ::SendMessage(
2341 GetWidget()->GetNativeView()->GetHost()->GetAcceleratedWidget(), 2343 GetWidget()->GetNativeView()->GetHost()->GetAcceleratedWidget(),
2342 WM_CANCELMODE, 0, 0); 2344 WM_CANCELMODE, 0, 0);
2343 2345
2344 base::MessageLoop::current()->PostTask( 2346 base::ThreadTaskRunnerHandle::Get()->PostTask(
2345 FROM_HERE, base::Bind(&BookmarkBarViewTest26::Step3, this)); 2347 FROM_HERE, base::Bind(&BookmarkBarViewTest26::Step3, this));
2346 } 2348 }
2347 2349
2348 void Step3() { 2350 void Step3() {
2349 // Menu should not be showing anymore. 2351 // Menu should not be showing anymore.
2350 views::MenuItemView* menu = bb_view_->GetMenu(); 2352 views::MenuItemView* menu = bb_view_->GetMenu();
2351 ASSERT_TRUE(menu == nullptr); 2353 ASSERT_TRUE(menu == nullptr);
2352 2354
2353 Done(); 2355 Done();
2354 } 2356 }
(...skipping 16 matching lines...) Expand all
2371 ASSERT_EQ(2u, navigator_.urls().size()); 2373 ASSERT_EQ(2u, navigator_.urls().size());
2372 EXPECT_EQ(navigator_.urls()[0], 2374 EXPECT_EQ(navigator_.urls()[0],
2373 model_->bookmark_bar_node()->GetChild(0)->GetChild(0)->url()); 2375 model_->bookmark_bar_node()->GetChild(0)->GetChild(0)->url());
2374 EXPECT_EQ(navigator_.urls()[1], 2376 EXPECT_EQ(navigator_.urls()[1],
2375 model_->bookmark_bar_node()->GetChild(0)->GetChild(2)->url()); 2377 model_->bookmark_bar_node()->GetChild(0)->GetChild(2)->url());
2376 Done(); 2378 Done();
2377 } 2379 }
2378 }; 2380 };
2379 2381
2380 VIEW_TEST(BookmarkBarViewTest27, MiddleClickOnFolderOpensAllBookmarks); 2382 VIEW_TEST(BookmarkBarViewTest27, MiddleClickOnFolderOpensAllBookmarks);
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/app_list/win/app_list_service_win.cc ('k') | chrome/browser/ui/views/certificate_viewer_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698