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

Side by Side Diff: ash/mus_property_mirror_ash_unittest.cc

Issue 2860503002: mash: Replace int ShelfIDs with AppLaunchID strings. (Closed)
Patch Set: Fix struct traits typo. Created 3 years, 7 months 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 | « ash/mus/window_manager.cc ('k') | ash/public/cpp/app_launch_id.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 "ash/public/cpp/mus_property_mirror_ash.h" 5 #include "ash/public/cpp/mus_property_mirror_ash.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "ash/public/cpp/window_properties.h" 9 #include "ash/public/cpp/window_properties.h"
10 #include "ash/test/ash_test_base.h" 10 #include "ash/test/ash_test_base.h"
(...skipping 28 matching lines...) Expand all
39 window_1.get(), window_2.get(), aura::client::kDrawAttentionKey); 39 window_1.get(), window_2.get(), aura::client::kDrawAttentionKey);
40 EXPECT_TRUE(window_2->GetProperty(aura::client::kDrawAttentionKey)); 40 EXPECT_TRUE(window_2->GetProperty(aura::client::kDrawAttentionKey));
41 } 41 }
42 42
43 // Ensure the property mirror can copy owned object properties between windows. 43 // Ensure the property mirror can copy owned object properties between windows.
44 TEST_F(MusPropertyMirrorAshTest, OwnedProperties) { 44 TEST_F(MusPropertyMirrorAshTest, OwnedProperties) {
45 MusPropertyMirrorAsh mus_property_mirror_ash; 45 MusPropertyMirrorAsh mus_property_mirror_ash;
46 std::unique_ptr<aura::Window> window_1(CreateTestWindow()); 46 std::unique_ptr<aura::Window> window_1(CreateTestWindow());
47 std::unique_ptr<aura::Window> window_2(CreateTestWindow()); 47 std::unique_ptr<aura::Window> window_2(CreateTestWindow());
48 48
49 EXPECT_EQ(nullptr, window_1->GetProperty(aura::client::kAppIdKey));
50 EXPECT_EQ(nullptr, window_2->GetProperty(aura::client::kAppIdKey));
51 window_1->SetProperty(aura::client::kAppIdKey, new std::string("abc"));
52 EXPECT_EQ("abc", *window_1->GetProperty(aura::client::kAppIdKey));
53 mus_property_mirror_ash.MirrorPropertyFromWidgetWindowToRootWindow(
54 window_1.get(), window_2.get(), aura::client::kAppIdKey);
55 EXPECT_EQ("abc", *window_2->GetProperty(aura::client::kAppIdKey));
56 EXPECT_NE(window_1->GetProperty(aura::client::kAppIdKey),
57 window_2->GetProperty(aura::client::kAppIdKey));
58
59 EXPECT_EQ(nullptr, window_1->GetProperty(aura::client::kTitleKey)); 49 EXPECT_EQ(nullptr, window_1->GetProperty(aura::client::kTitleKey));
60 EXPECT_EQ(nullptr, window_2->GetProperty(aura::client::kTitleKey)); 50 EXPECT_EQ(nullptr, window_2->GetProperty(aura::client::kTitleKey));
61 window_1->SetProperty(aura::client::kTitleKey, 51 window_1->SetProperty(aura::client::kTitleKey,
62 new base::string16(base::ASCIIToUTF16("def"))); 52 new base::string16(base::ASCIIToUTF16("abc")));
63 EXPECT_EQ(base::ASCIIToUTF16("def"), 53 EXPECT_EQ(base::ASCIIToUTF16("abc"),
64 *window_1->GetProperty(aura::client::kTitleKey)); 54 *window_1->GetProperty(aura::client::kTitleKey));
65 mus_property_mirror_ash.MirrorPropertyFromWidgetWindowToRootWindow( 55 mus_property_mirror_ash.MirrorPropertyFromWidgetWindowToRootWindow(
66 window_1.get(), window_2.get(), aura::client::kTitleKey); 56 window_1.get(), window_2.get(), aura::client::kTitleKey);
67 EXPECT_EQ(base::ASCIIToUTF16("def"), 57 EXPECT_EQ(base::ASCIIToUTF16("abc"),
68 *window_2->GetProperty(aura::client::kTitleKey)); 58 *window_2->GetProperty(aura::client::kTitleKey));
69 EXPECT_NE(window_1->GetProperty(aura::client::kTitleKey), 59 EXPECT_NE(window_1->GetProperty(aura::client::kTitleKey),
70 window_2->GetProperty(aura::client::kTitleKey)); 60 window_2->GetProperty(aura::client::kTitleKey));
71 61
72 window_1->ClearProperty(aura::client::kWindowIconKey); 62 window_1->ClearProperty(aura::client::kWindowIconKey);
73 EXPECT_EQ(nullptr, window_1->GetProperty(aura::client::kWindowIconKey)); 63 EXPECT_EQ(nullptr, window_1->GetProperty(aura::client::kWindowIconKey));
74 window_2->ClearProperty(aura::client::kWindowIconKey); 64 window_2->ClearProperty(aura::client::kWindowIconKey);
75 EXPECT_EQ(nullptr, window_2->GetProperty(aura::client::kWindowIconKey)); 65 EXPECT_EQ(nullptr, window_2->GetProperty(aura::client::kWindowIconKey));
76 window_1->SetProperty(aura::client::kWindowIconKey, new gfx::ImageSkia()); 66 window_1->SetProperty(aura::client::kWindowIconKey, new gfx::ImageSkia());
77 EXPECT_NE(nullptr, window_1->GetProperty(aura::client::kWindowIconKey)); 67 EXPECT_NE(nullptr, window_1->GetProperty(aura::client::kWindowIconKey));
78 mus_property_mirror_ash.MirrorPropertyFromWidgetWindowToRootWindow( 68 mus_property_mirror_ash.MirrorPropertyFromWidgetWindowToRootWindow(
79 window_1.get(), window_2.get(), aura::client::kWindowIconKey); 69 window_1.get(), window_2.get(), aura::client::kWindowIconKey);
80 EXPECT_NE(nullptr, window_2->GetProperty(aura::client::kWindowIconKey)); 70 EXPECT_NE(nullptr, window_2->GetProperty(aura::client::kWindowIconKey));
81 EXPECT_NE(window_1->GetProperty(aura::client::kWindowIconKey), 71 EXPECT_NE(window_1->GetProperty(aura::client::kWindowIconKey),
82 window_2->GetProperty(aura::client::kWindowIconKey)); 72 window_2->GetProperty(aura::client::kWindowIconKey));
83 } 73 }
84 74
85 } // namespace ash 75 } // namespace ash
OLDNEW
« no previous file with comments | « ash/mus/window_manager.cc ('k') | ash/public/cpp/app_launch_id.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698