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

Unified Diff: chrome/browser/ui/views/tabs/tab_drag_controller_interactive_uitest.cc

Issue 1637943003: Remove HostDesktopType from BrowserList::GetInstance() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@screen-wrapper-land
Patch Set: mac2 Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/tabs/tab_drag_controller_interactive_uitest.cc
diff --git a/chrome/browser/ui/views/tabs/tab_drag_controller_interactive_uitest.cc b/chrome/browser/ui/views/tabs/tab_drag_controller_interactive_uitest.cc
index d4c38879326c51996ef6eb0aad3ded1528faad2b..9a9de9c12d4097a97e86f030ac27392efdd4f59b 100644
--- a/chrome/browser/ui/views/tabs/tab_drag_controller_interactive_uitest.cc
+++ b/chrome/browser/ui/views/tabs/tab_drag_controller_interactive_uitest.cc
@@ -165,9 +165,7 @@ using test::IDString;
using test::GetTabStripForBrowser;
TabDragControllerTest::TabDragControllerTest()
- : native_browser_list(BrowserList::GetInstance(
- chrome::HOST_DESKTOP_TYPE_NATIVE)) {
-}
+ : browser_list(BrowserList::GetInstance()) {}
TabDragControllerTest::~TabDragControllerTest() {
}
@@ -767,8 +765,8 @@ IN_PROC_BROWSER_TEST_P(DetachToBrowserTabDragControllerTest,
ASSERT_FALSE(TabDragController::IsActive());
// There should now be another browser.
- ASSERT_EQ(2u, native_browser_list->size());
- Browser* new_browser = native_browser_list->get(1);
+ ASSERT_EQ(2u, browser_list->size());
+ Browser* new_browser = browser_list->get(1);
ASSERT_TRUE(new_browser->window()->IsActive());
TabStrip* tab_strip2 = GetTabStripForBrowser(new_browser);
ASSERT_FALSE(tab_strip2->IsDragSessionActive());
@@ -835,8 +833,8 @@ IN_PROC_BROWSER_TEST_P(DetachToBrowserTabDragControllerTest,
ASSERT_FALSE(TabDragController::IsActive());
// There should now be another browser.
- ASSERT_EQ(2u, native_browser_list->size());
- Browser* new_browser = native_browser_list->get(1);
+ ASSERT_EQ(2u, browser_list->size());
+ Browser* new_browser = browser_list->get(1);
ASSERT_TRUE(new_browser->window()->IsActive());
TabStrip* tab_strip2 = GetTabStripForBrowser(new_browser);
ASSERT_FALSE(tab_strip2->IsDragSessionActive());
@@ -902,8 +900,8 @@ IN_PROC_BROWSER_TEST_P(DetachToBrowserTabDragControllerTest,
ASSERT_FALSE(TabDragController::IsActive());
// There should now be another browser.
- ASSERT_EQ(2u, native_browser_list->size());
- Browser* new_browser = native_browser_list->get(1);
+ ASSERT_EQ(2u, browser_list->size());
+ Browser* new_browser = browser_list->get(1);
ASSERT_TRUE(new_browser->window()->IsActive());
TabStrip* tab_strip2 = GetTabStripForBrowser(new_browser);
ASSERT_FALSE(tab_strip2->IsDragSessionActive());
@@ -1073,12 +1071,12 @@ IN_PROC_BROWSER_TEST_P(DetachToBrowserTabDragControllerTest,
ASSERT_TRUE(PressInput(tab_0_center));
ASSERT_TRUE(DragInputToNotifyWhenDone(
tab_0_center.x(), tab_0_center.y() + GetDetachY(tab_strip),
- base::Bind(&DeleteSourceDetachedStep2, to_delete, native_browser_list)));
+ base::Bind(&DeleteSourceDetachedStep2, to_delete, browser_list)));
QuitWhenNotDragging();
// Should not be dragging.
- ASSERT_EQ(1u, native_browser_list->size());
- Browser* new_browser = native_browser_list->get(0);
+ ASSERT_EQ(1u, browser_list->size());
+ Browser* new_browser = browser_list->get(0);
ASSERT_FALSE(GetTabStripForBrowser(new_browser)->IsDragSessionActive());
ASSERT_FALSE(TabDragController::IsActive());
@@ -1122,7 +1120,7 @@ IN_PROC_BROWSER_TEST_P(DetachToBrowserTabDragControllerTest,
ASSERT_TRUE(PressInput(tab_0_center));
ASSERT_TRUE(DragInputToNotifyWhenDone(
tab_0_center.x(), tab_0_center.y() + GetDetachY(tab_strip),
- base::Bind(&PressEscapeWhileDetachedStep2, native_browser_list)));
+ base::Bind(&PressEscapeWhileDetachedStep2, browser_list)));
QuitWhenNotDragging();
// Should not be dragging.
@@ -1130,7 +1128,7 @@ IN_PROC_BROWSER_TEST_P(DetachToBrowserTabDragControllerTest,
ASSERT_FALSE(TabDragController::IsActive());
// And there should only be one window.
- EXPECT_EQ(1u, native_browser_list->size());
+ EXPECT_EQ(1u, browser_list->size());
EXPECT_EQ("0 1", IDString(browser()->tab_strip_model()));
@@ -1178,7 +1176,7 @@ IN_PROC_BROWSER_TEST_P(DetachToBrowserTabDragControllerTest, MAYBE_DragAll) {
ASSERT_TRUE(PressInput(tab_0_center));
ASSERT_TRUE(DragInputToNotifyWhenDone(
tab_0_center.x(), tab_0_center.y() + GetDetachY(tab_strip),
- base::Bind(&DragAllStep2, this, native_browser_list)));
+ base::Bind(&DragAllStep2, this, browser_list)));
QuitWhenNotDragging();
// Should not be dragging.
@@ -1186,7 +1184,7 @@ IN_PROC_BROWSER_TEST_P(DetachToBrowserTabDragControllerTest, MAYBE_DragAll) {
ASSERT_FALSE(TabDragController::IsActive());
// And there should only be one window.
- EXPECT_EQ(1u, native_browser_list->size());
+ EXPECT_EQ(1u, browser_list->size());
EXPECT_EQ("0 1", IDString(browser()->tab_strip_model()));
@@ -1248,13 +1246,13 @@ IN_PROC_BROWSER_TEST_P(DetachToBrowserTabDragControllerTest,
ASSERT_TRUE(DragInputToNotifyWhenDone(
tab_0_center.x(), tab_0_center.y() + GetDetachY(tab_strip),
base::Bind(&DragAllToSeparateWindowStep2, this, tab_strip, tab_strip2,
- native_browser_list)));
+ browser_list)));
QuitWhenNotDragging();
// Should now be attached to tab_strip2.
ASSERT_TRUE(tab_strip2->IsDragSessionActive());
ASSERT_TRUE(TabDragController::IsActive());
- ASSERT_EQ(1u, native_browser_list->size());
+ ASSERT_EQ(1u, browser_list->size());
// Release the mouse, stopping the drag session.
ASSERT_TRUE(ReleaseInput());
@@ -1323,13 +1321,13 @@ IN_PROC_BROWSER_TEST_P(DetachToBrowserTabDragControllerTest,
ASSERT_TRUE(DragInputToNotifyWhenDone(
tab_0_center.x(), tab_0_center.y() + GetDetachY(tab_strip),
base::Bind(&DragAllToSeparateWindowAndCancelStep2, this,
- tab_strip, tab_strip2, native_browser_list)));
+ tab_strip, tab_strip2, browser_list)));
QuitWhenNotDragging();
// Should now be attached to tab_strip2.
ASSERT_TRUE(tab_strip2->IsDragSessionActive());
ASSERT_TRUE(TabDragController::IsActive());
- ASSERT_EQ(1u, native_browser_list->size());
+ ASSERT_EQ(1u, browser_list->size());
// Cancel the drag.
ASSERT_TRUE(ui_test_utils::SendKeyPressSync(
@@ -1340,7 +1338,7 @@ IN_PROC_BROWSER_TEST_P(DetachToBrowserTabDragControllerTest,
EXPECT_EQ("100 0 1", IDString(browser2->tab_strip_model()));
// browser() will have been destroyed, but browser2 should remain.
- ASSERT_EQ(1u, native_browser_list->size());
+ ASSERT_EQ(1u, browser_list->size());
EXPECT_FALSE(GetIsDragged(browser2));
@@ -1432,13 +1430,13 @@ IN_PROC_BROWSER_TEST_P(DetachToBrowserTabDragControllerTest,
ASSERT_TRUE(DragInputToNotifyWhenDone(
tab_0_center.x(), tab_0_center.y() + GetDetachY(tab_strip),
base::Bind(&DragAllToSeparateWindowStep2, this, tab_strip, tab_strip2,
- native_browser_list)));
+ browser_list)));
QuitWhenNotDragging();
// Should now be attached to tab_strip2.
ASSERT_TRUE(tab_strip2->IsDragSessionActive());
ASSERT_TRUE(TabDragController::IsActive());
- ASSERT_EQ(1u, native_browser_list->size());
+ ASSERT_EQ(1u, browser_list->size());
// Release the mouse, stopping the drag session.
ASSERT_TRUE(ReleaseInput());
@@ -1503,12 +1501,12 @@ IN_PROC_BROWSER_TEST_P(DetachToBrowserTabDragControllerTest,
ASSERT_TRUE(PressInput(tab_0_center));
ASSERT_TRUE(DragInputToNotifyWhenDone(
tab_0_center.x(), tab_0_center.y() + GetDetachY(tab_strip),
- base::Bind(&CancelOnNewTabWhenDraggingStep2, this, native_browser_list)));
+ base::Bind(&CancelOnNewTabWhenDraggingStep2, this, browser_list)));
QuitWhenNotDragging();
// Should be two windows and not dragging.
ASSERT_FALSE(TabDragController::IsActive());
- ASSERT_EQ(2u, native_browser_list->size());
+ ASSERT_EQ(2u, browser_list->size());
for (chrome::BrowserIterator it; !it.done(); it.Next()) {
EXPECT_FALSE(GetIsDragged(*it));
// Should not be maximized
@@ -1560,14 +1558,14 @@ IN_PROC_BROWSER_TEST_P(DetachToBrowserTabDragControllerTest,
ASSERT_TRUE(DragInputToNotifyWhenDone(
tab_0_center.x(), tab_0_center.y() + GetDetachY(tab_strip),
base::Bind(&DragInMaximizedWindowStep2, this, browser(), tab_strip,
- native_browser_list)));
+ browser_list)));
QuitWhenNotDragging();
ASSERT_FALSE(TabDragController::IsActive());
// Should be two browsers.
- ASSERT_EQ(2u, native_browser_list->size());
- Browser* new_browser = native_browser_list->get(1);
+ ASSERT_EQ(2u, browser_list->size());
+ Browser* new_browser = browser_list->get(1);
ASSERT_TRUE(new_browser->window()->IsActive());
EXPECT_TRUE(browser()->window()->GetNativeWindow()->IsVisible());
@@ -1655,8 +1653,8 @@ IN_PROC_BROWSER_TEST_P(DetachToBrowserInSeparateDisplayTabDragControllerTest,
ASSERT_FALSE(TabDragController::IsActive());
// There should now be another browser.
- ASSERT_EQ(2u, native_browser_list->size());
- Browser* new_browser = native_browser_list->get(1);
+ ASSERT_EQ(2u, browser_list->size());
+ Browser* new_browser = browser_list->get(1);
ASSERT_TRUE(new_browser->window()->IsActive());
TabStrip* tab_strip2 = GetTabStripForBrowser(new_browser);
ASSERT_FALSE(tab_strip2->IsDragSessionActive());
@@ -2163,10 +2161,10 @@ IN_PROC_BROWSER_TEST_F(
ASSERT_TRUE(DragTabAndExecuteTaskWhenDone(
tab_0_dst, base::Bind(&CancelDragTabToWindowInSeparateDisplayStep2,
this, tab_strip, roots[0], final_destination,
- native_browser_list)));
+ browser_list)));
QuitWhenNotDragging();
- ASSERT_EQ(1u, native_browser_list->size());
+ ASSERT_EQ(1u, browser_list->size());
ASSERT_FALSE(tab_strip->IsDragSessionActive());
ASSERT_FALSE(TabDragController::IsActive());
EXPECT_EQ("0 1", IDString(browser()->tab_strip_model()));
@@ -2209,10 +2207,10 @@ IN_PROC_BROWSER_TEST_F(
ASSERT_TRUE(DragTabAndExecuteTaskWhenDone(
tab_0_dst, base::Bind(&CancelDragTabToWindowInSeparateDisplayStep2,
this, tab_strip, roots[1], final_destination,
- native_browser_list)));
+ browser_list)));
QuitWhenNotDragging();
- ASSERT_EQ(1u, native_browser_list->size());
+ ASSERT_EQ(1u, browser_list->size());
ASSERT_FALSE(tab_strip->IsDragSessionActive());
ASSERT_FALSE(TabDragController::IsActive());
EXPECT_EQ("0 1", IDString(browser()->tab_strip_model()));
@@ -2227,8 +2225,8 @@ namespace {
void PressSecondFingerWhileDetachedStep2(
DetachToBrowserTabDragControllerTest* test) {
ASSERT_TRUE(TabDragController::IsActive());
- ASSERT_EQ(2u, test->native_browser_list->size());
- Browser* new_browser = test->native_browser_list->get(1);
+ ASSERT_EQ(2u, test->browser_list->size());
+ Browser* new_browser = test->browser_list->get(1);
ASSERT_TRUE(new_browser->window()->IsActive());
ASSERT_TRUE(test->PressInput2());
@@ -2256,7 +2254,7 @@ IN_PROC_BROWSER_TEST_P(DetachToBrowserTabDragControllerTestTouch,
QuitWhenNotDragging();
// The drag should have been reverted.
- ASSERT_EQ(1u, native_browser_list->size());
+ ASSERT_EQ(1u, browser_list->size());
ASSERT_FALSE(tab_strip->IsDragSessionActive());
ASSERT_FALSE(TabDragController::IsActive());
EXPECT_EQ("0 1", IDString(browser()->tab_strip_model()));
@@ -2273,8 +2271,8 @@ void DetachToDockedWindowNextStep(
DetachToBrowserTabDragControllerTest* test,
const gfx::Point& target_point,
int iteration) {
- ASSERT_EQ(2u, test->native_browser_list->size());
- Browser* new_browser = test->native_browser_list->get(1);
+ ASSERT_EQ(2u, test->browser_list->size());
+ Browser* new_browser = test->browser_list->get(1);
ASSERT_TRUE(new_browser->window()->IsActive());
if (!iteration) {
@@ -2322,8 +2320,8 @@ IN_PROC_BROWSER_TEST_P(DetachToBrowserTabDragControllerTest,
ASSERT_FALSE(TabDragController::IsActive());
// There should now be another browser.
- ASSERT_EQ(2u, native_browser_list->size());
- Browser* new_browser = native_browser_list->get(1);
+ ASSERT_EQ(2u, browser_list->size());
+ Browser* new_browser = browser_list->get(1);
ASSERT_TRUE(new_browser->window()->IsActive());
TabStrip* tab_strip2 = GetTabStripForBrowser(new_browser);
ASSERT_FALSE(tab_strip2->IsDragSessionActive());
« no previous file with comments | « chrome/browser/ui/views/tabs/tab_drag_controller_interactive_uitest.h ('k') | chrome/browser/ui/window_sizer/window_sizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698