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

Unified Diff: ui/views/test/platform_test_helper.cc

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 side-by-side diff with in-line comments
Download patch
Index: ui/views/test/platform_test_helper.cc
diff --git a/ui/views/test/platform_test_helper.cc b/ui/views/test/platform_test_helper.cc
index b6626189fa390b2141ef70e1ff3704344714770f..fc461f531429d2a68f495fdf107410c1574cff9f 100644
--- a/ui/views/test/platform_test_helper.cc
+++ b/ui/views/test/platform_test_helper.cc
@@ -7,19 +7,30 @@
#include "base/callback.h"
#include "base/logging.h"
#include "base/memory/ptr_util.h"
+#include "ui/views/widget/widget.h"
+
+#if defined(USE_AURA)
+#include "ui/aura/window.h"
+#endif
namespace views {
namespace {
+#if defined(USE_AURA)
class DefaultPlatformTestHelper : public PlatformTestHelper {
public:
DefaultPlatformTestHelper() {}
-
~DefaultPlatformTestHelper() override {}
+ // PlatformTestHelper:
+ void SimulateNativeDestroy(Widget* widget) override {
+ delete widget->GetNativeView();
+ }
+
private:
DISALLOW_COPY_AND_ASSIGN(DefaultPlatformTestHelper);
};
+#endif
PlatformTestHelper::Factory test_helper_factory;
bool is_mus = false;
@@ -32,12 +43,14 @@ void PlatformTestHelper::set_factory(const Factory& factory) {
test_helper_factory = factory;
}
+#if defined(USE_AURA)
// static
std::unique_ptr<PlatformTestHelper> PlatformTestHelper::Create() {
return !test_helper_factory.is_null()
? test_helper_factory.Run()
: base::WrapUnique(new DefaultPlatformTestHelper);
}
+#endif
// static
void PlatformTestHelper::SetIsMus() {

Powered by Google App Engine
This is Rietveld 408576698