| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "base/macros.h" | 5 #include "base/macros.h" |
| 6 #include "base/memory/scoped_ptr.h" | 6 #include "base/memory/scoped_ptr.h" |
| 7 #include "ui/views/test/views_test_base.h" | 7 #include "ui/views/test/views_test_base.h" |
| 8 | 8 |
| 9 namespace views { | 9 namespace views { |
| 10 | 10 |
| 11 class NativeViewHost; | 11 class NativeViewHost; |
| 12 class NativeViewHostWrapper; | 12 class NativeViewHostWrapper; |
| 13 class Widget; | 13 class Widget; |
| 14 | 14 |
| 15 namespace test { | 15 namespace test { |
| 16 | 16 |
| 17 // Base class for NativeViewHost tests on different platforms. | 17 // Base class for NativeViewHost tests on different platforms. |
| 18 class NativeViewHostTestBase : public ViewsTestBase { | 18 class NativeViewHostTestBase : public ViewsTestBase { |
| 19 public: | 19 public: |
| 20 NativeViewHostTestBase(); | 20 NativeViewHostTestBase(); |
| 21 virtual ~NativeViewHostTestBase(); | 21 ~NativeViewHostTestBase() override; |
| 22 | 22 |
| 23 // Create the |toplevel_| widget. | 23 // Create the |toplevel_| widget. |
| 24 void CreateTopLevel(); | 24 void CreateTopLevel(); |
| 25 | 25 |
| 26 // Create a testing |host_| that tracks destructor calls. | 26 // Create a testing |host_| that tracks destructor calls. |
| 27 void CreateTestingHost(); | 27 void CreateTestingHost(); |
| 28 | 28 |
| 29 // The number of times a host created by CreateHost() has been destroyed. | 29 // The number of times a host created by CreateHost() has been destroyed. |
| 30 int host_destroyed_count() { return host_destroyed_count_; } | 30 int host_destroyed_count() { return host_destroyed_count_; } |
| 31 void ResetHostDestroyedCount() { host_destroyed_count_ = 0; } | 31 void ResetHostDestroyedCount() { host_destroyed_count_ = 0; } |
| (...skipping 21 matching lines...) Expand all Loading... |
| 53 | 53 |
| 54 scoped_ptr<Widget> toplevel_; | 54 scoped_ptr<Widget> toplevel_; |
| 55 scoped_ptr<NativeViewHost> host_; | 55 scoped_ptr<NativeViewHost> host_; |
| 56 int host_destroyed_count_; | 56 int host_destroyed_count_; |
| 57 | 57 |
| 58 DISALLOW_COPY_AND_ASSIGN(NativeViewHostTestBase); | 58 DISALLOW_COPY_AND_ASSIGN(NativeViewHostTestBase); |
| 59 }; | 59 }; |
| 60 | 60 |
| 61 } // namespace test | 61 } // namespace test |
| 62 } // namespace views | 62 } // namespace views |
| OLD | NEW |