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 "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/utf_string_conversions.h" | 6 #include "base/utf_string_conversions.h" |
7 #include "chrome/app/chrome_command_ids.h" | 7 #include "chrome/app/chrome_command_ids.h" |
8 #include "chrome/browser/debugger/devtools_window.h" | 8 #include "chrome/browser/debugger/devtools_window.h" |
9 #include "chrome/browser/net/url_request_mock_util.h" | 9 #include "chrome/browser/net/url_request_mock_util.h" |
10 #include "chrome/browser/prefs/browser_prefs.h" | 10 #include "chrome/browser/prefs/browser_prefs.h" |
(...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
506 #endif | 506 #endif |
507 IN_PROC_BROWSER_TEST_F(PanelBrowserTest, MAYBE_AnimateBounds) { | 507 IN_PROC_BROWSER_TEST_F(PanelBrowserTest, MAYBE_AnimateBounds) { |
508 Panel* panel = CreatePanelWithBounds("PanelTest", gfx::Rect(0, 0, 100, 100)); | 508 Panel* panel = CreatePanelWithBounds("PanelTest", gfx::Rect(0, 0, 100, 100)); |
509 scoped_ptr<NativePanelTesting> panel_testing( | 509 scoped_ptr<NativePanelTesting> panel_testing( |
510 CreateNativePanelTesting(panel)); | 510 CreateNativePanelTesting(panel)); |
511 | 511 |
512 // Validates that no animation should be triggered when the panel is being | 512 // Validates that no animation should be triggered when the panel is being |
513 // dragged. | 513 // dragged. |
514 gfx::Point mouse_location(panel->GetBounds().origin()); | 514 gfx::Point mouse_location(panel->GetBounds().origin()); |
515 panel_testing->PressLeftMouseButtonTitlebar(mouse_location); | 515 panel_testing->PressLeftMouseButtonTitlebar(mouse_location); |
516 panel_testing->DragTitlebar(mouse_location.Add(gfx::Point(-100, 5))); | 516 panel_testing->DragTitlebar(mouse_location.Add(gfx::Vector2d(-100, 5))); |
517 EXPECT_FALSE(panel_testing->IsAnimatingBounds()); | 517 EXPECT_FALSE(panel_testing->IsAnimatingBounds()); |
518 panel_testing->FinishDragTitlebar(); | 518 panel_testing->FinishDragTitlebar(); |
519 | 519 |
520 // Set bounds with animation. | 520 // Set bounds with animation. |
521 gfx::Rect bounds = gfx::Rect(10, 20, 150, 160); | 521 gfx::Rect bounds = gfx::Rect(10, 20, 150, 160); |
522 panel->SetPanelBounds(bounds); | 522 panel->SetPanelBounds(bounds); |
523 EXPECT_TRUE(panel_testing->IsAnimatingBounds()); | 523 EXPECT_TRUE(panel_testing->IsAnimatingBounds()); |
524 WaitForBoundsAnimationFinished(panel); | 524 WaitForBoundsAnimationFinished(panel); |
525 EXPECT_FALSE(panel_testing->IsAnimatingBounds()); | 525 EXPECT_FALSE(panel_testing->IsAnimatingBounds()); |
526 EXPECT_EQ(bounds, panel->GetBounds()); | 526 EXPECT_EQ(bounds, panel->GetBounds()); |
(...skipping 1155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1682 ::MSG key_msg = { NULL, WM_KEYDOWN, ui::VKEY_W, 0 }; | 1682 ::MSG key_msg = { NULL, WM_KEYDOWN, ui::VKEY_W, 0 }; |
1683 content::NativeWebKeyboardEvent key_event(key_msg); | 1683 content::NativeWebKeyboardEvent key_event(key_msg); |
1684 key_event.modifiers = content::NativeWebKeyboardEvent::ControlKey; | 1684 key_event.modifiers = content::NativeWebKeyboardEvent::ControlKey; |
1685 #else | 1685 #else |
1686 content::NativeWebKeyboardEvent key_event; | 1686 content::NativeWebKeyboardEvent key_event; |
1687 #endif | 1687 #endif |
1688 panel->HandleKeyboardEvent(key_event); | 1688 panel->HandleKeyboardEvent(key_event); |
1689 signal.Wait(); | 1689 signal.Wait(); |
1690 EXPECT_EQ(0, panel_manager->num_panels()); | 1690 EXPECT_EQ(0, panel_manager->num_panels()); |
1691 } | 1691 } |
OLD | NEW |