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

Unified Diff: ui/aura/window_unittest.cc

Issue 801953002: Use template specialization to generate WindowProperty code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: use namespace Created 6 years 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
« no previous file with comments | « ui/aura/window_property.h ('k') | ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/window_unittest.cc
diff --git a/ui/aura/window_unittest.cc b/ui/aura/window_unittest.cc
index 727611363db84d9ffa435d52cf30f8f291ce9dc4..31bbf13b626c37190afcfff6214761b6e06665c0 100644
--- a/ui/aura/window_unittest.cc
+++ b/ui/aura/window_unittest.cc
@@ -45,7 +45,29 @@
#include "ui/gfx/vector2d.h"
DECLARE_WINDOW_PROPERTY_TYPE(const char*)
-DECLARE_WINDOW_PROPERTY_TYPE(int)
+
+namespace {
+
+class TestProperty {
+ public:
+ TestProperty() {}
+ ~TestProperty() {
+ last_deleted_ = this;
+ }
+ static TestProperty* last_deleted() { return last_deleted_; }
+
+ private:
+ static TestProperty* last_deleted_;
+ DISALLOW_COPY_AND_ASSIGN(TestProperty);
+};
+
+TestProperty* TestProperty::last_deleted_ = nullptr;
+
+DEFINE_OWNED_WINDOW_PROPERTY_KEY(TestProperty, kOwnedKey, NULL);
+
+} // namespace
+
+DECLARE_WINDOW_PROPERTY_TYPE(TestProperty*);
namespace aura {
namespace test {
@@ -1582,27 +1604,6 @@ TEST_F(WindowTest, Property) {
EXPECT_EQ(std::string("squeamish"), w->GetProperty(kStringKey));
}
-namespace {
-
-class TestProperty {
- public:
- TestProperty() {}
- virtual ~TestProperty() {
- last_deleted_ = this;
- }
- static TestProperty* last_deleted() { return last_deleted_; }
-
- private:
- static TestProperty* last_deleted_;
- DISALLOW_COPY_AND_ASSIGN(TestProperty);
-};
-
-TestProperty* TestProperty::last_deleted_ = NULL;
-
-DEFINE_OWNED_WINDOW_PROPERTY_KEY(TestProperty, kOwnedKey, NULL);
-
-} // namespace
-
TEST_F(WindowTest, OwnedProperty) {
scoped_ptr<Window> w(CreateTestWindowWithId(0, root_window()));
EXPECT_EQ(NULL, w->GetProperty(kOwnedKey));
« no previous file with comments | « ui/aura/window_property.h ('k') | ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698