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

Side by Side Diff: ui/views/test/platform_test_helper.mm

Issue 2488393003: Changes views_aura_mus_unittests to create DesktopNativeWidgetAura (Closed)
Patch Set: fix mac Created 4 years, 1 month 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/test/platform_test_helper.cc ('k') | ui/views/test/scoped_views_test_helper.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "ui/views/test/platform_test_helper.h"
6
7 #include <Cocoa/Cocoa.h>
8
9 #import "base/mac/scoped_nsobject.h"
10 #import "base/mac/scoped_objc_class_swizzler.h"
11 #include "base/macros.h"
12 #include "base/memory/ptr_util.h"
13 #import "ui/views/cocoa/bridged_native_widget.h"
14 #include "ui/views/widget/native_widget_mac.h"
15 #include "ui/views/widget/widget.h"
16
17 namespace views {
18 namespace {
19
20 class DefaultPlatformTestHelper : public PlatformTestHelper {
21 public:
22 DefaultPlatformTestHelper() {}
23 ~DefaultPlatformTestHelper() override {}
24
25 // PlatformTestHelper:
26 void SimulateNativeDestroy(Widget* widget) override {
27 // Retain the window while closing it, otherwise the window may lose its
28 // last
msw 2016/11/11 00:29:25 nit: wrapping
sky 2016/11/11 01:09:14 Done.
29 // owner before -[NSWindow close] completes (this offends AppKit). Usually
30 // this reference will exist on an event delivered to the runloop.
31 base::scoped_nsobject<NSWindow> window([widget->GetNativeWindow() retain]);
32 [window close];
33 }
34
35 private:
36 DISALLOW_COPY_AND_ASSIGN(DefaultPlatformTestHelper);
37 };
38
39 } // namespace
40
41 // static
42 std::unique_ptr<PlatformTestHelper> PlatformTestHelper::Create() {
43 return base::WrapUnique(new DefaultPlatformTestHelper);
44 }
45
46 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/test/platform_test_helper.cc ('k') | ui/views/test/scoped_views_test_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698