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/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/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
344 ASSERT_TRUE(ui_controls::SendMouseMove(target_point.x(), target_point.y())); | 344 ASSERT_TRUE(ui_controls::SendMouseMove(target_point.x(), target_point.y())); |
345 | 345 |
346 ASSERT_TRUE(tab_strip->IsDragSessionActive()); | 346 ASSERT_TRUE(tab_strip->IsDragSessionActive()); |
347 ASSERT_TRUE(TabDragController::IsActive()); | 347 ASSERT_TRUE(TabDragController::IsActive()); |
348 ASSERT_EQ(2u, native_browser_list->size()); | 348 ASSERT_EQ(2u, native_browser_list->size()); |
349 | 349 |
350 // Cancel the drag. | 350 // Cancel the drag. |
351 // TODO(msw): Fix this on "XP Tests (1)"; see http://crbug.com/227444 | 351 // TODO(msw): Fix this on "XP Tests (1)"; see http://crbug.com/227444 |
352 if (base::win::GetVersion() == base::win::VERSION_XP && | 352 if (base::win::GetVersion() == base::win::VERSION_XP && |
353 views::Textfield::IsViewsTextfieldEnabled()) { | 353 views::Textfield::IsViewsTextfieldEnabled()) { |
354 LOG(INFO) << "Try SendKeyPressSync [esc]; this seems to fail..."; | 354 LOG(INFO) << "Try SendKeyPressToWindowSync [esc]; maybe this works???"; |
355 ASSERT_TRUE(ui_test_utils::SendKeyPressSync( | 355 ASSERT_TRUE(ui_test_utils::SendKeyPressToWindowSync( |
356 browser2, ui::VKEY_ESCAPE, false, false, false, false)); | 356 browser2->window()->GetNativeWindow(), ui::VKEY_ESCAPE, |
| 357 false, false, false, false)); |
357 LOG(INFO) << "Tab strip 1 drag active (expect 0): " | 358 LOG(INFO) << "Tab strip 1 drag active (expect 0): " |
358 << tab_strip->IsDragSessionActive(); | 359 << tab_strip->IsDragSessionActive(); |
359 LOG(INFO) << "Tab strip 2 drag active (expect 0): " | 360 LOG(INFO) << "Tab strip 2 drag active (expect 0): " |
360 << tab_strip2->IsDragSessionActive(); | 361 << tab_strip2->IsDragSessionActive(); |
361 LOG(INFO) << "Tab drag controller active (expect 0): " | 362 LOG(INFO) << "Tab drag controller active (expect 0): " |
362 << TabDragController::IsActive(); | 363 << TabDragController::IsActive(); |
363 LOG(INFO) << "Native browser list size (expect 2): " | 364 LOG(INFO) << "Native browser list size (expect 2): " |
364 << native_browser_list->size(); | 365 << native_browser_list->size(); |
365 LOG(INFO) << "Tab strip 1 model string (expect '0 1'): " | 366 LOG(INFO) << "Tab strip 1 model string (expect '0 1'): " |
366 << IDString(browser()->tab_strip_model()); | 367 << IDString(browser()->tab_strip_model()); |
367 LOG(INFO) << "Tab strip 2 model string (expect '100'): " | 368 LOG(INFO) << "Tab strip 2 model string (expect '100'): " |
368 << IDString(browser2->tab_strip_model()); | 369 << IDString(browser2->tab_strip_model()); |
369 | 370 |
370 LOG(INFO) << "Try SendKeyPressToWindowSync [esc]; maybe this works???"; | 371 LOG(INFO) << "Try SendKeyPressSync [esc]; is this needed???"; |
371 ASSERT_TRUE(ui_test_utils::SendKeyPressToWindowSync( | 372 ASSERT_TRUE(ui_test_utils::SendKeyPressSync( |
372 browser2->window()->GetNativeWindow(), ui::VKEY_ESCAPE, | 373 browser2, ui::VKEY_ESCAPE, false, false, false, false)); |
373 false, false, false, false)); | 374 LOG(INFO) << "Tab strip 1 drag active (expect 0): " |
374 LOG(INFO) << "Tab strip 1 Drag active (expect 0): " | |
375 << tab_strip->IsDragSessionActive(); | 375 << tab_strip->IsDragSessionActive(); |
376 LOG(INFO) << "Tab strip 2 Drag active (expect 0): " | 376 LOG(INFO) << "Tab strip 2 drag active (expect 0): " |
377 << tab_strip2->IsDragSessionActive(); | 377 << tab_strip2->IsDragSessionActive(); |
378 LOG(INFO) << "Tab drag controller active (expect 0): " | 378 LOG(INFO) << "Tab drag controller active (expect 0): " |
379 << TabDragController::IsActive(); | 379 << TabDragController::IsActive(); |
380 LOG(INFO) << "Native browser list size (expect 2): " | 380 LOG(INFO) << "Native browser list size (expect 2): " |
381 << native_browser_list->size(); | 381 << native_browser_list->size(); |
382 LOG(INFO) << "Tab strip 1 model string (expect '0 1'): " | 382 LOG(INFO) << "Tab strip 1 model string (expect '0 1'): " |
383 << IDString(browser()->tab_strip_model()); | 383 << IDString(browser()->tab_strip_model()); |
384 LOG(INFO) << "Tab strip 2 model string (expect '100'): " | 384 LOG(INFO) << "Tab strip 2 model string (expect '100'): " |
385 << IDString(browser2->tab_strip_model()); | 385 << IDString(browser2->tab_strip_model()); |
386 } else { | 386 } else { |
387 ASSERT_TRUE(ui_test_utils::SendKeyPressSync( | 387 ASSERT_TRUE(ui_test_utils::SendKeyPressSync( |
388 browser2, ui::VKEY_ESCAPE, false, false, false, false)); | 388 browser2, ui::VKEY_ESCAPE, false, false, false, false)); |
389 ASSERT_FALSE(tab_strip->IsDragSessionActive()); | 389 ASSERT_FALSE(tab_strip->IsDragSessionActive()); |
390 ASSERT_FALSE(tab_strip2->IsDragSessionActive()); | 390 ASSERT_FALSE(tab_strip2->IsDragSessionActive()); |
391 ASSERT_FALSE(TabDragController::IsActive()); | 391 ASSERT_FALSE(TabDragController::IsActive()); |
392 ASSERT_EQ(2u, native_browser_list->size()); | 392 ASSERT_EQ(2u, native_browser_list->size()); |
393 EXPECT_EQ("0 1", IDString(browser()->tab_strip_model())); | 393 EXPECT_EQ("0 1", IDString(browser()->tab_strip_model())); |
394 EXPECT_EQ("100", IDString(browser2->tab_strip_model())); | 394 EXPECT_EQ("100", IDString(browser2->tab_strip_model())); |
395 } | 395 } |
396 } | 396 } |
OLD | NEW |