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/browser/download/download_service.h" | 7 #include "chrome/browser/download/download_service.h" |
8 #include "chrome/browser/download/download_service_factory.h" | 8 #include "chrome/browser/download/download_service_factory.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 1054 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1065 EXPECT_EQ(Panel::TITLE_ONLY, panel1->expansion_state()); | 1065 EXPECT_EQ(Panel::TITLE_ONLY, panel1->expansion_state()); |
1066 | 1066 |
1067 gfx::Point hover_point_in_panel(panel1->GetBounds().origin()); | 1067 gfx::Point hover_point_in_panel(panel1->GetBounds().origin()); |
1068 MoveMouse(hover_point_in_panel); | 1068 MoveMouse(hover_point_in_panel); |
1069 | 1069 |
1070 panel1->FlashFrame(false); | 1070 panel1->FlashFrame(false); |
1071 EXPECT_FALSE(panel1->IsDrawingAttention()); | 1071 EXPECT_FALSE(panel1->IsDrawingAttention()); |
1072 EXPECT_EQ(Panel::TITLE_ONLY, panel1->expansion_state()); | 1072 EXPECT_EQ(Panel::TITLE_ONLY, panel1->expansion_state()); |
1073 EXPECT_EQ(Panel::MINIMIZED, panel2->expansion_state()); | 1073 EXPECT_EQ(Panel::MINIMIZED, panel2->expansion_state()); |
1074 | 1074 |
1075 // Move mouse away and panel should go back to fully minimized state. | 1075 // Typical user scenario will detect the mouse in the panel |
| 1076 // after attention is cleared, causing titles to pop up, so |
| 1077 // we simulate that here. |
| 1078 MoveMouseAndWaitForExpansionStateChange(panel2, hover_point_in_panel); |
| 1079 EXPECT_EQ(Panel::TITLE_ONLY, panel1->expansion_state()); |
| 1080 EXPECT_EQ(Panel::TITLE_ONLY, panel2->expansion_state()); |
| 1081 |
| 1082 // Move mouse away and panels should go back to fully minimized state. |
1076 MoveMouseAndWaitForExpansionStateChange(panel1, hover_point); | 1083 MoveMouseAndWaitForExpansionStateChange(panel1, hover_point); |
1077 EXPECT_EQ(Panel::MINIMIZED, panel1->expansion_state()); | 1084 EXPECT_EQ(Panel::MINIMIZED, panel1->expansion_state()); |
1078 EXPECT_EQ(Panel::MINIMIZED, panel2->expansion_state()); | 1085 EXPECT_EQ(Panel::MINIMIZED, panel2->expansion_state()); |
1079 | 1086 |
1080 panel1->Close(); | 1087 panel1->Close(); |
1081 panel2->Close(); | 1088 panel2->Close(); |
1082 } | 1089 } |
1083 | 1090 |
1084 IN_PROC_BROWSER_TEST_F(OldPanelBrowserTest, DrawAttentionWhenActive) { | 1091 IN_PROC_BROWSER_TEST_F(OldPanelBrowserTest, DrawAttentionWhenActive) { |
1085 CreatePanelParams params("Initially Active", gfx::Rect(), SHOW_AS_ACTIVE); | 1092 CreatePanelParams params("Initially Active", gfx::Rect(), SHOW_AS_ACTIVE); |
(...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1526 EXPECT_GE(smaller_work_area_size.width(), panel->max_size().width()); | 1533 EXPECT_GE(smaller_work_area_size.width(), panel->max_size().width()); |
1527 EXPECT_EQ(smaller_work_area_size.height(), panel->max_size().height()); | 1534 EXPECT_EQ(smaller_work_area_size.height(), panel->max_size().height()); |
1528 EXPECT_GT(old_full_size.width(), panel->full_size().width()); | 1535 EXPECT_GT(old_full_size.width(), panel->full_size().width()); |
1529 EXPECT_GT(old_full_size.height(), panel->full_size().height()); | 1536 EXPECT_GT(old_full_size.height(), panel->full_size().height()); |
1530 EXPECT_GE(panel->max_size().width(), panel->full_size().width()); | 1537 EXPECT_GE(panel->max_size().width(), panel->full_size().width()); |
1531 EXPECT_GE(panel->max_size().height(), panel->full_size().height()); | 1538 EXPECT_GE(panel->max_size().height(), panel->full_size().height()); |
1532 EXPECT_EQ(smaller_work_area_size.height(), panel->full_size().height()); | 1539 EXPECT_EQ(smaller_work_area_size.height(), panel->full_size().height()); |
1533 | 1540 |
1534 panel->Close(); | 1541 panel->Close(); |
1535 } | 1542 } |
OLD | NEW |