OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/toolbar/toolbar_view.h" | 5 #include "chrome/browser/ui/views/toolbar/toolbar_view.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/location.h" | 9 #include "base/location.h" |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 base::Unretained(this), | 111 base::Unretained(this), |
112 runner->QuitClosure())); | 112 runner->QuitClosure())); |
113 | 113 |
114 // Also post a move task to the drag and drop thread. | 114 // Also post a move task to the drag and drop thread. |
115 if (!dnd_thread_.get()) { | 115 if (!dnd_thread_.get()) { |
116 dnd_thread_.reset(new base::Thread("mouse_move_thread")); | 116 dnd_thread_.reset(new base::Thread("mouse_move_thread")); |
117 dnd_thread_->Start(); | 117 dnd_thread_->Start(); |
118 } | 118 } |
119 | 119 |
120 dnd_thread_->task_runner()->PostDelayedTask( | 120 dnd_thread_->task_runner()->PostDelayedTask( |
121 FROM_HERE, base::Bind(base::IgnoreResult(&ui_controls::SendMouseMove), | 121 FROM_HERE, |
122 end.x(), end.y()), | 122 base::BindOnce(base::IgnoreResult(&ui_controls::SendMouseMove), end.x(), |
| 123 end.y()), |
123 base::TimeDelta::FromMilliseconds(200)); | 124 base::TimeDelta::FromMilliseconds(200)); |
124 runner->Run(); | 125 runner->Run(); |
125 | 126 |
126 // The app menu should have closed once the drag-and-drop completed. | 127 // The app menu should have closed once the drag-and-drop completed. |
127 EXPECT_FALSE(toolbar_view()->app_menu_button()->IsMenuShowing()); | 128 EXPECT_FALSE(toolbar_view()->app_menu_button()->IsMenuShowing()); |
128 } | 129 } |
129 | 130 |
130 void ToolbarViewInteractiveUITest::TestWhileInDragOperation() { | 131 void ToolbarViewInteractiveUITest::TestWhileInDragOperation() { |
131 EXPECT_TRUE(toolbar_view()->app_menu_button()->IsMenuShowing()); | 132 EXPECT_TRUE(toolbar_view()->app_menu_button()->IsMenuShowing()); |
132 } | 133 } |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 BookmarkModelFactory::GetForBrowserContext(browser()->profile()); | 270 BookmarkModelFactory::GetForBrowserContext(browser()->profile()); |
270 bookmarks::AddIfNotBookmarked(model, GURL("http://foo.com"), | 271 bookmarks::AddIfNotBookmarked(model, GURL("http://foo.com"), |
271 base::ASCIIToUTF16("Foo")); | 272 base::ASCIIToUTF16("Foo")); |
272 | 273 |
273 // We want to specifically test the case where the bookmark bar is | 274 // We want to specifically test the case where the bookmark bar is |
274 // already showing when a window opens, so create a second browser | 275 // already showing when a window opens, so create a second browser |
275 // window with the same profile. | 276 // window with the same profile. |
276 Browser* second_browser = CreateBrowser(browser()->profile()); | 277 Browser* second_browser = CreateBrowser(browser()->profile()); |
277 RunToolbarCycleFocusTest(second_browser); | 278 RunToolbarCycleFocusTest(second_browser); |
278 } | 279 } |
OLD | NEW |