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 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
389 virtual ~WaitForAutoResizeNarrower() {} | 389 virtual ~WaitForAutoResizeNarrower() {} |
390 | 390 |
391 protected: | 391 protected: |
392 virtual bool AtExpectedState() OVERRIDE { | 392 virtual bool AtExpectedState() OVERRIDE { |
393 return panel_->GetBounds().width() < initial_size_.width(); | 393 return panel_->GetBounds().width() < initial_size_.width(); |
394 } | 394 } |
395 Panel* panel_; | 395 Panel* panel_; |
396 gfx::Size initial_size_; | 396 gfx::Size initial_size_; |
397 }; | 397 }; |
398 | 398 |
399 | 399 // crbug.com/160504 |
400 IN_PROC_BROWSER_TEST_F(PanelBrowserTest, AutoResize) { | 400 IN_PROC_BROWSER_TEST_F(PanelBrowserTest, FLAKY_AutoResize) { |
401 PanelManager* panel_manager = PanelManager::GetInstance(); | 401 PanelManager* panel_manager = PanelManager::GetInstance(); |
402 panel_manager->enable_auto_sizing(true); | 402 panel_manager->enable_auto_sizing(true); |
403 // Bigger space is needed by this test. | 403 // Bigger space is needed by this test. |
404 SetTestingAreas(gfx::Rect(0, 0, 1200, 900), gfx::Rect()); | 404 SetTestingAreas(gfx::Rect(0, 0, 1200, 900), gfx::Rect()); |
405 | 405 |
406 // Create a test panel with web contents loaded. | 406 // Create a test panel with web contents loaded. |
407 CreatePanelParams params("PanelTest1", gfx::Rect(), SHOW_AS_ACTIVE); | 407 CreatePanelParams params("PanelTest1", gfx::Rect(), SHOW_AS_ACTIVE); |
408 GURL url(ui_test_utils::GetTestUrl( | 408 GURL url(ui_test_utils::GetTestUrl( |
409 FilePath(kTestDir), | 409 FilePath(kTestDir), |
410 FilePath(FILE_PATH_LITERAL("update-preferred-size.html")))); | 410 FilePath(FILE_PATH_LITERAL("update-preferred-size.html")))); |
(...skipping 1273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1684 ::MSG key_msg = { NULL, WM_KEYDOWN, ui::VKEY_W, 0 }; | 1684 ::MSG key_msg = { NULL, WM_KEYDOWN, ui::VKEY_W, 0 }; |
1685 content::NativeWebKeyboardEvent key_event(key_msg); | 1685 content::NativeWebKeyboardEvent key_event(key_msg); |
1686 key_event.modifiers = content::NativeWebKeyboardEvent::ControlKey; | 1686 key_event.modifiers = content::NativeWebKeyboardEvent::ControlKey; |
1687 #else | 1687 #else |
1688 content::NativeWebKeyboardEvent key_event; | 1688 content::NativeWebKeyboardEvent key_event; |
1689 #endif | 1689 #endif |
1690 panel->HandleKeyboardEvent(key_event); | 1690 panel->HandleKeyboardEvent(key_event); |
1691 signal.Wait(); | 1691 signal.Wait(); |
1692 EXPECT_EQ(0, panel_manager->num_panels()); | 1692 EXPECT_EQ(0, panel_manager->num_panels()); |
1693 } | 1693 } |
OLD | NEW |