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

Side by Side Diff: chrome/browser/ui/views/tabs/tab_drag_controller_interactive_uitest.cc

Issue 10830325: Makes the TabStrip always have the ability to enter stacking mode on (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix tests Created 8 years, 4 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 | Annotate | Revision Log
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 "chrome/browser/ui/views/tabs/tab_drag_controller_interactive_uitest.h" 5 #include "chrome/browser/ui/views/tabs/tab_drag_controller_interactive_uitest.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/property_bag.h" 10 #include "base/property_bag.h"
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 275
276 private: 276 private:
277 #if defined(USE_ASH) 277 #if defined(USE_ASH)
278 scoped_ptr<aura::test::EventGenerator> event_generator_; 278 scoped_ptr<aura::test::EventGenerator> event_generator_;
279 #endif 279 #endif
280 280
281 DISALLOW_COPY_AND_ASSIGN(DetachToBrowserTabDragControllerTest); 281 DISALLOW_COPY_AND_ASSIGN(DetachToBrowserTabDragControllerTest);
282 }; 282 };
283 283
284 // Creates a browser with two tabs, drags the second to the first. 284 // Creates a browser with two tabs, drags the second to the first.
285 IN_PROC_BROWSER_TEST_P(DetachToBrowserTabDragControllerTest, DragInSameWindow) { 285 // TODO(sky): this won't work with touch as it requires a long press.
286 IN_PROC_BROWSER_TEST_P(DetachToBrowserTabDragControllerTest,
287 DISABLED_DragInSameWindow) {
286 AddTabAndResetBrowser(browser()); 288 AddTabAndResetBrowser(browser());
287 289
288 TabStrip* tab_strip = GetTabStripForBrowser(browser()); 290 TabStrip* tab_strip = GetTabStripForBrowser(browser());
289 TabStripModel* model = browser()->tab_strip_model(); 291 TabStripModel* model = browser()->tab_strip_model();
290 292
291 gfx::Point tab_1_center(GetCenterInScreenCoordinates(tab_strip->tab_at(1))); 293 gfx::Point tab_1_center(GetCenterInScreenCoordinates(tab_strip->tab_at(1)));
292 ASSERT_TRUE(PressInput(tab_1_center)); 294 ASSERT_TRUE(PressInput(tab_1_center));
293 gfx::Point tab_0_center(GetCenterInScreenCoordinates(tab_strip->tab_at(0))); 295 gfx::Point tab_0_center(GetCenterInScreenCoordinates(tab_strip->tab_at(0)));
294 ASSERT_TRUE(DragInputTo(tab_0_center)); 296 ASSERT_TRUE(DragInputTo(tab_0_center));
295 ASSERT_TRUE(ReleaseInput()); 297 ASSERT_TRUE(ReleaseInput());
(...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after
726 DragDirectlyToSecondWindow) { 728 DragDirectlyToSecondWindow) {
727 TabStrip* tab_strip = GetTabStripForBrowser(browser()); 729 TabStrip* tab_strip = GetTabStripForBrowser(browser());
728 730
729 // Add another tab to browser(). 731 // Add another tab to browser().
730 AddTabAndResetBrowser(browser()); 732 AddTabAndResetBrowser(browser());
731 733
732 // Create another browser. 734 // Create another browser.
733 Browser* browser2 = CreateAnotherWindowBrowserAndRelayout(); 735 Browser* browser2 = CreateAnotherWindowBrowserAndRelayout();
734 TabStrip* tab_strip2 = GetTabStripForBrowser(browser2); 736 TabStrip* tab_strip2 = GetTabStripForBrowser(browser2);
735 737
738 // Move the tabstrip down enough so that we can detach.
739 gfx::Rect bounds(browser2->window()->GetBounds());
740 bounds.Offset(0, 100);
741 browser2->window()->SetBounds(bounds);
742
736 // Move to the first tab and drag it enough so that it detaches, but not 743 // Move to the first tab and drag it enough so that it detaches, but not
737 // enough that it attaches to browser2. 744 // enough that it attaches to browser2.
738 gfx::Point tab_0_center(GetCenterInScreenCoordinates(tab_strip->tab_at(0))); 745 gfx::Point tab_0_center(GetCenterInScreenCoordinates(tab_strip->tab_at(0)));
739 ASSERT_TRUE(PressInput(tab_0_center)); 746 ASSERT_TRUE(PressInput(tab_0_center));
740 747
741 gfx::Point b2_location(5, 0); 748 gfx::Point b2_location(5, 0);
742 views::View::ConvertPointToScreen(tab_strip2, &b2_location); 749 views::View::ConvertPointToScreen(tab_strip2, &b2_location);
743 ASSERT_TRUE(DragInputTo(b2_location)); 750 ASSERT_TRUE(DragInputTo(b2_location));
744 751
745 // Should now be attached to tab_strip2. 752 // Should now be attached to tab_strip2.
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
814 821
815 #if defined(USE_ASH) 822 #if defined(USE_ASH)
816 INSTANTIATE_TEST_CASE_P(TabDragging, 823 INSTANTIATE_TEST_CASE_P(TabDragging,
817 DetachToBrowserTabDragControllerTest, 824 DetachToBrowserTabDragControllerTest,
818 ::testing::Values("mouse", "touch")); 825 ::testing::Values("mouse", "touch"));
819 #else 826 #else
820 INSTANTIATE_TEST_CASE_P(TabDragging, 827 INSTANTIATE_TEST_CASE_P(TabDragging,
821 DetachToBrowserTabDragControllerTest, 828 DetachToBrowserTabDragControllerTest,
822 ::testing::Values("mouse")); 829 ::testing::Values("mouse"));
823 #endif 830 #endif
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc ('k') | chrome/browser/ui/views/tabs/tab_strip.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698