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

Side by Side Diff: ui/aura/mus/property_converter_unittest.cc

Issue 2511823002: Fix PropertyConverter test leak. (Closed)
Patch Set: 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 | « no previous file | 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/aura/mus/property_converter.h" 5 #include "ui/aura/mus/property_converter.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 #include <string> 8 #include <string>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 19 matching lines...) Expand all
30 DEFINE_WINDOW_PROPERTY_KEY(bool, kTestPropertyKey0, false); 30 DEFINE_WINDOW_PROPERTY_KEY(bool, kTestPropertyKey0, false);
31 DEFINE_WINDOW_PROPERTY_KEY(uint8_t, kTestPropertyKey1, 0); 31 DEFINE_WINDOW_PROPERTY_KEY(uint8_t, kTestPropertyKey1, 0);
32 DEFINE_WINDOW_PROPERTY_KEY(uint16_t, kTestPropertyKey2, 0); 32 DEFINE_WINDOW_PROPERTY_KEY(uint16_t, kTestPropertyKey2, 0);
33 DEFINE_WINDOW_PROPERTY_KEY(uint32_t, kTestPropertyKey3, 0); 33 DEFINE_WINDOW_PROPERTY_KEY(uint32_t, kTestPropertyKey3, 0);
34 DEFINE_WINDOW_PROPERTY_KEY(uint64_t, kTestPropertyKey4, 0); 34 DEFINE_WINDOW_PROPERTY_KEY(uint64_t, kTestPropertyKey4, 0);
35 DEFINE_WINDOW_PROPERTY_KEY(int8_t, kTestPropertyKey5, 0); 35 DEFINE_WINDOW_PROPERTY_KEY(int8_t, kTestPropertyKey5, 0);
36 DEFINE_WINDOW_PROPERTY_KEY(int16_t, kTestPropertyKey6, 0); 36 DEFINE_WINDOW_PROPERTY_KEY(int16_t, kTestPropertyKey6, 0);
37 DEFINE_WINDOW_PROPERTY_KEY(int32_t, kTestPropertyKey7, 0); 37 DEFINE_WINDOW_PROPERTY_KEY(int32_t, kTestPropertyKey7, 0);
38 DEFINE_WINDOW_PROPERTY_KEY(int64_t, kTestPropertyKey8, 0); 38 DEFINE_WINDOW_PROPERTY_KEY(int64_t, kTestPropertyKey8, 0);
39 39
40 DEFINE_WINDOW_PROPERTY_KEY(gfx::Rect*, kTestRectPropertyKey, nullptr); 40 DEFINE_OWNED_WINDOW_PROPERTY_KEY(gfx::Rect, kTestRectPropertyKey, nullptr);
41 DEFINE_WINDOW_PROPERTY_KEY(std::string*, kTestStringPropertyKey, nullptr); 41 DEFINE_OWNED_WINDOW_PROPERTY_KEY(std::string, kTestStringPropertyKey, nullptr);
42 42
43 const char kTestPropertyServerKey0[] = "test-property-server0"; 43 const char kTestPropertyServerKey0[] = "test-property-server0";
44 const char kTestPropertyServerKey1[] = "test-property-server1"; 44 const char kTestPropertyServerKey1[] = "test-property-server1";
45 const char kTestPropertyServerKey2[] = "test-property-server2"; 45 const char kTestPropertyServerKey2[] = "test-property-server2";
46 const char kTestPropertyServerKey3[] = "test-property-server3"; 46 const char kTestPropertyServerKey3[] = "test-property-server3";
47 const char kTestPropertyServerKey4[] = "test-property-server4"; 47 const char kTestPropertyServerKey4[] = "test-property-server4";
48 const char kTestPropertyServerKey5[] = "test-property-server5"; 48 const char kTestPropertyServerKey5[] = "test-property-server5";
49 const char kTestPropertyServerKey6[] = "test-property-server6"; 49 const char kTestPropertyServerKey6[] = "test-property-server6";
50 const char kTestPropertyServerKey7[] = "test-property-server7"; 50 const char kTestPropertyServerKey7[] = "test-property-server7";
51 const char kTestPropertyServerKey8[] = "test-property-server8"; 51 const char kTestPropertyServerKey8[] = "test-property-server8";
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 188
189 std::string value_2 = "another test value"; 189 std::string value_2 = "another test value";
190 std::vector<uint8_t> transport_value = 190 std::vector<uint8_t> transport_value =
191 mojo::ConvertTo<std::vector<uint8_t>>(value_2); 191 mojo::ConvertTo<std::vector<uint8_t>>(value_2);
192 property_converter.SetPropertyFromTransportValue( 192 property_converter.SetPropertyFromTransportValue(
193 window.get(), kTestStringPropertyServerKey, &transport_value); 193 window.get(), kTestStringPropertyServerKey, &transport_value);
194 EXPECT_EQ(value_2, *window->GetProperty(kTestStringPropertyKey)); 194 EXPECT_EQ(value_2, *window->GetProperty(kTestStringPropertyKey));
195 } 195 }
196 196
197 } // namespace aura 197 } // namespace aura
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698