OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 #import "chrome/browser/ui/cocoa/tab_contents/previewable_contents_controller.h" | 5 #import "chrome/browser/ui/cocoa/tab_contents/previewable_contents_controller.h" |
6 | 6 |
7 #include "chrome/browser/instant/instant_model.h" | 7 #include "chrome/browser/instant/instant_model.h" |
8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
9 #include "chrome/browser/ui/browser.h" | 9 #include "chrome/browser/ui/browser.h" |
10 #include "chrome/browser/ui/browser_window.h" | 10 #include "chrome/browser/ui/browser_window.h" |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 EXPECT_TRUE([controller_ dropShadowView]); | 122 EXPECT_TRUE([controller_ dropShadowView]); |
123 EXPECT_TRUE([controller_ drawDropShadow]); | 123 EXPECT_TRUE([controller_ drawDropShadow]); |
124 EXPECT_NSEQ([controller_ view], [[controller_ dropShadowView] superview]); | 124 EXPECT_NSEQ([controller_ view], [[controller_ dropShadowView] superview]); |
125 | 125 |
126 NSRect dropShadowFrame = [[controller_ dropShadowView] frame]; | 126 NSRect dropShadowFrame = [[controller_ dropShadowView] frame]; |
127 NSRect controllerBounds = [[controller_ view] bounds]; | 127 NSRect controllerBounds = [[controller_ view] bounds]; |
128 EXPECT_EQ(NSWidth(controllerBounds), NSWidth(dropShadowFrame)); | 128 EXPECT_EQ(NSWidth(controllerBounds), NSWidth(dropShadowFrame)); |
129 EXPECT_EQ([PreviewDropShadowView preferredHeight], | 129 EXPECT_EQ([PreviewDropShadowView preferredHeight], |
130 NSHeight(dropShadowFrame)); | 130 NSHeight(dropShadowFrame)); |
131 } | 131 } |
| 132 |
| 133 // Verify that the shadow is hidden when hiding the preview. |
| 134 IN_PROC_BROWSER_TEST_F(PreviewableContentsControllerTest, HideShadow) { |
| 135 chrome::search::Mode mode; |
| 136 mode.mode = chrome::search::Mode::MODE_SEARCH_SUGGESTIONS; |
| 137 instant_model_.SetPreviewState(mode, 10, INSTANT_SIZE_PERCENT); |
| 138 EXPECT_TRUE([controller_ dropShadowView]); |
| 139 |
| 140 [controller_ onActivateTabWithContents:web_contents_.get()]; |
| 141 EXPECT_FALSE([controller_ dropShadowView]); |
| 142 } |
OLD | NEW |