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

Side by Side Diff: ui/views/mus/native_widget_mus_unittest.cc

Issue 1864953002: ash/mash: Fix painting of status-tray bubble. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: test Created 4 years, 8 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
« no previous file with comments | « ui/views/mus/native_widget_mus.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "ui/views/mus/native_widget_mus.h" 5 #include "ui/views/mus/native_widget_mus.h"
6 6
7 #include "base/macros.h" 7 #include "base/macros.h"
8 #include "components/mus/public/cpp/property_type_converters.h" 8 #include "components/mus/public/cpp/property_type_converters.h"
9 #include "components/mus/public/cpp/window.h" 9 #include "components/mus/public/cpp/window.h"
10 #include "components/mus/public/cpp/window_property.h" 10 #include "components/mus/public/cpp/window_property.h"
11 #include "components/mus/public/interfaces/window_manager.mojom.h" 11 #include "components/mus/public/interfaces/window_manager.mojom.h"
12 #include "testing/gtest/include/gtest/gtest.h" 12 #include "testing/gtest/include/gtest/gtest.h"
13 #include "third_party/skia/include/core/SkBitmap.h" 13 #include "third_party/skia/include/core/SkBitmap.h"
14 #include "third_party/skia/include/core/SkColor.h" 14 #include "third_party/skia/include/core/SkColor.h"
15 #include "ui/aura/window.h"
15 #include "ui/gfx/geometry/rect.h" 16 #include "ui/gfx/geometry/rect.h"
16 #include "ui/gfx/image/image_skia.h" 17 #include "ui/gfx/image/image_skia.h"
17 #include "ui/gfx/skia_util.h" 18 #include "ui/gfx/skia_util.h"
18 #include "ui/views/test/views_test_base.h" 19 #include "ui/views/test/views_test_base.h"
19 #include "ui/views/widget/widget.h" 20 #include "ui/views/widget/widget.h"
20 #include "ui/views/widget/widget_delegate.h" 21 #include "ui/views/widget/widget_delegate.h"
21 22
22 namespace views { 23 namespace views {
23 namespace { 24 namespace {
24 25
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 widget->UpdateWindowIcon(); 118 widget->UpdateWindowIcon();
118 119
119 // The window has the updated icon. 120 // The window has the updated icon.
120 mus::Window* window = 121 mus::Window* window =
121 static_cast<NativeWidgetMus*>(widget->native_widget_private())->window(); 122 static_cast<NativeWidgetMus*>(widget->native_widget_private())->window();
122 SkBitmap icon = window->GetSharedProperty<SkBitmap>( 123 SkBitmap icon = window->GetSharedProperty<SkBitmap>(
123 mus::mojom::WindowManager::kWindowAppIcon_Property); 124 mus::mojom::WindowManager::kWindowAppIcon_Property);
124 EXPECT_TRUE(gfx::BitmapsAreEqual(bitmap2, icon)); 125 EXPECT_TRUE(gfx::BitmapsAreEqual(bitmap2, icon));
125 } 126 }
126 127
128 TEST_F(NativeWidgetMusTest, ValidLayerTree) {
129 scoped_ptr<Widget> widget(CreateWidget(nullptr));
130 View* content = new View;
131 content->SetPaintToLayer(true);
132 widget->GetContentsView()->AddChildView(content);
133 EXPECT_TRUE(widget->GetNativeWindow()->layer()->Contains(content->layer()));
134 }
135
127 } // namespace 136 } // namespace
128 } // namespace views 137 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/mus/native_widget_mus.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698