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

Side by Side Diff: ui/views/animation/ink_drop_impl_unittest.cc

Issue 2514293003: Fixed flaky InkDropImpl death test. (Closed)
Patch Set: Uncommented the fix. Created 4 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 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 <memory> 5 #include <memory>
6 6
7 #include "ui/views/animation/ink_drop_impl.h" 7 #include "ui/views/animation/ink_drop_impl.h"
8 8
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 test_api()->CompleteAnimations(); 226 test_api()->CompleteAnimations();
227 227
228 ink_drop()->SetHovered(false); 228 ink_drop()->SetHovered(false);
229 EXPECT_TRUE(AreLayersAddedToHost()); 229 EXPECT_TRUE(AreLayersAddedToHost());
230 230
231 ink_drop()->SetHovered(true); 231 ink_drop()->SetHovered(true);
232 EXPECT_TRUE(AreLayersAddedToHost()); 232 EXPECT_TRUE(AreLayersAddedToHost());
233 } 233 }
234 234
235 #if DCHECK_IS_ON() 235 #if DCHECK_IS_ON()
236 TEST_F(InkDropImplTest, SettingHighlightStateDuringStateExitIsntAllowed) { 236 TEST_F(InkDropImplTest,
237 // This test uses a death assert, which works by forking the process. That 237 SettingHighlightStateDuringStateExitIsntAllowedDeathTest) {
238 // doesn't work well with mus. 238 ::testing::FLAGS_gtest_death_test_style = "threadsafe";
239 if (ViewsTestBase::IsAuraMusClient() || ViewsTestBase::IsMus())
240 return;
241 239
242 test::InkDropImplTestApi::SetStateOnExitHighlightState::Install( 240 test::InkDropImplTestApi::SetStateOnExitHighlightState::Install(
243 test_api()->state_factory()); 241 test_api()->state_factory());
244 ASSERT_DEATH_IF_SUPPORTED( 242 ASSERT_DEATH_IF_SUPPORTED(
245 test::InkDropImplTestApi::AccessFactoryOnExitHighlightState::Install( 243 test::InkDropImplTestApi::AccessFactoryOnExitHighlightState::Install(
246 test_api()->state_factory()), 244 test_api()->state_factory()),
247 ".*HighlightStates should not be changed within a call to " 245 ".*HighlightStates should not be changed within a call to "
248 "HighlightState::Exit\\(\\)\\..*"); 246 "HighlightState::Exit\\(\\)\\..*");
249 // Need to set the |highlight_state_| directly because the 247 // Need to set the |highlight_state_| directly because the
250 // SetStateOnExitHighlightState will recursively try to set it during tear 248 // SetStateOnExitHighlightState will recursively try to set it during tear
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after
565 EXPECT_TRUE(test_api()->IsHighlightFadingInOrVisible()); 563 EXPECT_TRUE(test_api()->IsHighlightFadingInOrVisible());
566 564
567 ink_drop()->SetHovered(false); 565 ink_drop()->SetHovered(false);
568 ink_drop()->SetFocused(false); 566 ink_drop()->SetFocused(false);
569 567
570 EXPECT_TRUE(test_api()->IsHighlightFadingInOrVisible()); 568 EXPECT_TRUE(test_api()->IsHighlightFadingInOrVisible());
571 EXPECT_FALSE(test_api()->ShouldHighlight()); 569 EXPECT_FALSE(test_api()->ShouldHighlight());
572 } 570 }
573 571
574 } // namespace views 572 } // namespace views
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