summaryrefslogtreecommitdiffstats
path: root/ash/wm/frame_painter_unittest.cc
diff options
context:
space:
mode:
authorjamescook@chromium.org <jamescook@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-11 21:49:11 +0000
committerjamescook@chromium.org <jamescook@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-11 21:49:11 +0000
commitbe5ea1ced2afa5d2e493f889ac1593b6583fab91 (patch)
tree550ac4230e1663e410fa5369d12a0055f1275ffa /ash/wm/frame_painter_unittest.cc
parent398f187633aee8f0c7c6c7a72dc8bcc85bf4acd4 (diff)
downloadchromium_src-be5ea1ced2afa5d2e493f889ac1593b6583fab91.zip
chromium_src-be5ea1ced2afa5d2e493f889ac1593b6583fab91.tar.gz
chromium_src-be5ea1ced2afa5d2e493f889ac1593b6583fab91.tar.bz2
Fix hard-to-read translucent modal dialog titles
Chrome OS Ash window transparency computation was wrong. BUG=229709 TEST=Added to ash_unittests FramePainterTest Review URL: https://chromiumcodereview.appspot.com/14179002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@193765 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/wm/frame_painter_unittest.cc')
-rw-r--r--ash/wm/frame_painter_unittest.cc32
1 files changed, 32 insertions, 0 deletions
diff --git a/ash/wm/frame_painter_unittest.cc b/ash/wm/frame_painter_unittest.cc
index c1bbbdd..275c484 100644
--- a/ash/wm/frame_painter_unittest.cc
+++ b/ash/wm/frame_painter_unittest.cc
@@ -14,6 +14,7 @@
#include "base/memory/scoped_ptr.h"
#include "grit/ash_resources.h"
#include "testing/gtest/include/gtest/gtest.h"
+#include "ui/aura/client/aura_constants.h"
#include "ui/aura/root_window.h"
#include "ui/aura/window_observer.h"
#include "ui/base/hit_test.h"
@@ -403,6 +404,37 @@ TEST_F(FramePainterTest, UseSoloWindowHeaderWithPanel) {
EXPECT_FALSE(p2.UseSoloWindowHeader());
}
+// Modal dialogs should not use solo headers.
+TEST_F(FramePainterTest, UseSoloWindowHeaderModal) {
+ // Create a widget and a painter for it.
+ scoped_ptr<Widget> w1(CreateTestWidget());
+ FramePainter p1;
+ ImageButton size1(NULL);
+ ImageButton close1(NULL);
+ p1.Init(w1.get(), NULL, &size1, &close1, FramePainter::SIZE_BUTTON_MAXIMIZES);
+ w1->Show();
+
+ // We only have one window, so it should use a solo header.
+ EXPECT_TRUE(p1.UseSoloWindowHeader());
+
+ // Create a fake modal window.
+ scoped_ptr<Widget> w2(CreateTestWidget());
+ w2->GetNativeWindow()->SetProperty(aura::client::kModalKey,
+ ui::MODAL_TYPE_WINDOW);
+ FramePainter p2;
+ ImageButton size2(NULL);
+ ImageButton close2(NULL);
+ p2.Init(w2.get(), NULL, &size2, &close2, FramePainter::SIZE_BUTTON_MAXIMIZES);
+ w2->Show();
+
+ // Despite two windows, the first window should still be considered "solo"
+ // because modal windows aren't included in the computation.
+ EXPECT_TRUE(p1.UseSoloWindowHeader());
+
+ // The modal window itself is not considered solo.
+ EXPECT_FALSE(p2.UseSoloWindowHeader());
+}
+
// Constrained windows should not use solo headers.
TEST_F(FramePainterTest, UseSoloWindowHeaderConstrained) {
// Create a widget and a painter for it.