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

Side by Side Diff: ash/wm/frame_painter_unittest.cc

Issue 10857021: Prepare a bunch of ash tests for workspace2. With Workspace2 you can't (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ash/wm/frame_painter.cc ('k') | ash/wm/shelf_layout_manager_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "ash/wm/frame_painter.h" 5 #include "ash/wm/frame_painter.h"
6 6
7 #include "ash/shell.h" 7 #include "ash/shell.h"
8 #include "ash/shell_window_ids.h" 8 #include "ash/shell_window_ids.h"
9 #include "ash/test/ash_test_base.h" 9 #include "ash/test/ash_test_base.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
11 #include "grit/ui_resources.h" 11 #include "grit/ui_resources.h"
12 #include "testing/gtest/include/gtest/gtest.h" 12 #include "testing/gtest/include/gtest/gtest.h"
13 #include "ui/aura/root_window.h" 13 #include "ui/aura/root_window.h"
14 #include "ui/views/controls/button/image_button.h" 14 #include "ui/views/controls/button/image_button.h"
15 #include "ui/views/widget/widget.h" 15 #include "ui/views/widget/widget.h"
16 16
17 using views::Widget; 17 using views::Widget;
18 using views::ImageButton; 18 using views::ImageButton;
19 19
20 namespace { 20 namespace {
21 21
22 aura::Window* GetDefaultContainer() {
23 return ash::Shell::GetContainer(
24 ash::Shell::GetPrimaryRootWindow(),
25 ash::internal::kShellWindowId_DefaultContainer);
26 }
27
28 // Creates a test widget that owns its native widget. 22 // Creates a test widget that owns its native widget.
29 Widget* CreateTestWidget() { 23 Widget* CreateTestWidget() {
30 Widget* widget = new Widget; 24 Widget* widget = new Widget;
31 Widget::InitParams params; 25 Widget::InitParams params;
32 params.ownership = Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; 26 params.ownership = Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET;
33 params.parent = GetDefaultContainer();
34 params.child = true;
35 widget->Init(params); 27 widget->Init(params);
36 return widget; 28 return widget;
37 } 29 }
38 30
39 Widget* CreateAlwaysOnTopWidget() { 31 Widget* CreateAlwaysOnTopWidget() {
40 Widget* widget = new Widget; 32 Widget* widget = new Widget;
41 Widget::InitParams params; 33 Widget::InitParams params;
42 params.ownership = Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; 34 params.ownership = Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET;
43 params.parent = GetDefaultContainer();
44 params.child = true;
45 params.keep_on_top = true; 35 params.keep_on_top = true;
46 widget->Init(params); 36 widget->Init(params);
47 return widget; 37 return widget;
48 } 38 }
49 39
50 } // namespace 40 } // namespace
51 41
52 namespace ash { 42 namespace ash {
53 43
54 typedef ash::test::AshTestBase FramePainterTest; 44 typedef ash::test::AshTestBase FramePainterTest;
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 155
166 // Custom overlay image is drawn completely opaque. 156 // Custom overlay image is drawn completely opaque.
167 gfx::ImageSkia custom_overlay; 157 gfx::ImageSkia custom_overlay;
168 EXPECT_EQ(255, 158 EXPECT_EQ(255,
169 p1.GetHeaderOpacity(FramePainter::ACTIVE, 159 p1.GetHeaderOpacity(FramePainter::ACTIVE,
170 IDR_AURA_WINDOW_HEADER_BASE_ACTIVE, 160 IDR_AURA_WINDOW_HEADER_BASE_ACTIVE,
171 &custom_overlay)); 161 &custom_overlay));
172 } 162 }
173 163
174 } // namespace ash 164 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/frame_painter.cc ('k') | ash/wm/shelf_layout_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698