Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1614)

Unified Diff: ash/wm/workspace/workspace_manager_unittest.cc

Issue 10905080: Exempt status bubble windows from status bar darkening (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review nit Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/wm/workspace/workspace_manager2_unittest.cc ('k') | chrome/browser/ui/ash/shelf_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/workspace/workspace_manager_unittest.cc
diff --git a/ash/wm/workspace/workspace_manager_unittest.cc b/ash/wm/workspace/workspace_manager_unittest.cc
index bcd845e1445643a02b3efa5c63b91cca026c1df2..e293d69baa4aa31f56cbb9c2537a6126b434f9e1 100644
--- a/ash/wm/workspace/workspace_manager_unittest.cc
+++ b/ash/wm/workspace/workspace_manager_unittest.cc
@@ -28,6 +28,14 @@ using aura::Window;
namespace ash {
namespace internal {
+namespace {
+
+bool GetWindowOverlapsShelf() {
+ return Shell::GetInstance()->shelf()->window_overlaps_shelf();
+}
+
+} // namespace
+
class WorkspaceManagerTest : public test::AshTestBase {
public:
WorkspaceManagerTest() : manager_(NULL) {}
@@ -460,10 +468,29 @@ TEST_F(WorkspaceManagerTest, ShelfStateUpdated) {
// Two windows, w1 normal, w2 maximized.
scoped_ptr<Window> w1(CreateTestWindow());
- w1->SetBounds(gfx::Rect(0, 1, 101, 102));
+ const gfx::Rect w1_bounds(0, 1, 101, 102);
+ ShelfLayoutManager* shelf = Shell::GetInstance()->shelf();
+ const gfx::Rect touches_shelf_bounds(
+ 0, shelf->GetIdealBounds().y() - 10, 101, 102);
+ // Move |w1| to overlap the shelf.
+ w1->SetBounds(touches_shelf_bounds);
+ EXPECT_FALSE(GetWindowOverlapsShelf());
+
+ // A visible ignored window should not trigger the overlap.
+ scoped_ptr<Window> w_ignored(CreateTestWindow());
+ w_ignored->SetBounds(touches_shelf_bounds);
+ SetIgnoredByShelf(&(*w_ignored), true);
+ w_ignored->Show();
+ EXPECT_FALSE(GetWindowOverlapsShelf());
+
+ // Make it visible, since visible shelf overlaps should be true.
w1->Show();
+ EXPECT_TRUE(GetWindowOverlapsShelf());
- ShelfLayoutManager* shelf = Shell::GetInstance()->shelf();
+ wm::ActivateWindow(w1.get());
+ w1->SetBounds(w1_bounds);
+ w1->Show();
+ wm::ActivateWindow(w1.get());
EXPECT_EQ(ShelfLayoutManager::VISIBLE, shelf->visibility_state());
« no previous file with comments | « ash/wm/workspace/workspace_manager2_unittest.cc ('k') | chrome/browser/ui/ash/shelf_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698