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

Side by Side Diff: athena/screen/screen_manager_unittest.cc

Issue 653563004: NULL -> nullptr under athena/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: Created 6 years, 2 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 | « athena/screen/screen_manager_impl.cc ('k') | athena/screen_lock/screen_lock_manager_base.cc » ('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 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 <algorithm> 5 #include <algorithm>
6 #include <string> 6 #include <string>
7 7
8 #include "athena/screen/screen_manager_impl.h" 8 #include "athena/screen/screen_manager_impl.h"
9 #include "athena/test/base/athena_test_base.h" 9 #include "athena/test/base/athena_test_base.h"
10 #include "athena/test/base/test_windows.h" 10 #include "athena/test/base/test_windows.h"
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 non_activatable.can_activate_children = false; 97 non_activatable.can_activate_children = false;
98 aura::Window* no_activatable_container = 98 aura::Window* no_activatable_container =
99 ScreenManager::Get()->CreateContainer(non_activatable); 99 ScreenManager::Get()->CreateContainer(non_activatable);
100 100
101 ScreenManager::ContainerParams activatable( 101 ScreenManager::ContainerParams activatable(
102 "activatable", kTestZOrderPriority + 1); 102 "activatable", kTestZOrderPriority + 1);
103 activatable.can_activate_children = true; 103 activatable.can_activate_children = true;
104 aura::Window* activatable_container = 104 aura::Window* activatable_container =
105 ScreenManager::Get()->CreateContainer(activatable); 105 ScreenManager::Get()->CreateContainer(activatable);
106 106
107 scoped_ptr<aura::Window> window( 107 scoped_ptr<aura::Window> window(CreateWindow(
108 CreateWindow(no_activatable_container, NULL, gfx::Rect(0, 0, 100, 100))); 108 no_activatable_container, nullptr, gfx::Rect(0, 0, 100, 100)));
109 EXPECT_FALSE(wm::CanActivateWindow(window.get())); 109 EXPECT_FALSE(wm::CanActivateWindow(window.get()));
110 110
111 activatable_container->AddChild(window.get()); 111 activatable_container->AddChild(window.get());
112 EXPECT_TRUE(wm::CanActivateWindow(window.get())); 112 EXPECT_TRUE(wm::CanActivateWindow(window.get()));
113 } 113 }
114 114
115 TEST_F(ScreenManagerTest, BlockInputsShouldNotBlockVirtualKeyboard) { 115 TEST_F(ScreenManagerTest, BlockInputsShouldNotBlockVirtualKeyboard) {
116 ScreenManager::ContainerParams block_params("blocking", kTestZOrderPriority); 116 ScreenManager::ContainerParams block_params("blocking", kTestZOrderPriority);
117 block_params.can_activate_children = true; 117 block_params.can_activate_children = true;
118 block_params.block_events = true; 118 block_params.block_events = true;
(...skipping 29 matching lines...) Expand all
148 static_cast<ScreenManagerImpl*>(ScreenManager::Get()); 148 static_cast<ScreenManagerImpl*>(ScreenManager::Get());
149 aura::Window* original_default = impl->FindContainerByPriority(CP_DEFAULT); 149 aura::Window* original_default = impl->FindContainerByPriority(CP_DEFAULT);
150 aura::Window* parent = original_default->parent(); 150 aura::Window* parent = original_default->parent();
151 // Temporarily remove the original default container from tree. 151 // Temporarily remove the original default container from tree.
152 parent->RemoveChild(original_default); 152 parent->RemoveChild(original_default);
153 153
154 ScreenManager::ContainerParams params("new_default", CP_END + 1); 154 ScreenManager::ContainerParams params("new_default", CP_END + 1);
155 params.default_parent = true; 155 params.default_parent = true;
156 params.modal_container_priority = CP_END + 2; 156 params.modal_container_priority = CP_END + 2;
157 aura::Window* new_default = ScreenManager::Get()->CreateContainer(params); 157 aura::Window* new_default = ScreenManager::Get()->CreateContainer(params);
158 aura::Window* w = test::CreateNormalWindow(NULL, NULL).release(); 158 aura::Window* w = test::CreateNormalWindow(nullptr, nullptr).release();
159 EXPECT_EQ(new_default, w->parent()); 159 EXPECT_EQ(new_default, w->parent());
160 delete new_default; 160 delete new_default;
161 161
162 // Add the original back to shutdown properly. 162 // Add the original back to shutdown properly.
163 parent->AddChild(original_default); 163 parent->AddChild(original_default);
164 } 164 }
165 165
166 namespace { 166 namespace {
167 167
168 class ScreenManagerTargeterTest 168 class ScreenManagerTargeterTest
169 : public athena::test::AthenaTestBase, 169 : public athena::test::AthenaTestBase,
170 public testing::WithParamInterface<bool> { 170 public testing::WithParamInterface<bool> {
171 public: 171 public:
172 ScreenManagerTargeterTest() 172 ScreenManagerTargeterTest()
173 : targeter_(GetParam() ? NULL : new aura::WindowTargeter) {} 173 : targeter_(GetParam() ? nullptr : new aura::WindowTargeter) {}
174 virtual ~ScreenManagerTargeterTest() {} 174 virtual ~ScreenManagerTargeterTest() {}
175 175
176 protected: 176 protected:
177 scoped_ptr<ui::EventTargeter> targeter_; 177 scoped_ptr<ui::EventTargeter> targeter_;
178 178
179 private: 179 private:
180 DISALLOW_COPY_AND_ASSIGN(ScreenManagerTargeterTest); 180 DISALLOW_COPY_AND_ASSIGN(ScreenManagerTargeterTest);
181 }; 181 };
182 182
183 } // namespace 183 } // namespace
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 event_generator.ClickLeftButton(); 278 event_generator.ClickLeftButton();
279 EXPECT_EQ("0 0", normal_delegate.GetMouseButtonCountsAndReset()); 279 EXPECT_EQ("0 0", normal_delegate.GetMouseButtonCountsAndReset());
280 EXPECT_EQ("0 0", block_delegate.GetMouseButtonCountsAndReset()); 280 EXPECT_EQ("0 0", block_delegate.GetMouseButtonCountsAndReset());
281 } 281 }
282 282
283 INSTANTIATE_TEST_CASE_P(WithOrWithoutTargeter, 283 INSTANTIATE_TEST_CASE_P(WithOrWithoutTargeter,
284 ScreenManagerTargeterTest, 284 ScreenManagerTargeterTest,
285 testing::Values(false, true)); 285 testing::Values(false, true));
286 286
287 } // namespace athena 287 } // namespace athena
OLDNEW
« no previous file with comments | « athena/screen/screen_manager_impl.cc ('k') | athena/screen_lock/screen_lock_manager_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698